From ba7af1addf17c772c57a4dd6169609a130e8241c Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Thu, 29 May 2025 17:30:44 -0400 Subject: [PATCH] Use early night mode instead of evening, lights were triggering early home_automation/HA-NerdFlows#32 --- time-based/light-level-filter.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/time-based/light-level-filter.js b/time-based/light-level-filter.js index 78823c4..fe903ea 100644 --- a/time-based/light-level-filter.js +++ b/time-based/light-level-filter.js @@ -2,12 +2,12 @@ const states = global.get('homeassistant.homeAssistant.states') const luxThresholdLivingRoom = states['input_number.living_room_lux_threshold'].state const luxThresholdStairwell = states['input_number.stairwell_lux_threshold'].state const luxThresholdOutdoor = states['input_number.sunset_lights_outdoor_lux_threshold'].state -const evening = states['binary_sensor.evening'].state +const earlyNight = states['binary_sensor.early_night_mode'].state const triggered = states['input_boolean.sunset_lights_triggered'].state const level = msg.level const room = msg.room -if (evening === 'on' && triggered === 'off') { +if (earlyNight === 'on' && triggered === 'off') { if (room === 'living-room' && level <= luxThresholdLivingRoom) { node.status({fill:'green',shape:'dot',text:'Sent (Living Room)'}) node.send([msg,msg]) @@ -18,7 +18,7 @@ if (evening === 'on' && triggered === 'off') { node.status({fill:'green',shape:'dot',text:'Sent (Outdoor)'}) node.send([msg,msg]) } -} else if (evening === 'off') { +} else if (earlyNight === 'off') { node.status({fill:'red',shape:'ring',text:'Not Evening'}) } else if (triggered === 'on') { node.status({fill:'red',shape:'ring',text:'Already Triggered'})