Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
0db67b49b2
|
|||
|
c7c267629d
|
|||
|
651de85c49
|
|||
|
06d31a1c00
|
@@ -11,7 +11,7 @@ let fanOnlyMsg = {
|
|||||||
"topic": "Emma AC Mode: Fan Only"
|
"topic": "Emma AC Mode: Fan Only"
|
||||||
}
|
}
|
||||||
|
|
||||||
if (topic === 'emmabedroom-cooling') {
|
if (topic === 'emmabedroom-climate') {
|
||||||
if (acMode === 'AC') {
|
if (acMode === 'AC') {
|
||||||
node.status({fill:"green",shape:"dot",text:"AC Cooling"})
|
node.status({fill:"green",shape:"dot",text:"AC Cooling"})
|
||||||
return coolMsg
|
return coolMsg
|
||||||
|
|||||||
@@ -322,7 +322,7 @@ if (type === 'auto' && allowed === 'on' && meltdown === 'off' && vacation === 'o
|
|||||||
node.status({ fill: "red", shape: "ring", text: "Blocked (sleep mode)" })
|
node.status({ fill: "red", shape: "ring", text: "Blocked (sleep mode)" })
|
||||||
node.log("Emma Bedroom Climate: Blocked (sleep mode)")
|
node.log("Emma Bedroom Climate: Blocked (sleep mode)")
|
||||||
} else {
|
} else {
|
||||||
if (topic === 'emmabedroom-cooling' && ac === 'on') {
|
if (topic === 'emmabedroom-climate' && ac === 'on') {
|
||||||
node.status({ fill: "green", shape: "dot", text: "Cooling Schedule" })
|
node.status({ fill: "green", shape: "dot", text: "Cooling Schedule" })
|
||||||
node.send([[sendDisplay, sendHvac, sendTemp, sendAcFan, sendEco], null, null])
|
node.send([[sendDisplay, sendHvac, sendTemp, sendAcFan, sendEco], null, null])
|
||||||
node.log("Emma Bedroom Climate: Auto/Cooling")
|
node.log("Emma Bedroom Climate: Auto/Cooling")
|
||||||
|
|||||||
@@ -1,15 +1,30 @@
|
|||||||
const states = global.get('homeassistant.homeAssistant.states')
|
const states = global.get('homeassistant.homeAssistant.states')
|
||||||
const sleeping = states['input_boolean.emma_sleeping'].state
|
|
||||||
|
|
||||||
if (sleeping !== 'on') {
|
// Check if all settings support aircon usage
|
||||||
|
|
||||||
|
const ac = global.get('emmaBedroom.aircon.installed', "diskCon")
|
||||||
|
const allowed = states['input_boolean.emma_bedroom_climate_protocol'].state
|
||||||
|
const schedMode = states['input_select.scheduled_climate_mode_emma_bedroom'].state
|
||||||
|
const coolingActive = states["input_boolean.emma_bedroom_cooling_on"].state
|
||||||
|
const sleeping = states["input_boolean.emma_sleeping"].state
|
||||||
|
|
||||||
|
let proceed = false
|
||||||
|
|
||||||
|
if (ac === 'on' && allowed === 'on' && schedMode === 'AC' && coolingActive === 'on') {
|
||||||
|
proceed = true
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sleeping != 'on') {
|
||||||
node.status({fill:'red',shape:'ring',text:'Emma not sleeping, watchdog disabled'})
|
node.status({fill:'red',shape:'ring',text:'Emma not sleeping, watchdog disabled'})
|
||||||
return null
|
return null
|
||||||
|
} else if (proceed === false) {
|
||||||
|
node.status({fill:'red',shape:'ring',text:'Aircon not in use, watchdog disabled'})
|
||||||
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
const airconEntity = ['climate.emma_bedroom_aircon']
|
|
||||||
|
|
||||||
// Gather relevant attributes from the aircon entity
|
// Gather relevant attributes from the aircon entity
|
||||||
|
|
||||||
|
const airconEntity = ['climate.emma_bedroom_aircon']
|
||||||
const airconState = msg.payload.state
|
const airconState = msg.payload.state
|
||||||
const airconAttributes = msg.payload.attributes
|
const airconAttributes = msg.payload.attributes
|
||||||
const airconEco = airconAttributes['eco_mode']
|
const airconEco = airconAttributes['eco_mode']
|
||||||
|
|||||||
Reference in New Issue
Block a user