diff --git a/climate/basement/basement_off.js b/climate/basement/basement_off.js new file mode 100644 index 0000000..9fa60c0 --- /dev/null +++ b/climate/basement/basement_off.js @@ -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'}) +} \ No newline at end of file