I’m trying to create an alarm automation where the alarm will arm when ALL four entities have been off for 20 minutes, not just one to ensure that no-one is still downstairs i.e. when the last entity is off for 20 minutes it checks the other 3 have been off for at least 20 minutes.
I can’t get it to work and I’m guessing I’m caught in a loop where my ‘OR’ isn’t working properly or something. Help please
- alias: 'Good Night'
trigger:
platform: state
entity_id: input_boolean.media_player_living_room, input_boolean.media_player_play_room, group.motion_downstairs, group.living_room_lights
to: 'off'
for:
minutes: 20
condition:
condition: and
conditions:
- condition: time
after: '00:00:00'
before: '05:00:00'
weekday:
- sun
- mon
- tue
- wed
- thu
- fri
- sat
- condition: state
entity_id: 'input_boolean.media_player_play_room'
state: 'off'
for:
minutes: 20
- condition: state
entity_id: 'input_boolean.media_player_living_room'
state: 'off'
for:
minutes: 20
- condition: state
entity_id: group.motion_downstairs
state: 'off'
for:
minutes: 20
- condition: state
entity_id: group.living_room_lights
state: 'off'
for:
minutes: 20
action:
- service: alarm_control_panel.alarm_arm_home
entity_id: alarm_control_panel.house