Skip to content

Instantly share code, notes, and snippets.

View HarvsG's full-sized avatar

HarvsG

View GitHub Profile

Vibration Sensor

https://joshmccarty.com/how-to-increase-sensitivity-on-aqara-vibration-sensor-with-home-assistant-zha/

I recently purchased an Aqara vibration sensor, but the default sensitivity wasn’t working for my application. The sensor was connected to Home Assistant via the Zigbee Home Automation (ZHA) integration using a GoControl HUSBZB-1. I didn’t see an obvious way to change the sensitivity on the sensor, but fortunately I came across a forum post with the instructions.

In Home Assistant, go to Configuration > Integrations and configure the Zigbee Home Automation integration.

  • Click/tap on Devices and open the device for the vibration sensor.
  • On the device screen, click/tap on Manage Cluster. In the dialog that opens: image
@HarvsG
HarvsG / a-smart-entryphone.md
Last active July 4, 2023 12:38
How I made a dumb Entryphone smart

How I made my doorbell smart

The Problem

I have a simple door entry phone that buzzes when someone rings the bell and lets me 'buzz' them in. I would like some smarts. Firstly I want to be able to notify and automate when someone rings and secondly I would like to be able to buzz people in.

Entry phone systems vary throught the world and so it is unlikely this write-up will work for you, so I have spelt out the general principles I used and the steps I took.

The ingredients:

  • Raspberry Pico W
  • ESP home installed on the above
@HarvsG
HarvsG / toggle-scene.yaml
Created November 24, 2022 13:04
HomeAssistant Blueprint to toggle scenes
blueprint:
name: Toggle Scenes
description: Trigger this automation from another automation using This will allow you to use a single trigger to toggle a scene on or off. A timeout variable is given, after which the trigger will activate the scene irrespective of the state of the last toggle.
domain: automation
input:
scene_input:
name: Scene to be toggled
description: This is the scene that will be turned on and off
selector:
entity:
@HarvsG
HarvsG / match-color-temp-mireds.yaml
Created November 23, 2022 18:48
HA Blueprint to match color temperature of lights to the sun - mireds
blueprint:
name: Match Outside Colour Temperature
description: When a light turns on or the sun elevation changes match the outside colour temperature. It will apply to any bulb that supports color temperature. It triggers whenever a bulb turns on, on sun elevation changes and every 5 minutes.
domain: automation
input:
target_lights:
name: Lights
description: The lights to be controlled
selector:
entity:
@HarvsG
HarvsG / match-color-temp-kelvin.yaml
Last active May 2, 2024 13:26
HA Blueprint to match color temperature of lights to the sun
blueprint:
name: Match Outside Colour Temperature Kelvin
description: When a light turns on or the sun elevation changes match the outside
colour temperature. It will apply to any bulb that supports color temperature.
It triggers whenever a bulb turns on, on sun elevation changes and every 5 minutes.
domain: automation
input:
target_lights:
name: Lights
description: The primary lights to be controlled
@HarvsG
HarvsG / helpingAltycoder.md
Last active October 7, 2022 13:22
example configs.

The hacky, not-reccomended, may break in future solution would be this

  - name: 'family'
    platform: bayesian
    prior: 0.83
    probability_threshold: 0.86
    observations:
      - entity_id: 'device_tracker.nmap_person1'
        prob_given_true: 0.95
        prob_given_false: 0.125
@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 March 20, 2024 06:25
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