AC auto mode switching functions
This commit is contained in:
@@ -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
|
||||||
|
}
|
||||||
@@ -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