Emma climate flow rate-limiting

home_automation/Home-Assistant-Configs#237
This commit is contained in:
2025-04-23 22:05:02 -04:00
parent ba56bd08f4
commit 408b85bf6a
2 changed files with 29 additions and 31 deletions

View File

@ -4,8 +4,10 @@ const ac = global.get('emmaBedroom.aircon.installed', "diskCon")
const lastMode = flow.get("emmaBedroom.lastMode", "diskCon")
const bedTemp = states['input_number.emma_bedroom_bedtime_temp'].state
const emmaBedroomAircon = ["climate.emma_bedroom_aircon"]
let setTemp = bedTemp
let setEco = 'none'
let setEco = 'turn_off'
let setHvac = 'cool'
let setAcFan = 'High'
@ -13,7 +15,7 @@ let sendHvac = {
"payload": {
"action": "climate.set_hvac_mode",
"target": {
"entity_id": ["climate.emma_bedroom_aircon"]
"entity_id": emmaBedroomAircon
},
"data": {
"hvac_mode": setHvac
@ -25,7 +27,7 @@ let sendTemp = {
"payload": {
"action": "climate.set_temperature",
"target": {
"entity_id": ["climate.emma_bedroom_aircon"]
"entity_id": emmaBedroomAircon
},
"data": {
"temperature": setTemp
@ -35,13 +37,11 @@ let sendTemp = {
let sendEco = {
"payload": {
"action": "climate.set_preset_mode",
"action": `switch.${setEco}`,
"target": {
"entity_id": ["climate.emma_bedroom_aircon"]
"entity_id": ["switch.emma_bedroom_aircon_eco_mode"]
},
"data": {
"preset_mode": setEco
}
"data": {}
}
}
@ -49,7 +49,7 @@ let sendAcFan = {
"payload": {
"action": "climate.set_fan_mode",
"target": {
"entity_id": ["climate.emma_bedroom_aircon"]
"entity_id": emmaBedroomAircon
},
"data": {
"fan_mode": setAcFan
@ -64,7 +64,7 @@ let reset = {
if (toggle === 'on') {
node.status({fill:"red",shape:"dot",text:"DANGER MODE ACTIVE"})
if (ac === 'on') {
node.send([[sendHvac,sendTemp,sendEco,sendTemp],null])
node.send([[sendHvac,sendTemp,sendAcFan,sendEco],null])
}
} else {
node.status({fill:"green",shape:"dot",text:"Danger Mode Off"})