alias: ZL-MR LED On for A While if Walking In the Dark-Master Room
mode: restart
triggers:
- entity_id:
- binary_sensor.master_room_entrance_motion_sensor_motion
- binary_sensor.master_room_stair_motion_sensor_motion
- binary_sensor.master_room_dressing_table_motion_sensor_motion
- binary_sensor.master_room_tv_motion_sensor_motion
- binary_sensor.master_room_drawer_motion_sensor_motion
- binary_sensor.master_toilet_dressing_room_motion_sensor_motion
to: "on"
trigger: state
conditions:
- condition: state
entity_id: input_select.indoor_brightness
state: dark
actions:
- condition: not
conditions:
- condition: state
entity_id:
- light.master_room_tv_led
- light.master_room_bed_ceiling_light
- light.master_room_drawer_ceiling_light
- light.master_room_lamp_1
- light.master_room_lamp_2
state: "on"
match: any
- alias: Dark Night Mode
if:
condition: state
entity_id: input_boolean.always_on_constant
state: "on"
then:
- parallel:
- entity_id: scene.master_room_dark_night_mode
action: homeassistant.turn_on
- alias: Turn media_player.master_room_tv
if:
- condition: state
entity_id: input_boolean.always_on_constant
state: "on"
then:
if:
- alias: Set TV brightness when it is on
condition: state
entity_id:
- media_player.master_room_tv
state: "on"
then:
data:
entity_id:
- input_select.master_room_tv_picture_mode
option: Movie
action: input_select.select_option
- alias: >-
Wait for floor sensors to go off for 1 min to turn off LED. Stop waiting
if it has wait for 1 hour.
wait_for_trigger:
entity_id:
- binary_sensor.master_room_entrance_motion_sensor_motion
- binary_sensor.master_room_stair_motion_sensor_motion
- binary_sensor.master_room_dressing_table_motion_sensor_motion
- binary_sensor.master_room_tv_motion_sensor_motion
- binary_sensor.master_room_drawer_motion_sensor_motion
- binary_sensor.master_toilet_dressing_room_motion_sensor_motion
to: "off"
for: "00:01:00"
trigger: state
timeout: "01:00:00"
- alias: " Testing if other lights are manually turned on after the LED was on"
condition: not
conditions:
- condition: state
entity_id:
- light.master_room_tv_led
- light.master_room_bed_ceiling_light
- light.master_room_drawer_ceiling_light
- light.master_room_lamp_1
- light.master_room_lamp_2
state: "on"
match: any
- alias: Turn light.master_room_tv_led state=off
if:
- condition: state
entity_id: input_boolean.always_on_constant
state: "on"
then:
entity_id:
- light.master_room_tv_led
action: light.turn_off