From 565dac1946c001770fb46623bc4ffe6c402ca620 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sun, 5 Oct 2025 02:31:16 -0400 Subject: [PATCH] Fix incorrect light value changes Using the force-off of light_off during presence detection change would sometimes cause the response LEDs to disable prematurely, since the on_state can trigger seemingly at random. Switch to using a separate handler for this, which will instead execute after a hold ends (and both our responses leverage holds so this works in all cases). --- supersensor.yaml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/supersensor.yaml b/supersensor.yaml index 3dc3fe7..5af91d6 100644 --- a/supersensor.yaml +++ b/supersensor.yaml @@ -165,6 +165,20 @@ globals: initial_value: '"mww_computer"' script: + - id: presence_light_on + then: + if: + condition: + - switch.is_on: enable_presence_led + - light.is_off: output_led + then: + - light.turn_on: + id: output_led + brightness: 25% + red: 1 + green: 1 + blue: 1 + transition_length: 1s - id: light_off then: if: @@ -817,7 +831,7 @@ binary_sensor: device_class: occupancy on_state: then: - - script.execute: light_off + - script.execute: presence_light_on - platform: gpio name: "PIR GPIO"