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 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 setEco = 'none'
|
||||
let setEco = 'turn_off'
|
||||
let setHvac = 'cool'
|
||||
let setAcFan = 'High'
|
||||
let setFan = 'turn_off'
|
||||
@ -14,7 +17,7 @@ let sendFan = {
|
||||
"payload": {
|
||||
"action": `fan.${setFan}`,
|
||||
"target": {
|
||||
"entity_id": ["fan.master_bedroom_fan"]
|
||||
"entity_id": masterBedroomFan
|
||||
},
|
||||
"data": {}
|
||||
}
|
||||
@ -24,7 +27,7 @@ let sendHvac = {
|
||||
"payload": {
|
||||
"action": "climate.set_hvac_mode",
|
||||
"target": {
|
||||
"entity_id": ["climate.master_bedroom_aircon"]
|
||||
"entity_id": masterBedroomAircon
|
||||
},
|
||||
"data": {
|
||||
"hvac_mode": setHvac
|
||||
@ -36,7 +39,7 @@ let sendTemp = {
|
||||
"payload": {
|
||||
"action": "climate.set_temperature",
|
||||
"target": {
|
||||
"entity_id": ["climate.master_bedroom_aircon"]
|
||||
"entity_id": masterBedroomAircon
|
||||
},
|
||||
"data": {
|
||||
"temperature": setTemp
|
||||
@ -46,13 +49,11 @@ let sendTemp = {
|
||||
|
||||
let sendEco = {
|
||||
"payload": {
|
||||
"action": "climate.set_preset_mode",
|
||||
"action": `switch.${setEco}`,
|
||||
"target": {
|
||||
"entity_id": ["climate.master_bedroom_aircon"]
|
||||
"entity_id": ["switch.master_bedroom_aircon_eco_mode"]
|
||||
},
|
||||
"data": {
|
||||
"preset_mode": setEco
|
||||
}
|
||||
"data": {}
|
||||
}
|
||||
}
|
||||
|
||||
@ -60,7 +61,7 @@ let sendAcFan = {
|
||||
"payload": {
|
||||
"action": "climate.set_fan_mode",
|
||||
"target": {
|
||||
"entity_id": ["climate.master_bedroom_aircon"]
|
||||
"entity_id": masterBedroomAircon
|
||||
},
|
||||
"data": {
|
||||
"fan_mode": setAcFan
|
||||
@ -76,7 +77,7 @@ if (toggle === 'on') {
|
||||
node.status({fill:"red",shape:"dot",text:"DANGER MODE ACTIVE"})
|
||||
node.send([null,sendFan,null])
|
||||
if (ac === 'on') {
|
||||
node.send([[sendHvac,sendTemp,sendEco,sendTemp],null,null])
|
||||
node.send([[sendHvac,sendTemp,sendAcFan,sendEco],null,null])
|
||||
}
|
||||
} else {
|
||||
node.status({fill:"green",shape:"dot",text:"Danger Mode Off"})
|
||||
|
Reference in New Issue
Block a user