I use the event feature for buttons in Z2M 2.x version. I’ve noticed that on HA power-up, the “event” is fired as single press and my automations run.
I had to add the condition for trigger.from_state.state not in ['unknown', 'unavailable']
but this sounds wrong approach to me, for something that fires the events and doesn’t have a state.
triggers:
- entity_id:
- event.sonoff_snzb_01_button_1_washing_machine_action
trigger: state
attribute: event_type
to: single
conditions:
- condition: template
value_template: "{{ not trigger.from_state.state in ['unknown', 'unavailable'] }}"
Is this normal that event is fired on power up?