Master bedroom meltdown center rate-limiting
home_automation/Home-Assistant-Configs#237
This commit is contained in:
@ -4,8 +4,11 @@ const ac = global.get('masterBedroom.aircon.installed', "diskCon")
|
|||||||
const lastMode = flow.get("masterBedroom.lastMode", "diskCon")
|
const lastMode = flow.get("masterBedroom.lastMode", "diskCon")
|
||||||
const bedTemp = states['input_number.master_bedroom_bedtime_temp'].state
|
const bedTemp = states['input_number.master_bedroom_bedtime_temp'].state
|
||||||
|
|
||||||
|
const masterBedroomAircon = ["climate.master_bedroom_aircon"]
|
||||||
|
const masterBedroomFan = ["fan.master_bedroom_fan"]
|
||||||
|
|
||||||
let setTemp = bedTemp
|
let setTemp = bedTemp
|
||||||
let setEco = 'none'
|
let setEco = 'turn_off'
|
||||||
let setHvac = 'cool'
|
let setHvac = 'cool'
|
||||||
let setAcFan = 'High'
|
let setAcFan = 'High'
|
||||||
let setFan = 'turn_off'
|
let setFan = 'turn_off'
|
||||||
@ -14,7 +17,7 @@ let sendFan = {
|
|||||||
"payload": {
|
"payload": {
|
||||||
"action": `fan.${setFan}`,
|
"action": `fan.${setFan}`,
|
||||||
"target": {
|
"target": {
|
||||||
"entity_id": ["fan.master_bedroom_fan"]
|
"entity_id": masterBedroomFan
|
||||||
},
|
},
|
||||||
"data": {}
|
"data": {}
|
||||||
}
|
}
|
||||||
@ -24,7 +27,7 @@ let sendHvac = {
|
|||||||
"payload": {
|
"payload": {
|
||||||
"action": "climate.set_hvac_mode",
|
"action": "climate.set_hvac_mode",
|
||||||
"target": {
|
"target": {
|
||||||
"entity_id": ["climate.master_bedroom_aircon"]
|
"entity_id": masterBedroomAircon
|
||||||
},
|
},
|
||||||
"data": {
|
"data": {
|
||||||
"hvac_mode": setHvac
|
"hvac_mode": setHvac
|
||||||
@ -36,7 +39,7 @@ let sendTemp = {
|
|||||||
"payload": {
|
"payload": {
|
||||||
"action": "climate.set_temperature",
|
"action": "climate.set_temperature",
|
||||||
"target": {
|
"target": {
|
||||||
"entity_id": ["climate.master_bedroom_aircon"]
|
"entity_id": masterBedroomAircon
|
||||||
},
|
},
|
||||||
"data": {
|
"data": {
|
||||||
"temperature": setTemp
|
"temperature": setTemp
|
||||||
@ -46,13 +49,11 @@ let sendTemp = {
|
|||||||
|
|
||||||
let sendEco = {
|
let sendEco = {
|
||||||
"payload": {
|
"payload": {
|
||||||
"action": "climate.set_preset_mode",
|
"action": `switch.${setEco}`,
|
||||||
"target": {
|
"target": {
|
||||||
"entity_id": ["climate.master_bedroom_aircon"]
|
"entity_id": ["switch.master_bedroom_aircon_eco_mode"]
|
||||||
},
|
},
|
||||||
"data": {
|
"data": {}
|
||||||
"preset_mode": setEco
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,7 +61,7 @@ let sendAcFan = {
|
|||||||
"payload": {
|
"payload": {
|
||||||
"action": "climate.set_fan_mode",
|
"action": "climate.set_fan_mode",
|
||||||
"target": {
|
"target": {
|
||||||
"entity_id": ["climate.master_bedroom_aircon"]
|
"entity_id": masterBedroomAircon
|
||||||
},
|
},
|
||||||
"data": {
|
"data": {
|
||||||
"fan_mode": setAcFan
|
"fan_mode": setAcFan
|
||||||
@ -76,7 +77,7 @@ if (toggle === 'on') {
|
|||||||
node.status({fill:"red",shape:"dot",text:"DANGER MODE ACTIVE"})
|
node.status({fill:"red",shape:"dot",text:"DANGER MODE ACTIVE"})
|
||||||
node.send([null,sendFan,null])
|
node.send([null,sendFan,null])
|
||||||
if (ac === 'on') {
|
if (ac === 'on') {
|
||||||
node.send([[sendHvac,sendTemp,sendEco,sendTemp],null,null])
|
node.send([[sendHvac,sendTemp,sendAcFan,sendEco],null,null])
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
node.status({fill:"green",shape:"dot",text:"Danger Mode Off"})
|
node.status({fill:"green",shape:"dot",text:"Danger Mode Off"})
|
||||||
|
Reference in New Issue
Block a user