I have few Sonoff S31 flashed with ESPHome that are connected to appliances throughout the house.
And I’m trying to write two automation:
Announce (using TTS) if an appliance is running between peak grid pricing time (4 PM- 9 PM). This one is easy as the trigger could be current or power is greater than some low positive value (1A or 20W), it will establish that the appliance is currently running.
Make an annoucement (using TTS) when the load is done, something like “Empty the dishwasher, its been done for over 4 hours!” or “Get the clothes out of the dryer before it starts to smell!”. Here is how the current drawn looks like in the sensor history for the current variable.
But I’m struggling with finding the right trigger for 2) as the appliance is considered to have completed running the cycle when the current goes down to “0” but only after the current has been up over (say 2 A) for at least 30 minutes or so.
What would be a practical way to capture “appliance done running” event using the sensors that are available?
In ESPHome create another boolean sensor (appliance_running with default being “off”), as soon as current goes above 1 A and power increases above 20W appliance_running can be turned to “on”.
In home assistant the automation would only need to monitor “appliance_running” as the trigger.
Based on this it seems that the condition “diswasher_power < 20 for 5 minutes” would evaluate true at 9:05 AM and at 9:06 AM, 9:07AM, 9:08 AM and so forth.
Did I miss something in the documentation or is there a better link for the documentation than the one I used above?
Thanks.
PS: You’ve essentially solved my problem about the dishwasher but the “numeric_state” has unlocked several other options for other automations!
I’ve few outdoor cameras and LED lights (each connected to a Sonoff Basic) for automation, the power to the entire circuit is via “Sonoff PowR2” which can monitor current, voltage and power. I was thinking of writing an automation in case the outdoor circuit goes kaput for any reason and there is an electrical surge.
Your suggestion just made it feasible and I can turn off the circuit if the “Sonoff PowR2” current goes above a threshold and stay powered off till someone in the house has looked for possible damages!