Hi guys,
by now I’m having two automations to turn off the lights depending on the brightness in my living room:
alias: Licht aus bei Helligkeit
description: ''
trigger:
- type: value
platform: device
device_id: 021d216e8342c03ed4abdb83abf3623b
entity_id: sensor.bh1750_lichtsensor
domain: sensor
above: 60
condition:
- condition: sun
after: sunrise
action:
- scene: scene.alle_lichter_aus
- scene: scene.status_leds_50
mode: restart
This one turns all lights off when the brigtness is too low.
alias: Licht aus bei Helligkeit - "Kochen" aktiviert
description: ''
trigger:
- type: value
platform: device
device_id: 021d216e8342c03ed4abdb83abf3623b
entity_id: sensor.bh1750_lichtsensor
domain: sensor
above: 60
condition:
- condition: sun
after: sunrise
- condition: state
entity_id: input_boolean.kochen
state: 'on'
action:
- scene: scene.alle_lichter_aus_ausser_kuchenzeile
- scene: scene.status_leds_50
mode: single
This one turns all lights off when the brigtness is too low. Exception: I’m cooking => the kitchen light should stay on.
Obviously the second one is more important because I don’t want to stand in the darkness while cooking => is it correct to set automation1 with the scene action to restart and automation2 to single (so the single one is not “overwritten” by the restart one)?
Isn’t this possible with only one automation with a condition like this?
if
- condition: sun
after: sunrise
then
if
- condition: state
entity_id: input_boolean.kochen
state: 'on'
then call scene.alle_lichter_aus_ausser_kuchenzeile
else
call scene.alle_lichter_aus
endif
endif