Ascertain when an appliance is done running

Hi,

I have few Sonoff S31 flashed with ESPHome that are connected to appliances throughout the house.

Dishwasher

And I’m trying to write two automation:

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

  2. 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?

Thanks,

Think following might work:

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.

I’ll give it a try tomorrow and share updates.

trigger:
  - platform: numeric_state
    entity_id: sensor.diswasher_power
    below: 0.1 # adjust as necessary 
    for:
      minutes: 5 # adjust as necessary 

@tom_l

Thanks for the suggestion and it solves few other problems for me as I’ve not tried “numeric_state” before!

Here is the challenge with your recommendation on the dishwasher state. Lets assume following:

  1. Dishwasher ran the cleaning cycle from 8:00 AM to 9:00 AM
  2. At 8:00 AM & 9:00 AM, the current drawn was 0 A and power was 0 W
  3. But for the time in-between 8-9 AM, the current drawn was greater than 1 A and power consumed was greater than 20W.

The trigger you suggested (see below) would be “true” between 9:05 AM till 7:55 AM (the next day).

trigger:
  - platform: numeric_state
    entity_id: sensor.diswasher_power
    below: 20  
    for:
      minutes: 5 

Is there a way to limit it to specific time interval when the dishwasher ran (8-9 AM) using the state of current and power drawn during that one hour?

It triggers once, only after the power goes below 20W and stays there. So no, it would not trigger the next day. Try it.

This is the only documentation I could find on “numeric_state” - Bayesian - Home Assistant

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!

No that is the documentation for the Bayesian integration. This is what you want:

No, as I said, the trigger event only occurs when the sensor state goes below the defined value and stays there for the for time.

To re-trigger the state has to go above the below value then back below. It only triggers when crossing this value. Not when staying below it.

1 Like

Wow, this is awesome!

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!

Thanks again!!

@tom_l just tested the code and it worked like a charm! Thanks.

1 Like