Decision logic for heater in "basement shutdown" flow

This commit is contained in:
2025-01-14 17:16:35 -05:00
parent a06a3c20a3
commit 7ea12a2afa

View File

@ -0,0 +1,17 @@
const states = global.get('homeassistant.homeAssistant.states')
const allowed = states['input_boolean.basement_studio_heat_allowed'].state
const idleTemp = states['input_number.basement_studio_idle_temp'].state
const outsideTemp = states['weather.iron_nerd_weather_station'].attributes.temperature
if (allowed === 'on') {
if (outsideTemp <= 32) {
msg.idle_temp = parseFloat(idleTemp)
node.status({fill:'green',shape:'dot',text:'Idle Temp Set'})
node.send(msg,null)
} else {
node.status({fill:'red',shape:'ring',text:'Heater Shutoff'})
node.send(null,msg)
}
} else {
node.status({fill:'red',shape:'ring',text:'Heat Not Allowed'})
}