So I have 2 lights in the bathroom with a motion sensor. What I like to do is create an automation with condition below
Turn of both lights if from 8AM to 11:00PM.
Turn on only one light (switch.master_bathroom_strip_1_2) if from 11:01PM to 7:59AM
Here is my automation, please help me rewrite this script
alias: Strip Light for Master Bathroom
description: ''
trigger:
- type: motion
platform: device
device_id: e283a4a9921e73860d157078c9efbfb6
entity_id: binary_sensor.melody_motion_sensor_motion
domain: binary_sensor
condition: []
action:
- type: turn_on
device_id: 436578c376d53aaa8597269b7b37ae4c
entity_id: switch.master_bathroom_strip_2
domain: switch
- type: turn_on
device_id: a6a746cbde09ced71e929e596d6ac072
entity_id: switch.master_bathroom_strip_1_2
domain: switch
- delay:
hours: 0
minutes: 10
seconds: 0
milliseconds: 0
- type: turn_off
device_id: 436578c376d53aaa8597269b7b37ae4c
entity_id: switch.master_bathroom_strip_2
domain: switch
- type: turn_off
device_id: a6a746cbde09ced71e929e596d6ac072
entity_id: switch.master_bathroom_strip_1_2
domain: switch
mode: single