I hope you don’t mind I tag along on this post
I’m facing a situation at home that somewhat resembles the post you commented on up here?
Using the above suggestions I set u an automation for my living room based on motion when the sun is below the horizon and the light group ‘living room’ is off (This condition is there so it doesn’t trigger when I turned on any light manually in the living room).
When there’s no motion and the input boolean is set to ON (switched to ON by motion automation), the group living room is turned off; this was to make it easy, but I can change this to only the lights that got turned on by the motion automation.
The living room has got a bunch of lights (some in groups because there are for example 4 Philips Hue bulbs in one lamp). I mostly control them using scenes. In every scene évery light has a state ON or OFF (not only the lights that are turned on by the scene), so that when I switch from ‘read lighting’ to ‘mood lighting’ only the lights come on that I want and others are turned off.
Before when the sun would set quite late I’d ask google to start the read scene and because this turned the group ‘living room’ to ON the motion automation would not trigger when the sun dropped below the horizon.
Now that it’s getting dark earlier I’ve ran into a problem… When I walk into the living room and the sun is below the horizon the motion automation triggers; that’s oke. Right after I ask google to switch the read scene on; that works too. BUT… the ‘no motion automation’ still triggers and makes all the lights turn off. I can change this to only turn off the lights that got triggered by the motion automation, but some of them are part of the read scene…
Does anyone know how I can set this up so that the motion automation triggers when all lights are off (group living room = off) and the sun is below the horizon and, when no other lights are turned on, the ‘no motion automation’ turns the lights off BUT when I turn on lights right after the motion automation is triggered the ‘no motion automation’ leaves the lights triggered by the scene on?
Long story, hope you guys understand and can give me a hand
Thank you!
These are the automations:
- alias: PIR woonkamer nachtlamp ON (nachtlamp = night light)
trigger:
- platform: state
entity_id: binary_sensor.pir_03_woonkamer_presence
to: 'on'
condition:
- condition: state
entity_id: light.woonkamer (woonkamer = living room)
state: 'off'
- condition: state
entity_id: sun.sun
state: below_horizon
action:
- service: light.turn_on
data:
entity_id: light.licht_hoek
brightness_pct: 45
kelvin: 2237
transition: 5
- service: light.turn_on
data:
entity_id: light.licht_eetkamer_2
brightness_pct: 25
kelvin: 2237
transition: 5
- service: light.turn_on
data:
entity_id: light.licht_eetkamer_3
brightness_pct: 25
kelvin: 2237
transition: 5
- service: input_boolean.turn_on
entity_id: input_boolean.pir_woonkamer_nachtlamp
id: 0cc7092f8b3140e4aea28e7262cf04f2`
- alias: PIR woonkamer nachtlamp OFF
trigger:
- platform: state
entity_id: binary_sensor.pir_03_woonkamer_presence
to: 'off'
condition:
- condition: state
entity_id: input_boolean.pir_woonkamer_nachtlamp
state: 'on'
- condition: state
entity_id: sun.sun
state: below_horizon
action:
- service: light.turn_off
data:
entity_id: light.woonkamer (light group with all living room lights)
transition: 5
- service: input_boolean.turn_off
entity_id: input_boolean.pir_woonkamer_nachtlamp
id: e1a3bad1d4404f198e34a3258424e144