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:
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.
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.