Skip to content

Instantly share code, notes, and snippets.

View HarvsG's full-sized avatar

HarvsG

View GitHub Profile
@HarvsG
HarvsG / esphome-sensing-mains-voltage-turntable.md
Last active June 19, 2025 12:01
I built an ESPHome project to sense the mains voltage inside my turntable to sense whether it was swtiched on.

ESP-Home Turntable

A quick morning project I did to detect whether my turntable was turned on so I could automate powering on my monitors (speakers). Note - the easiest and safest way to do this was probably with an energy detecting smart plug but I didnt have enough space for one. Another advantage is that it resulst in having an esphome close to my turntable which may come in helpful for future automations. Another better alternative is probably just using a CT clamp.

Ingredients

#/config/blueprints/template/bayesian_probability_sensor.yaml
blueprint:
name: Numeric probability from a Bayesian sensor
description: Creates a sensor which holds the probability of a Bayesian binary sensor
domain: template
source_url: https://gist.github.com/HarvsG/6fff58238fa7b2f8217d9326f6bc997f # used for updates
input:
original_entity:
name: Bayesian binary sensor
description: The Bayesian binary sensor to read the probability from
blueprint:
name: Bayesian Numeric Probability
description: Creates a sensor which holds the numeric probability value from a bayesian binary_sensor
domain: template
source_url: https://gist.githubusercontent.com/HarvsG/6810cb930cee094a902578577eb98796/raw/6305d13cf26b14ccced5ad093ae51cb5cbbe7027/bayesian_probability_sensor.yaml
input:
bayesian_binary_sensor:
name: Bayesian sensor
description: The binary_sensor to have its probability monitored
selector:
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 / deprecated_match_color_temp.yaml
Last active July 16, 2024 18:11
Pre 2022.9 blueprint for Home Assistant to match color_temp lights to the suns color_temp, [For more recent versions of HA see here](https://gist.github.com/HarvsG/cc86381dc99169159d6d4cd870c36e46)
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 / m5stack-atom-echo-mww2beta-reply-on-device-full-config.yaml
Last active August 19, 2024 16:38
ESPHome configs for M5Stack Atom Echo.
# This config enables micro wake word 2 the 'use micro wake word' toggles between it and streaming audio to HA for wake word detection
# Replies come through the terrible on-device speaker
substitutions:
name: m5stack-atom-echo
friendly_name: M5Stack Atom Echo
esphome:
name: ${name}
name_add_mac_suffix: true
friendly_name: ${friendly_name}

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 May 19, 2025 10:55
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: