How To Create A Template Sensor For Dishwasher Which Has Two Power Drops

I have created a template sensor that represents a dishwasher. I’m basing it on checking the power draw and turning the template sensor on or off based on that. However part of the cycle includes a dry where the power goes low for 10 minutes and then fires up again. The result of this is that automations are falsely registering a second turn on. I’d like it to be smart and only “turn off” of power is low for greater than 10 minutes.

What is the best way to set this up? Open to any idea on how to solve this, programming or otherwise.

I solved this with Appdaemon and a high waiting time (>10min).
You can have a look at my code here

Brilliant. I can’t wait to try it out.

Use an automation that watches drop in power draw for a given time. It’s the “for:” Attribute of the Numeric State Trigger automation.

automation:
  trigger:
    platform: numeric_state
    entity_id: sensor.power_draw
    below: 25
    for:
      minutes: 20

@m0wlheld The issue is that this happens twice. I’d like to catch it immediately after the second draw. Would not this solution also trigger on restart of HA?

It would probably. You could use another automation to enable the automation above after the power draw has raised above the threshold.

I just realised I have the variable component installed. I can track the power draw so that real off is the second drop, when the variable is 2. This will also make for simple automations too by using a condition check on the variable.

Appreciate the different approaches from @m0wlheld and @eifinger, there is more than one way to do things with HA.

Full details are here