Skip to content

Instantly share code, notes, and snippets.

@subpardaemon
Last active March 13, 2022 22:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save subpardaemon/ad2be620c76662ff4d977eae77ee9b6a to your computer and use it in GitHub Desktop.
Save subpardaemon/ad2be620c76662ff4d977eae77ee9b6a to your computer and use it in GitHub Desktop.
A Home Assistant blueprint for creating alerts if a powered device (like a heater) operates above a certain power threshold for a certain duration.
blueprint:
name: Heater overrun
description: Do something when a heater operates too long.
domain: automation
input:
power_sensor:
name: Power Sensor
description: Power sensor entity (e.g. from a smart plug device).
selector:
entity:
domain: sensor
overrun_threshold:
name: Starting power threshold
description: Power threshold above which we assume the heater has started.
default: 300.0
selector:
number:
min: 10.0
max: 3000.0
unit_of_measurement: W
mode: slider
step: 10
overrun_duration:
name: Overrun duration
description: Time duration after which we consider the heater is overrunning.
default: 120
selector:
number:
min: 5.0
max: 240.0
unit_of_measurement: min
mode: slider
step: 5.0
actions:
name: Actions
description: Actions (e.g. pushing a notification, TTS announcement, ...)
selector:
action: {}
source_url: https://gist.github.com/subpardaemon/ad2be620c76662ff4d977eae77ee9b6a
trigger:
- platform: numeric_state
entity_id: !input 'power_sensor'
for:
minutes: !input 'overrun_duration'
above: !input 'overrun_threshold'
condition: []
action:
- choose: []
default: !input 'actions'
mode: single
max_exceeded: silent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment