AC auto mode switching functions

This commit is contained in:
2025-09-02 02:46:22 -04:00
parent 4aa305c9d2
commit 5440325aaf
2 changed files with 28 additions and 0 deletions

View 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
}

View 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
}