#wait_for_trigger never triggering

1 messages · Page 1 of 1 (latest)

manic granite
#

I'm sure I'm missing something simple here - I'm trying to do a simple emulated double click event but the second button press does not ever trigger.

alias: Test double click
description: ""
triggers:
  - trigger: state
    entity_id: event.test_rodrig_action
    not_from: unavailable
    not_to: unavailable
actions:
  - choose:
      - conditions:
          - condition: template
            value_template: "{{trigger.to_state.attributes.event_type == 'on'}}"
        sequence:
          - action: switch.turn_on
            target:
              entity_id: switch.christmas_tree
            enabled: false
      - conditions:
          - condition: template
            value_template: "{{trigger.to_state.attributes.event_type == 'off'}}"
        sequence:
          - wait_for_trigger:
              - trigger: state
                entity_id: event.test_rodrig_action
            timeout:
              seconds: 3
          - choose:
              - conditions:
                  - condition: template
                    value_template: "{{ wait.completed }}"
                sequence:
                  - action: light.turn_off
                    target:
                      entity_id: light.main_bedroom_pots
                    enabled: false
            default:
              - action: switch.turn_off
                target:
                  entity_id: switch.christmas_tree
                enabled: false
mode: queued
max_exceeded: silent
patent moth
#

I wonder if there's a race, since the automation is queued

#

I suggest looking at the event state changes to see if it's doing what you expect

#

it could be a second trigger of the automation that's blocked at the wait_for_trigger that runs after the first one

manic granite
#

I'm curious now. There are quite a few blueprints out there to simulate double-clicks - does that mean that they all have this problem or is it that I'm not doing this "right"? I modeled the above code on https://community.home-assistant.io/t/using-the-new-action-events-in-zigbee2mqtt-2-0/821709/88 and the first post in that thread.