From 651de85c49f55f1062958942b177dfb308d4ee87 Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Fri, 20 Mar 2026 22:50:46 -0400 Subject: [PATCH] Disable E's climate watchdog if aircon not in use home_automation/Home-Assistant-Configs#265 --- climate/emma-bedroom/watchdog.js | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/climate/emma-bedroom/watchdog.js b/climate/emma-bedroom/watchdog.js index 681a48c..ace9a09 100644 --- a/climate/emma-bedroom/watchdog.js +++ b/climate/emma-bedroom/watchdog.js @@ -1,9 +1,27 @@ const states = global.get('homeassistant.homeAssistant.states') -const sleeping = states['input_boolean.emma_sleeping'].state -if (sleeping !== 'on') { +// Check if all settings support aircon usage + +const ac = global.get('emmaBedroom.aircon.installed', "diskCon") +const allowed = states['input_boolean.emma_bedroom_climate_protocol'].state +const schedMode = states['input_select.scheduled_climate_mode_emma_bedroom'].state +const coolingActive = states["input_boolean.emma_bedroom_cooling_on"].state +const sleeping = states["input_boolean.emma_sleeping"].state + +let proceed = false + +if (ac === true && allowed === 'on' && schedMode === 'AC' && coolingActive === 'on') { + proceed = true +} + +// + +if (sleeping != 'on') { node.status({fill:'red',shape:'ring',text:'Emma not sleeping, watchdog disabled'}) return null +} else if (proceed === false) { + node.status({fill:'red',shape:'ring',text:'Aircon not in use, watchdog disabled'}) + return null } const airconEntity = ['climate.emma_bedroom_aircon']