i have an automation which is using a entities event to trigger.
its a button and it shall trigger each time the button is pushed. Due to whatever reason it only has four states, three of them for long press, only one for short press. so if the second time in a row i am doing a short press, the event is not triggering anymore - what is the correct solution for something like this?
#how to handle reoccuring event type states?
1 messages · Page 1 of 1 (latest)
You're using the event. entity, with a state trigger?
yeah
alias: Dachfensteröffner
description: ""
triggers:
- trigger: state
entity_id:- event.hmipw_wrc6_0021e0c9a5d484_ch5
attribute: event_type
conditions: []
actions:
- event.hmipw_wrc6_0021e0c9a5d484_ch5
- if:
- condition: numeric_state
entity_id: cover.dachfensteroffner
attribute: current_position
below: 100
then: - choose:
- conditions:
- condition: state
entity_id: cover.dachfensteroffner
state: open
sequence: - action: cover.open_cover
metadata: {}
data: {}
target:
entity_id: cover.dachfensteroffner
- condition: state
- conditions:
- condition: state
entity_id: cover.dachfensteroffner
state: closing
sequence: - action: cover.stop_cover
metadata: {}
data: {}
target:
entity_id: cover.dachfensteroffner
mode: single
- condition: state
- conditions:
- condition: numeric_state
Remove attribute: event_type from the trigger
will do - for learning sake: why? 😄
Because that is only triggering when attribute: event_type changes.
As you have identified, two button presses in a row do not cause a change in event type, and are so ignored.
If you don't specify attribute:, then it will trigger when the state changes