To automatically turn off the lights when im not around.
To make sure that all the lights are off - sometimes one of the bulbs in the Zigbee group desynchronizes and stays on. The automation should turn it off again if nobody is there.
alias: Switch off private office light if nobody is there
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.private_office_presence_sensor_occupancy
to: "off"
for:
hours: 0
minutes: 15
seconds: 0
condition:
- condition: or
conditions:
- condition: state
entity_id: light.private_office_light
state: "on"
- condition: state
entity_id: light.private_office_desk_light
state: "on"
- condition: state
entity_id: light.private_office_light_1
state: "on"
- condition: state
entity_id: light.private_office_light_2
state: "on"
- condition: state
entity_id: light.private_office_light_3
state: "on"
- condition: state
entity_id: light.private_office_light_4
state: "on"
- condition: state
entity_id: light.private_office_light_5
state: "on"
- condition: state
entity_id: light.private_office_light_6
state: "on"
action:
- service: light.turn_off
data:
transition: 2
target:
entity_id:
- light.private_office_desk_light
- light.private_office_light
mode: single
Unfortunately, what this automation actually do is persistently switching the lights ON when im not around, so it is doing exact opposite of what its supposed to do Why this happens?
To simplify this automation , you can put your office lights in a group using a helper. If any one light is ON ,HA will report the helper entity as ON. The state will only be OFF if all lights are OFF
Sorry, this is a misunderstanding, the X is not a problem, the problem is that the condition is met, automation goes to action phase and instead of switching the lights OFF it switches them ON, even if the service call is definitely light.turn_off.
This bit:
I understand the issue. I wanted to convey the automation you posted works as its should in my system. I The source of the issue may not necessarily be the automation.
I was simply offering up my system as a guinea pig to eliminate possible process issues.
Have you tried a simple test of changing turning the lights off to turning them on, as the action? This may then lead to the state being somehow wrong.
Thanks, it seems that the problem went away since i have disabled transition.
Just for the record, my bulbs are Ikea LED2106R3 in case someone will have a similar problem in the future.