Template in "wait for trigger" not working

Hello there,

it’s my first post here and i hope I’m not reposting here, but I couldn’t find something about my problem.

I try to add sliders for how long my lights wait after no movement is detected. It should be possible to add a template for the seconds value as far as I have found out, but I’m still getting “expected float for dictionary value @ data[‘for’][‘seconds’]” as a response for it.
Is it just not possible for the “wait for trigger” yet or do i just miss something here?

Thanks for any help in advance =)

wait_for_trigger:

  • type: no_motion
    platform: device
    device_id: xxx
    entity_id: xxx
    domain: binary_sensor
    for:
    seconds: “{{ states(‘input_number.light_timer_short’) | int(0) }}”

You’re getting that error message because a Device Trigger doesn’t support templates.

I suggest you use a State Trigger which does support templating.

  - wait_for_trigger:
      - platform: state
        entity_id: binary_sensor.your_binary_sensor
        from: 'on'
        to: 'off' 
        for:
          seconds: "{{ states('input_number.light_timer_short') | int(0) }}"

For more information

2 Likes