Continuing the discussion from Automation lights based on motion or door sensor will not not work:
Ok here is YMAL reworked as entity instead of device, so it’s easier to follow along. I can get the automation to work for light switch to turn on if door is opened as an automation and I can get lights to work based on motion as separate automation. If I combine with “or” to give option to turn on lights based on motion or a door opening the motion portion will not trigger lights in this instance. What am I missing?
alias: "Laundry Room door switch "
description: ""
triggers:
- trigger: state
entity_id:
- binary_sensor.laundry_room_door_window_door_is_open
from: "off"
to: "on"
- trigger: state
entity_id:
- binary_sensor.laundry_room_motion_motion_detection
from: "off"
to: "on"
- trigger: state
entity_id:
- binary_sensor.laundry_room_motion_motion_detection
from: "on"
to: "off"
for:
hours: 0
minutes: 5
seconds: 0
conditions: []
actions:
- if:
- condition: state
entity_id: binary_sensor.laundry_room_door_window_door_is_open
state: "on"
- condition: or
conditions:
- condition: state
entity_id: binary_sensor.laundry_room_motion_motion_detection
state: "on"
then:
- action: switch.turn_on
metadata: {}
data: {}
target:
entity_id: switch.wave_1
else:
- action: switch.turn_off
metadata: {}
data: {}
target:
entity_id: switch.wave_1
mode: single
type or paste code here