Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
da63c34b3d
|
|||
ae17ad6969
|
|||
7a957572c8
|
@ -22,8 +22,8 @@ node.log("Emma Bedroom Climate: Constants Set")
|
||||
|
||||
// Define reusable constants
|
||||
|
||||
const emmaBedroomAircon = "climate.emma_bedroom_aircon"
|
||||
const emmaBedroomWhiteNoise = "input_boolean.white_noise_emma_bedroom"
|
||||
const emmaBedroomAircon = ["climate.emma_bedroom_aircon"]
|
||||
const emmaBedroomWhiteNoise = ["input_boolean.white_noise_emma_bedroom"]
|
||||
const validSchedModesAC = ['AC', 'Fan']
|
||||
|
||||
// Helper function to convert a string to title case
|
||||
@ -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
|
@ -27,8 +27,8 @@ node.log("Master Bedroom Climate: Constants Set")
|
||||
|
||||
// Define some entity IDs
|
||||
|
||||
const masterBedroomAircon = "climate.master_bedroom_aircon"
|
||||
const masterBedroomFan = "fan.master_bedroom_fan"
|
||||
const masterBedroomAircon = ["climate.master_bedroom_aircon"]
|
||||
const masterBedroomFan = ["fan.master_bedroom_fan"]
|
||||
const peopleIDs = ["input_boolean.tony_awake", "input_boolean.tina_awake"]
|
||||
|
||||
// Helper function to convert a string to title case
|
||||
|
@ -1,6 +1,6 @@
|
||||
const states = global.get('homeassistant.homeAssistant.states')
|
||||
const ac = global.get('masterBedroom.aircon.installed', "diskCon")
|
||||
const temp = global.get('outdoorTemptempStr')
|
||||
const temp = global.get('outdoorTemp.tempStr')
|
||||
const threshold = states['input_number.master_bedroom_aircon_run_threshold'].state
|
||||
const dayTemp = states['input_number.master_bedroom_daytime_temp'].state
|
||||
const nightTemp = states['input_number.master_bedroom_night_temp'].state
|
||||
|
Reference in New Issue
Block a user