Beginnings of Emma's climate watchdog project
home_automation/HA-NerdFlows#31
This commit is contained in:
@ -271,6 +271,26 @@ let sendAcFan = {
|
||||
|
||||
node.log("Emma Bedroom Climate: Message Payloads Defined")
|
||||
|
||||
// Send some parameters to flow context for use in other nodes
|
||||
|
||||
if (setHvac.length > 0) {
|
||||
flow.set('emmaBedroom.airconHvacMode',setHvac,'diskCon')
|
||||
}
|
||||
|
||||
if (setEco.length > 0) {
|
||||
flow.set('emmaBedroom.airconPreset',setEco,'diskCon')
|
||||
}
|
||||
|
||||
if (setTemp.length > 0) {
|
||||
flow.set('emmaBedroom.airconTargetTemp',setTemp,'diskCon')
|
||||
}
|
||||
|
||||
if (setDisplay.length > 0) {
|
||||
flow.set('emmaBedroom.airconDisplay',setDisplay,'diskCon')
|
||||
}
|
||||
|
||||
flow.set('emmaBedroom.airconFanMode','auto','diskCon')
|
||||
|
||||
// Log the parameters that were chosen, for debugging purposes
|
||||
|
||||
node.log("----- Emma Bedroom Climate: Set Parameters -----")
|
||||
|
18
climate/emma-bedroom/watchdog.js
Normal file
18
climate/emma-bedroom/watchdog.js
Normal file
@ -0,0 +1,18 @@
|
||||
const airconState = msg.payload.state
|
||||
const airconAttributes = msg.payload.attributes
|
||||
const airconPreset = airconAttributes['preset_mode']
|
||||
const airconEco = airconAttributes['eco_mode']
|
||||
const airconTargetTemp = airconAttributes['temperature']
|
||||
const airconFanMode = airconAttributes['fan_mode']
|
||||
const airconDisplay = airconAttributes['screen_display']
|
||||
|
||||
msg.payload = {
|
||||
"airconState": airconState,
|
||||
"airconPreset": airconPreset,
|
||||
"airconEco": airconEco,
|
||||
"airconTargetTemp": airconTargetTemp,
|
||||
"airconFanMode": airconFanMode,
|
||||
"airconDisplay": airconDisplay
|
||||
}
|
||||
|
||||
return msg
|
Reference in New Issue
Block a user