#How do I make my dishwasher automation more reliable?

20 messages · Page 1 of 1 (latest)

normal hedge
#

I have an automation that kills power to the dishwasher and waits for cheaper electricity pricing before letting the dishwasher run. I have been running into an issue very frequently where the automation just does not kill power to the dishwasher at all.

alias: "Dishwasher: Queue Eco Cycle"
description: >-
  Briefly provides the dishwasher with power so it can be started, then kills
  power, and waits for the Cheapest Window sensor to turn on.
triggers:
  - entity_id:
      - switch.kitchen_switch_right
    to: "on"
    trigger: state
conditions: []
actions:
  - if:
      - condition: state
        entity_id: switch.dishwasher_plug
        state: "off"
    then:
      - action: switch.turn_on
        target:
          entity_id: switch.dishwasher_plug
        data: {}
        alias: Switch on Dishwasher Plug
  - wait_for_trigger:
      - entity_id:
          - sensor.dishwasher_plug_power
        above: 2
        trigger: numeric_state
    continue_on_timeout: false
    #This is the step that fails most often, and I'm not sure why.
  - alias: Turn off Dishwasher Plug & Kitchen Switch Right
    data: {}
    action: switch.turn_off
    target:
      entity_id:
        - switch.dishwasher_plug
        - switch.kitchen_switch_right
  - wait_for_trigger:
      - entity_id:
          - binary_sensor.dishwasher_cheapest_window
        to: "on"
        trigger: state
  - if:
      - condition: state
        entity_id: switch.dishwasher_plug
        state: "off"
    then:
      - alias: Turn on Dishwasher Plug
        data: {}
        action: switch.turn_on
        target:
          entity_id: switch.dishwasher_plug
  - wait_for_trigger:
      - entity_id:
          - binary_sensor.dishwasher_cheapest_window
        to: "off"
        trigger: state
    continue_on_timeout: false
  - alias: Turn off Dishwasher Plug
    data: {}
    action: switch.turn_off
    target:
      entity_id: switch.dishwasher_plug
mode: single
#

I originally thought that the Zigbee Smart Plug that the dishwasher is hooked up to isn't communicating the power usage to the automation in time, but after looking at the traces, on the previous step, I see

Result:
result: true
state: 3

But then the next step (switching the plug off) says This step was not executed and so no further trace information is available.. Is the automation not trying to switch the plug off, or is the off command not reaching the Zigbee smart plug?

tame widget
#
  - wait_for_trigger:
      - entity_id:
          - sensor.dishwasher_plug_power
        above: 2
        trigger: numeric_state
    continue_on_timeout: false
#

You might want a template trigger to check that the value is 2 or higher? Just guessing.

oak skiff
#

Yeah you want to change both your wait_for_triggers to wait_templates - as currently if you try to turn your automation on during the cheapest window (when you'd expect it to run immediately) it will instead wait until the next window which is not the behaviour you want

normal hedge
#

I'm going to have to read up on wait templates. I've never used those before and have no idea how to set them up

oak skiff
#

First one:

  continue_on_timeout: false```
Second one:  ` - wait_template: "{{ states('binary_sensor.dishwasher_cheapest_window') | bool(false) }}"`
Third one: ` - wait_template: "{{ not(states('binary_sensor.dishwasher_cheapest_window') | bool(false)) }}"`
#

Basically just standard template stuff that returns true/false

normal hedge
#

Okay so how or why is this different from a regular wait sensor? I'm not entirely sure when I should decide on using a wait template versus a regular wait in the future.

oak skiff
#

a wait_for_trigger like you have now ONLY triggers and lets the automation continue when it goes from not true to true, e.g. power goes from below 2 to above 2. So if you are already above 2 it does nothing until it dips below 2 and then back up
a wait template lets the automation continue as soon as it evaluates to true, so if it starts above 2, it will continue immediately

tame widget
#

Yes and to clarify a bit if it is already above 2, it will trigger and go. if it isn't it will wait ntil it's above 2 and trigger and go.
What you have now will wait until is below 2 and continue waiting until it is above 2, then trigger and go.

tidal lark
#

An additional remark from my side: adding continue_on_timeout: false doesn't do a thing if you don't provide a timeout

normal hedge
normal hedge
tame widget
#

Is it an integer?

#

IE can the real value be 2.1 or something?

normal hedge
tame widget
#

If you are using this template:

- wait_template: "{{ states('sensor.dishwasher_plug_power') | float(0) > 2}}"
  continue_on_timeout: false

then if you are in that trigger section of the automation, any value above 2.0 will trigger it immediately.

#

But what TheFes says is probably also true, it usually is regarding templates.