Wait for power changes trigger does not wait and either times out or just continues

I have an Arlec Smart Power Plug connected to Tuya (PC191HA (auojpnb4hpc13ftb))

I have an Automation that correctly triggers when the power sensor is above 1000 W
Immediately after I am waiting for the power sensor to be below 1 W for 5 minutes.

However, the Automation never seems to wait for that. It immediately either times out, or continues depending on if I have the timeout setting on or off.

Here is the code:

...
trigger:
  - type: power
    platform: device
    device_id: 8911b77870cb861e2d6890b052cad48a
    entity_id: sensor.pc191ha_power
    domain: sensor
    above: 100
condition: []
action:
  - wait_for_trigger:
      - type: power
        platform: device
        device_id: 8911b77870cb861e2d6890b052cad48a
        entity_id: sensor.pc191ha_power
        domain: sensor
        below: 1
    timeout:
      hours: 0
      minutes: 0
      seconds: 0
      milliseconds: 0
    continue_on_timeout: false
...

What am I doing wrong? Or is is the hardware and others have the same problem?

You don’t want to use timeout here; you can add a for to your wait_for_trigger

That seems to be it. But seriously I thought I did that in an earlier iteration, but this:

wait_for_trigger:
  - type: power
    platform: device
    device_id: 8911b77870cb861e2d6890b052cad48a
    entity_id: sensor.pc191ha_power
    domain: sensor
    for:
      hours: 0
      minutes: 5
      seconds: 0
    below: 1
continue_on_timeout: false

seems to work now.

1 Like