Can't get "Wait For Trigger" to Fire

Hey all

So I have an automation for tracking my washing machine, and (intention) report via the app and alexa when it finishes.

The Washing Machine is running on a smart plug, so I get current measurement. Over 1.0A is used as my trigger.
I then wait for it to be below 0.2A for 4 minutes and that is meant to trigger the alerts. However it doesn’t.
If I remove the “wait for trigger” and “run actions”, it all works as expected. But if I leave “wait for trigger” in, it never fires.

I have tried changing the thresholds (current and time) for the purposes of testing, but no dice.
Any thoughts?

id: '1645018256057'
alias: Washing Machine Finished
description: ''
trigger:
  - type: current
    platform: device
    device_id: 579394ae22c6fc9561bc7099f70b9c50
    entity_id: sensor.washing_machine_b_mss310_current_a_main_channel
    domain: sensor
    for:
      hours: 0
      minutes: 0
      seconds: 0
    above: 1
condition: []
action:
  - wait_for_trigger:
      - type: current
        platform: device
        device_id: 579394ae22c6fc9561bc7099f70b9c50
        entity_id: sensor.washing_machine_b_mss310_current_a_main_channel
        domain: sensor
        below: 0.2
        for:
          hours: 0
          minutes: 4
          seconds: 0
  - service: notify.mobile_app_my_phone
    data:
      message: The Washing Machine is Finished
      title: Washing Machine
  - service: notify.alexa_media_everywhere
    data:
      message: The washing machine has finished its cycle.
      data:
        type: announce
        method: all
mode: restart

This might be no use for you, but I’ve seen a lot of examples of folk using device instead of state triggers recently. I’ve always used state triggers and have read multiple times that this is preferable for some reason. And I’m pretty sure I came across a post the other day very similar to this with someone else suggesting trying state triggers too. Perhaps worth a shot, and doing so means your automation will work if you change the plug (keeping the entity_id the same obviously).

What does the automation’s trace show?

Triggered manually at March 3, 2022, 6:31:13 PM

Wait for device trigger

Still running

and

Executed: March 3, 2022, 6:31:13 PM
Result:

result: true state: 0.11

How can I alter my automation to use a state if the device doesn’t have one?

Device doesn’t have state but your entity does.

The only state the plug reports are “on” or “off” and that referes to the control channel, rather than the actual device plugged in.

Forget the plug state. It’s the sensor state you are interested in. Try this:


trigger:
  - platform: numeric_state
    entity_id: sensor.washing_machine_b_mss310_current_a_main_channel
    above: '1'
condition: []
action:
  - wait_for_trigger:
      - platform: numeric_state
        entity_id: sensor.washing_machine_b_mss310_current_a_main_channel
        below: '0.2'
        for:
          hours: 0
          minutes: 4
          seconds: 0
  - service: notify.mobile_app_my_phone
    data:
      message: The Washing Machine is Finished
      title: Washing Machine
  - service: notify.alexa_media_everywhere
    data:
      message: The washing machine has finished its cycle.
      data:
        type: announce
        method: all
mode: restart

Your trace indicates you triggered the automation manually so that makes it skip the trigger and proceed immediately to the action where the wait_for_trigger executed when it detected a value of 0.11 (which is below 0.2).