In my Master Bedroom closet I have a Wyze motion sensor that triggers a KULED switch to turn the closet light on/off. (CODE BELOW)
I want to add an automation that the light is triggered from 6AM to 9PM, then I want my LED strip (WLED Controlled Wemos d1 mini) to come on from 9PM tp 6AM if motion is triggered.
Where I am having trouble is with the time condition. If some one can point me in the right direction I would appreciate it.
Current code for motion sensor.
####################################################
# MASTER CLOSET LIGHTS ON 16MAR2021 #
####################################################
- id: "1589495884826"
alias: "Lights - Closet Lights ON"
description: Master Bedroom Closet Lights ON
trigger:
- entity_id: binary_sensor.wyze_closet
platform: state
to: "on"
from: "off"
condition: []
action:
- entity_id: switch.master_bedroom_closet_light
service: switch.turn_on
####################################################
# MASTER CLOSET LIGHTS OFF 16MAR2021 #
####################################################
- id: "1589596007289"
alias: "Lights - Closet Lights OFF"
description: Master Bedroom Closet Lights OFF
trigger:
- entity_id: binary_sensor.wyze_closet
for: 00:01:00
platform: state
to: "off"
from: "on"
condition: []
action:
- entity_id: switch.master_bedroom_closet_light
service: switch.turn_off
mode: single
####################################################
# END OF CONFIGURATION FILE #
####################################################
Would I just add the following to the above automation in the Lights On section and reverse it for the LED automation.
condition:
condition: time
after: "06:00:00"
before: "21:00:00"