Skip to content

Instantly share code, notes, and snippets.

View HarvsG's full-sized avatar

HarvsG

View GitHub Profile
@HarvsG
HarvsG / AqaraRockerTeardown.md
Last active February 1, 2024 09:07
My failed experience disassembling an Aqara rocker to see if I could get 5V from it

Aqara Smart Wall Switch H1 (with Neutral, Single Rocker)

I wanted to see if I could tap of 5v from an aqara zigbee rocker to power a neabry Amazon Fire HD8 smart home display.

The device

Aqara H1

The teardown

The device is in two parts:

@HarvsG
HarvsG / tradfriZHAhowtos.md
Last active February 21, 2025 22:40
Adding IKEA Tradfri Devices with ZHA on Home Assistant

Shortcut and On/Off switches

  1. Remove back cover with philips scredriver and instert provided battery
  2. In home assistant select a ZHA always-on zigbee device - such as a powered light or signal repeater in the same room the shortcut button will end up in
  3. Select "Add device via this device"
  4. Press the pair button 4 times on the back of the shortcut button
  5. Wait
  6. If using an On/Off switch and you want to bind it to a bulb for non-controller dependant control (i.e will work if home assistant is down)

Pairing On/Off Switches to IKEA Bulbs

@HarvsG
HarvsG / WireTradfriOnOffToRocker.md
Last active January 5, 2022 14:56
How to wire a Tradfri On/Off Zigbee Remote to a 3 way momentary rocker

WIP

How to wire a 3 position momentary switch to a Tradfri on off switch

The problem

My better half is keen on having Chrome light switches in our house. Unfortunately I am keen to control our smart lighting with Tradfri switches. My original plan was to buy blanking plates and then simply stick the Tradfri On/Off remotes to them. Unfortunately the white plastic on the wife's chrome blanking plates look terrible.

The Idea

@HarvsG
HarvsG / WireGuardNordUpstream.md
Last active April 2, 2024 17:55
How to create a wireguard server with NordVPN upstream

Edit: Likely outdated/broken. See discussion below

Wireguard with Nord Upstream

  1. On a seperate, local machine install NordVPN sh <(wget -qO - https://downloads.nordcdn.com/apps/linux/install.sh)
  2. Enable nord permissions sudo usermod -aG nordvpn $USER && sudo reboot
  3. set Nord to use wireguard nordvpn set technology NordLynx then nordvpn login
  4. nordvpn whitelist add subnet 192.168.0.0/24
  5. On the local machine connect to the nordvpn country of choice nordvpn connect ch, ch is Switzerland
  6. On the local machine sudo wg showconf nordlynx to see the client private key and server pubkey
@HarvsG
HarvsG / aHowTo80211ronQSKD.md
Last active February 3, 2023 01:59
A hacked Qualcomm SDK OpenWRT 150.05 /lib/wifi/hostapd.sh to get 802.11r working. A copy of my /etc/config/wireless as well

How to get 802.11r (Fast Transition) working on Qualcomms fork of OpenWRT 15.05. In this case on a Gl-inet router

Unfortunately just setting the 4 lines as detailed in this reddit post almost works, however hostapd fails to start due to the auto generated r0kh strings having incorrect formatting. The sypmtom was that the network would appear as open and devices would fail to connect.

image

As far as I can tell at the time of writing, this r0khs are unecessary with WPA2-PSK forms of authentication if ft_psk_generate_local=1 is enabled in hostapd. So I commented out lines 688 - 690 of /lib/wifi/hostapd.sh

@HarvsG
HarvsG / HA-GLinet-Intergration.md
Last active June 24, 2021 13:54
My plan to build a GL inet integration for HomeAssistant

How to create a new env for a jupyter workspce

  1. Ensure that the requirement for working with envs are installed sudo apt install python3-venv

  2. Work out the python version you want to work with python --version or python3 --version or which python

  3. Once you have chosen the python version cd to the directory you want the env to be stored in

  4. run /path/to/my/python3 -m venv nameOfEnv of course this may just be python not python3

  • in my case /usr/bin/python3
.markup.jupyter {
pre { line-height: 125%; margin: 0; }
td.linenos pre { color: #000000; background-color: #f0f0f0; padding-left: 5px; padding-right: 5px; }
span.linenos { color: #000000; background-color: #f0f0f0; padding-left: 5px; padding-right: 5px; }
td.linenos pre.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight { background: #f8f8f8; }
.highlight .c { color: #408080; font-style: italic } /* Comment */
.highlight .err { border: 1px solid #FF0000 } /* Error */
@HarvsG
HarvsG / installNewPython.md
Last active November 14, 2020 22:55
How to install a new version of python on the raspberry pi

Install the packages for compiling $ sudo apt-get install -y build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libffi-dev wget

Set the python version you want $ version=3.8.5

Download $ wget https://www.python.org/ftp/python/$version/Python-$version.tgz ~/

Extract the file

@HarvsG
HarvsG / aOracleAlwaysOnWGVPN.md
Last active August 28, 2024 12:26
How I set up and always on wigaurd PiHole VPN and DNS