Hey there. I’m looking to see if it’s possible or get some help on the following. I’d like to set up 2 automations on some strips of LED lights I have set up on a smart plug. they currently light up the basement stairs. What I’d like is to
Set the lights to turn on autmatically at 5pm and shut off at 2am. (basic time schedule)
Have that smartplug shut off the LED lights IF the basement light is turned on. The basement light is a leviton smart switch already configured in HASSIO. ( is this possible? )
I’m new to autmations and trigger and any help with the coding would be great. Thank you in advance.
- alias: 'Turn the lights on at 5pm'
trigger:
platform: time
at: '17:00:00'
condition: []
action:
- service: light.turn_on
entity_id: light.yourlightentity
- alias: 'Turn the lights off at 2am'
trigger:
platform: time
at: '02:00:00'
condition: []
action:
- service: light.turn_off
entity_id: light.yourlightentity
- alias: 'Turn the LED lights off when basement light on'
trigger:
platform: state
entity_id: light.basementlightentity
from: 'off'
to: 'on'
condition: []
action:
- service: light.turn_off
entity_id: light.yourLEDlightentity
I also suggest reading this to understand everything about automations
thank you so much for the quick reply =) I’ve got the toggle working as expected, I’ll try the time condition later this afternoon. I really appreciate the assistance.
You are welcome. One note here: I must have done something wrong with the formatting of the automation and the indentation is off. Dont copy my automations, write them from the beggining. If you have problems, reply and I will rewrite the automations correctly.