AC auto mode switching functions
This commit is contained in:
14
climate/emma-bedroom/outdoor-threshold.js
Normal file
14
climate/emma-bedroom/outdoor-threshold.js
Normal file
@@ -0,0 +1,14 @@
|
||||
const outdoor = global.get("outdoorTemp.tempInt")
|
||||
const thresholdEntity = global.get("homeassistant.homeAssistant.states['input_number.emma_bedroom_aircon_mode_threshold'].state")
|
||||
const threshold = parseInt(thresholdEntity)
|
||||
|
||||
msg.outdoor = outdoor
|
||||
msg.modeThreshold = threshold
|
||||
|
||||
if (outdoor >= threshold) {
|
||||
node.status({fill:"green",shape:"dot",text:`${outdoor} >= ${threshold}`})
|
||||
return msg
|
||||
} else {
|
||||
node.status({fill:"red",shape:"ring",text:`${outdoor} < ${threshold}`})
|
||||
return null
|
||||
}
|
||||
14
climate/master-bedroom/outdoor-threshold.js
Normal file
14
climate/master-bedroom/outdoor-threshold.js
Normal file
@@ -0,0 +1,14 @@
|
||||
const outdoor = global.get("outdoorTemp.tempInt")
|
||||
const thresholdEntity = global.get("homeassistant.homeAssistant.states['input_number.master_bedroom_aircon_mode_threshold'].state")
|
||||
const threshold = parseInt(thresholdEntity)
|
||||
|
||||
msg.outdoor = outdoor
|
||||
msg.modeThreshold = threshold
|
||||
|
||||
if (outdoor >= threshold) {
|
||||
node.status({fill:"green",shape:"dot",text:`${outdoor} >= ${threshold}`})
|
||||
return msg
|
||||
} else {
|
||||
node.status({fill:"red",shape:"ring",text:`${outdoor} < ${threshold}`})
|
||||
return null
|
||||
}
|
||||
Reference in New Issue
Block a user