Decision logic for heater in "basement shutdown" flow
This commit is contained in:
17
climate/basement/basement_off.js
Normal file
17
climate/basement/basement_off.js
Normal 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'})
|
||||
}
|
Reference in New Issue
Block a user