Close

A bug in the dryer state transitions

A project log for Laundry monitoring

A collection of notes and pointers for the usual laundry monitoring project.

wjcarpenterWJCarpenter 08/30/2023 at 21:160 Comments

A logic error quickly revealed itself in the state transitions I described earlier. I had said, for both the washer and the dryer, that the power turning off must lead to the STOPPED state no matter what. For the dryer, I used a measure of 8 watts above or below for a little while. That's to account for the interior light that comes on when the door is opened. The trigger for power off was "power less than 8 watts for 1 minute".

The problem with that trigger is that opening the door, unloading the dryer, and then closing the door triggers "power off" and the dryer goes back into the STOPPED state.

I kept the same power on and off triggers for the dryer, but I modified the condition guarding the action resulting from the dryer power off trigger. It is now "triggered by dryer power off, and current dryer state is RUNNING". I don't really need that extra logic for the washer, which has no interior light, but I'm adding it just for consistency.

The YAML for that looks like this:

condition: and
conditions:
  - condition: trigger
    id: power_off_dryer
  - condition: template
    value_template: "{{ dryer_before|lower == 'running' }}"

Discussions