From 8c1d10f3ef62f5463f32ecae78831e285b252467 Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Sat, 29 Mar 2025 01:33:27 -0400 Subject: [PATCH] Master bedroom climate flow entity constants --- climate/master-bedroom/processing.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/climate/master-bedroom/processing.js b/climate/master-bedroom/processing.js index ef3c574..0eded02 100644 --- a/climate/master-bedroom/processing.js +++ b/climate/master-bedroom/processing.js @@ -25,6 +25,12 @@ const coolingActive = states['input_boolean.master_bedroom_cooling_on'].state const echoDotDND = 'switch.basement_echo_dot_do_not_disturb_switch' node.log("Master Bedroom Climate: Constants Set") +// Define some entity IDs + +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 function convertToTitleCase(str) { @@ -194,7 +200,7 @@ let sendFan = { "payload": { "action": `fan.${setFan}`, "target": { - "entity_id": ["fan.master_bedroom_fan"] + "entity_id": masterBedroomFan }, "data": {} } @@ -224,7 +230,7 @@ let sendPeople = { "payload": { "action": `input_boolean.${setPeople}`, "target": { - "entity_id": ["input_boolean.tony_awake","input_boolean.tina_awake"] + "entity_id": peopleIDs }, "data": {} } @@ -258,7 +264,7 @@ let sendHvac = { "payload": { "action": "climate.set_hvac_mode", "target": { - "entity_id": ["climate.master_bedroom_aircon"] + "entity_id": masterBedroomAircon }, "data": { "hvac_mode": setHvac @@ -270,7 +276,7 @@ let sendTemp = { "payload": { "action": "climate.set_temperature", "target": { - "entity_id": ["climate.master_bedroom_aircon"] + "entity_id": masterBedroomAircon }, "data": { "temperature": setTemp @@ -282,7 +288,7 @@ let sendEco = { "payload": { "action": "climate.set_preset_mode", "target": { - "entity_id": ["climate.master_bedroom_aircon"] + "entity_id": masterBedroomAircon }, "data": { "preset_mode": setEco @@ -294,7 +300,7 @@ let sendAcFan = { "payload": { "action": "climate.set_fan_mode", "target": { - "entity_id": ["climate.master_bedroom_aircon"] + "entity_id": masterBedroomAircon }, "data": { "fan_mode": "auto"