I have a power metering plug on my Washing machine that up till now just looked for the power usage to drop below 1w for 2 mins and send an app alert to mine and my wifes phones. It works 90% ok except can get false postives as even on standby can go over 1w and back down thus triggering an alert.
I had an idea to build some deeper logic into the alert hoping to alleviate this issue. The idea was to set my trigger to start when over 200w for 1 second. Then would continue to an If-Then in the action.
Here is a sample of my YAML config. It seems to just skip the alert component even though I have asked it to wait for upto 2 hours for next condition.
alias: Notification - Washing Machine Cycle Complete
description: >-
This automation uses power metering to determine when the machine has finished
a washing cycle and sends a notification to both Michael and Colleen.
trigger:
- type: power
platform: device
device_id: 29feabd00ccc2d74e4edf0adabaea88e
entity_id: 539637b7036b6b1b72bac86756216cae
domain: sensor
for:
hours: 0
minutes: 0
seconds: 1
above: 200
condition: []
action:
- service: notify.mobile_app_michaels_iphone_14
data:
message: Washing machine has finished
enabled: false
- service: notify.mobile_app_colleens_iphone_14
data:
message: The washing machine has finished
enabled: false
- if:
- type: is_power
condition: device
device_id: 29feabd00ccc2d74e4edf0adabaea88e
entity_id: 539637b7036b6b1b72bac86756216cae
domain: sensor
above: 200
then:
- wait_for_trigger:
- type: power
platform: device
device_id: 29feabd00ccc2d74e4edf0adabaea88e
entity_id: 539637b7036b6b1b72bac86756216cae
domain: sensor
below: 1
for:
hours: 0
minutes: 2
seconds: 0
timeout:
hours: 2
minutes: 0
seconds: 0
milliseconds: 0
- service: notify.mobile_app_colleens_iphone_14
data:
message: Washing cycle complete
- service: notify.mobile_app_michaels_iphone_14
data:
message: Washing cycle complete
mode: single