- alias: 'Auto: Living room - Table - Lightswitch 2'
initial_state: 'on'
trigger:
- platform: state
entity_id: binary_sensor.xiaomidoorcontact5_contact
to: 'on'
condition:
- condition: state
entity_id: light.eettafel_lamp_1
state: 'off'
action:
- service: light.turn_on
entity_id: light.eettafel_lamp_1
This works as expected; the light turns on when some binary sensor turns On.
However, this automation also triggers when i reboot Hass.io while this sensor is True. This is not very nice.
Is this a known problem?
Has this to do with the integration this sensor is coming from (zigbee2mqtt)?
It seems like this sensor is initialized internally as False, and then gets its value from the physical sensor and triggers the automation.
I see the following information in my logbook:
8:07 PM Eettafel lamp 1 turned on
8:07 PM Auto: Living room - Table - Lightswitch 2 has been triggered
8:06 PM Auto: Living room - Table - Lightswitch 2 turned on
8:06 PM Home Assistant restarted
I will try it tonight with the following automation:
- alias: "Automation: Delayed start of all automations"
initial_state: 'on'
trigger:
platform: homeassistant
# Event can also be 'shutdown'
event: start
action:
- delay: '00:00:20' # 20 seconds
- service: automation.turn_on
entity_id: all
I havenât specified entity_ids for my automations, so Iâll try first with entity_id: all
If this doesnât work I have to add ids for all automations that have to start delayed.