Skip to content

Instantly share code, notes, and snippets.

View HarvsG's full-sized avatar

HarvsG

View GitHub Profile
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 October 26, 2024 16:42
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 July 30, 2024 13:45
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