Need reliable action for noisy condition

I’m still a novice, but I have been setting up automations using YAML. I set up a TTS to Alexa to notify when the dryer is finished (useful in my house) using an energy monitoring plug. However the signal from the washer is more noisy (as you might expect), and I can’t pick a single threshold that will give a reliable trigger because the watts drop to near zero several times during the cycles. I used the threshold helper in YAML to set up a binary sensor “washer running” and would like to have it wait until the value is below 8 for about 3 minutes before switching the sensor to “Off”, but I am not yet skilled enough to write that. I would welcome other ideas within my skill set. Here is the brief code:

‘# Washer Finished Notification’
‘- id: washer finished notification’
’ alias: Washer Finished Notification’
’ description: Washer Finished Notification’
’ trigger:’
’ - platform: state’
’ entity_id:’
’ - binary_sensor.washer_running’
’ from: ‘on’’
’ to: ‘off’’
’ condition:’
’ - condition: time’
’ after: ‘10:00:00’’
’ before: 00:00:00’
’ weekday:’
’ - sun’
’ - mon’
’ - tue’
’ - wed’
’ - thu’
’ - fri’
’ - sat’
’ action:’
’ - service: notify.alexa_media_louis_s_office_echo_dot’
’ data:’
’ message: The washer has finished. The clothes are ready for drying.’
’ data:’
’ Type: tts’

Have you tried @Sbyx’s “Appliance Has Finished” blueprint? That is what I use for the exact situation you have described, and it has been very reliable for me.

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

No, but I will give it a try. With the duration parameters it looks like it may work. Thanks. I’ll let you know.

I imported the blueprint (the first time I have attempted that) and could not get it to work. I kept getting errors about a pre-condition or pre-action. I have been fine tuning the threshold wattage for the “threshold helper” and it is working pretty well. I occasionally get a false alert. I would suggest that a “duration” parameter be added to the threshold helper to indicate the time a value must be across the threshold before the helper triggers. Is there a way to add a duration time to a trigger in YAML? Something where I could say “The binary_sensor.washer_running sensor must be off for 3 min before the action triggers.”?

Got just what I needed from RobC on the HA Discord. Simply added a “For:” statement followed by a duration required to the trigger as below. Seems to work perfectly. I had looked at two other appliance status blueprints (including the one listed in this thread, but they seemed more complicated that I needed. Thanks for the help.

‘- id: washer finished notification’
’ alias: Washer Finished Notification’
’ description: Washer Finished Notification’
’ trigger:’
’ - platform: state’
’ entity_id:’
’ - binary_sensor.washer_running’
’ from: ‘on’’
’ to: ‘off’’
’ for: 00:03:00’
’ condition:’
’ - condition: time’
’ after: 08:00:00’
’ action:’
’ - service: notify.alexa_media_louis_s_office_echo_dot’
’ data:’
’ message: The washer has finished. The clothes are ready for drying.’
’ data:’
’ Type: tts’