I need some help to do what i want as simple as possible, and if you could help me it would be great.
I want a room with light during 16 hours, from 6:00 to 22:00 so I have a light bulb to do so. The room is illuminated during the sun light, so the light will be only enabled when the sun is down and between the time range.
For example sun rise is on at ‘7:00’ and sun set is on at ‘21:00’, so I need to turn on the light only from 6 to 7 in the morning, and 21 to 22 in the night.
- id: light_on_16_hours
alias: 'Light On 16 Hours'
trigger:
- platform: time
at: '06:00:00'
- platform: sun
event: sunset
condition:
condition: state # prevent turning on in case the sun is up before 6am
entity_id: sun.sun
state: 'below_horizon'
action:
service: light.turn_on
entity_id: light.your_light
- id: light_off_16_hours
alias: 'Light Off 16 Hours'
trigger:
- platform: time
at: '22:00:00'
- platform: sun
event: sunrise
action:
service: light.turn_off
entity_id: light.your_light