Hi everyone,
I have a very simple automation that triggers light to turn on when my sensor detects presence and for the light to turn off when my sensor detects I’m gone as seen in the code below:
alias: mainfloor washroom lights
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.mainfloor_washroom_mmwave
to: "on"
id: Detected
- platform: state
entity_id:
- binary_sensor.mainfloor_washroom_mmwave
to: "off"
id: Clear
condition: []
action:
- choose:
- conditions:
- condition: trigger
id: Detected
sequence:
- service: light.turn_on
data: {}
target:
entity_id: light.mainfloor_washroom_led
- conditions:
- condition: trigger
id: Clear
sequence:
- service: light.turn_off
data: {}
target:
entity_id: light.mainfloor_washroom_led
mode: single
This works great most of the time but there are times where the light won’t turn off.
As you can see in the traces image at 10:12, it works properly and option 2 was executed and (light.mainfloor_washroom_led) turned off.
However the same option 2 was executed at 12:10 but it shows that option 2 was executed but the washroom_led state didn’t change.
I have checked the link quality on that zigbee device and it shows generally very good between 91 to 98
I have also set the QoS to 2 to ensure delivery of messages.
The weird thing is this light won’t turn off occasionally but it works most of the time and it works every time turning on.
I’ve been racking my brain and I can’t figure it out and I want expert eyes on here to see if I’m doing something wrong or what else I can try.
Thanks in advance