I think I have a solution, but I’ll know for sure tonight after the washing machine runs.
I created an input boolean called “drying”. It’s simply off/on or F/T or 0/1.
I then created two automations.
Drying Cycle on:
alias: drying cycle on
description: ""
trigger:
- platform: numeric_state
entity_id: sensor.shelly_dishwasher_switch_0_power
above: 2
condition:
- condition: or
conditions:
- condition: numeric_state
entity_id: sensor.shelly_dishwasher_switch_0_power
above: 550
below: 840
- condition: and
conditions:
- condition: state
entity_id: input_boolean.drying
state: "on"
for:
hours: 0
minutes: 1
seconds: 0
- condition: numeric_state
entity_id: sensor.shelly_dishwasher_switch_0_power
above: 3
below: 6
action:
- condition: state
entity_id: input_boolean.drying
state: "on"
mode: single
And Drying Cycle Off
alias: drying cycle off
description: ""
trigger:
- platform: numeric_state
entity_id: sensor.shelly_dishwasher_switch_0_power
below: 2
condition:
- condition: and
conditions:
- condition: state
entity_id: input_boolean.drying
state: "on"
- condition: numeric_state
entity_id: sensor.shelly_dishwasher_switch_0_power
below: 2
above: 0
action:
- condition: state
entity_id: input_boolean.drying
state: "off"
mode: single
This drying cycle automation incorporates the more complex power measurements, including some and conditions, and self refences the binary boolean state to see if it’s on, and then if the idle phase power requirements are met, it keeps the binary boolean in the on state.
The off automation checks to see if the binary boolean is on, and then the power goes below 2 W, and resets the binary boolean to off. This way, when the next load is run, it’s not starting in the “on” binary state.
I then changed my original sensor state to reference the state of input boolean, and make the state of the Dishwasher sensor as Drying. The other elif statements remain the same.
- name: "Dishwasher"
state: >
{% if states("input_boolean.drying") == "on" %}
Drying
{% elif states("sensor.shelly_dishwasher_switch_0_power")|float == 0 %}
Off
{% elif states("sensor.shelly_dishwasher_switch_0_power")|float <= 2 %}
Standby
{% else %}
Washing
{% endif %}
I believe this should work, but if anyone sees anything glaring in my logic, please let me know.