I’ve got a simple automation for tracking when the washing machine is done. If power consumption is below X for Y many minutes, assume the washing machine is done and notify me.
This works well enough, but if I have to reboot HA or reload my automations, that automation fires after Y minutes because technically the power usage has been less than X watts. In other words, it doesn’t know if the washing machine has been on or not.
I could expand this with a second automation that would check if the power consumption is above X, then switch on a second automation that would check to see if power consumption is below X before notifying, but that’s two automations just to know with certainty if the washing machine is done.
I’d like to see an “arm and release” style trigger option, like the numeric_trigger
, but with a start and end. For example:
# This automation will fire only when the washing machine goes above 500w for > 5 minutes, then drop below 50w for > 5 minutes
- alias: Notify when washing machine done
trigger:
- platform: armed_state
entity_id: sensor.washing_machine_power
start: # The trigger is "armed" when this condition is met
above: 500 # When the washing machine goes above 500w
for:
minutes: 5 # For more than 5 minutes
end: # This automation is "fired" (triggered) when this condition is met, but only if the 'start' condition is met
below: 50 # When the washing machine goes below 50w (standby mode, for example)
for:
minutes: 5
action:
- service: light.turn_on
entity_id: light.laundry
I’d imagine this would work a little like the generic_thermostat
component which watches an entity’s value and takes action based on when a value goes above or below a certain limit.
I’d have a go at this myself, but I’m still teaching myself Python…