#Trigger event automation

1 messages · Page 1 of 1 (latest)

vernal cipher
#

When I have the device (Matter integration) and I have to attach to the event type of entity to detect button press, when button is pressed once and in few seconds again, the value does not change, even if event is re-fired.

The below trigger won't fire if the same event happens twice in a row, but only if it changes:

  - trigger: state
    entity_id:
      - event.eventname
    attribute: event_type

What is the correct or recommended way to proceed to get every event triggered, even if 2 of them are the same one after another?
Trigger only on the entity state (or any of its arguments) and use the condition for value?

I am for example interested in every button single press

lilac oracle
#

Don't specify the attribute in the trigger, instead use it in a template condition. That could be a general condition, or as a condition for a Choose or If/Then action.

condition: template
value_template: |
  {{ trigger.to_state.attributes.event_type == 'toggle'}}
quartz jackal
#

I would advise you to add not_from: unavailable to the trigger to avoid false triggers after a restart

vernal cipher
#

because otherwise how do we handle first event -> is the value restored after restart?

quartz jackal
#

It restores to the last known event, it's only unknown before the first event