Dear people,
I want different lightning profiles for the time of the day. How would i achieve this?
For example:
During the day, brightness 80%, color white
After sunset, brightness 60%, color red
Midnight till 6 o’clock 10%, color red
Ok so this is my config:
alias: Turn on the lights
description: ""
trigger:
- platform: time
at: "07:00:00"
- platform: sun
event: sunrise
offset: "-10"
- platform: sun
event: sunset
offset: "+10"
- platform: state
entity_id:
- group.presence_home
for:
hours: 0
minutes: 0
seconds: 0
- platform: state
entity_id:
- sensor.outside_dark
condition:
- condition: time
after: "06:45:00"
before: "23:00:00"
action:
- if:
- condition: and
conditions:
- condition: state
entity_id: group.presence_home
state: home
- condition: state
entity_id: sensor.outside_dark
state: "True"
- condition: sun
before: sunset
then:
- service: light.turn_on
data: {}
target:
entity_id: light.floor_led
else:
- service: light.turn_off
data: {}
target:
area_id: living_room
enabled: false
- if:
- condition: state
entity_id: group.presence_home
state: not_home
for:
hours: 0
minutes: 0
seconds: 0
then:
- service: light.turn_off
data: {}
target:
area_id: living_room
else: []
- if:
- condition: and
conditions:
- condition: state
entity_id: group.presence_home
state: home
- condition: state
entity_id: sensor.outside_dark
state: "True"
- condition: sun
before: sunset
after: sunset
then:
- service: light.turn_on
data: {}
target:
area_id: living_room
else:
- service: light.turn_off
data: {}
target:
area_id: living_room
enabled: false
- if:
- condition: or
conditions:
- condition: state
entity_id: sensor.outside_dark
state: "False"
- condition: state
entity_id: group.presence_home
state: not_home
then:
- service: light.turn_off
data: {}
target:
area_id: living_room
else: []
mode: single
I also built a sensor (sensor.outside_dark) which checks if it’s dark outside, based on if it’s cloudy, dark or rainy or the sun has set.