Hi everyone - I am embarking on a automation flow that has multiple conditions for turning a bedroom space heater on and off.
I have three conditions I want met for it to be turned on - for it to be less than 70F, during a set time period (sunset to 6AM), and for our family group presence to be “home”.
With these three conditionals, I’m not sure if I’m using the switch nodes right. Specifically inputting multiple payloads.
Would someone be willing to review, and critique my flow if needed?
[
{
"id": "36958ee10b93002c",
"type": "tab",
"label": "Master Bedroom",
"disabled": false,
"info": "",
"env": []
},
{
"id": "8a874552aec2b1a3",
"type": "switch",
"z": "36958ee10b93002c",
"name": "Maintain 70 Degrees",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "lt",
"v": "70",
"vt": "str"
},
{
"t": "gte",
"v": "70",
"vt": "str"
}
],
"checkall": "false",
"repair": false,
"outputs": 2,
"x": 1053.9999389648438,
"y": 178,
"wires": [
[
"1a2d0e5afde80230"
],
[
"6eed48b0f8cc3ef4"
]
]
},
{
"id": "1a2d0e5afde80230",
"type": "api-current-state",
"z": "36958ee10b93002c",
"name": "Heater Off?",
"server": "e204944a.31bc78",
"version": 2,
"outputs": 2,
"halt_if": "off",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "switch.master_bedroom_heater_switch",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "entity"
}
],
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 1452.0000610351562,
"y": 120,
"wires": [
[
"fac765c58b4bf93f"
],
[]
]
},
{
"id": "fac765c58b4bf93f",
"type": "api-call-service",
"z": "36958ee10b93002c",
"name": "Turn Heater On",
"server": "e204944a.31bc78",
"version": 3,
"debugenabled": false,
"service_domain": "switch",
"service": "turn_on",
"entityId": "switch.master_bedroom_heater_switch",
"data": "",
"dataType": "jsonata",
"mergecontext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"x": 2026,
"y": 66,
"wires": [
[]
]
},
{
"id": "6eed48b0f8cc3ef4",
"type": "api-current-state",
"z": "36958ee10b93002c",
"name": "Heater On?",
"server": "e204944a.31bc78",
"version": 2,
"outputs": 2,
"halt_if": "on",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "switch.master_bedroom_heater_switch",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "entity"
}
],
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 1450.0000610351562,
"y": 223,
"wires": [
[
"dbabfb2a0e7dc1fe"
],
[]
]
},
{
"id": "dbabfb2a0e7dc1fe",
"type": "api-call-service",
"z": "36958ee10b93002c",
"name": "Turn Heater Off",
"server": "e204944a.31bc78",
"version": 3,
"debugenabled": false,
"service_domain": "switch",
"service": "turn_off",
"entityId": "switch.master_bedroom_heater_switch",
"data": "",
"dataType": "jsonata",
"mergecontext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"x": 2089,
"y": 541,
"wires": [
[]
]
},
{
"id": "190b40862ad581f0",
"type": "poll-state",
"z": "36958ee10b93002c",
"name": "Master Bedroom Multisensor Temp",
"server": "e204944a.31bc78",
"version": 2,
"exposeToHomeAssistant": false,
"haConfig": [
{
"property": "name",
"value": ""
},
{
"property": "icon",
"value": ""
}
],
"updateinterval": "60",
"updateIntervalType": "num",
"updateIntervalUnits": "seconds",
"outputinitially": true,
"outputonchanged": true,
"entity_id": "sensor.master_bedroom_multisensor_air_temperature",
"state_type": "str",
"halt_if": "",
"halt_if_type": "str",
"halt_if_compare": "is",
"outputs": 1,
"x": 187,
"y": 169.00001525878906,
"wires": [
[
"4ce36b773862f69f"
]
]
},
{
"id": "4ce36b773862f69f",
"type": "time-range-switch",
"z": "36958ee10b93002c",
"name": "Sunset On - Off at 6AM",
"lat": "41.70728",
"lon": "-93.62909",
"startTime": "sunset",
"endTime": "06:00",
"startOffset": 0,
"endOffset": 0,
"x": 534.0000610351562,
"y": 172.2000274658203,
"wires": [
[
"2661e01f1bbdf1cf"
],
[
"dbabfb2a0e7dc1fe"
]
]
},
{
"id": "9c36cd927e18572c",
"type": "server-state-changed",
"z": "36958ee10b93002c",
"name": "Family Presence",
"server": "e204944a.31bc78",
"version": 3,
"exposeToHomeAssistant": false,
"haConfig": [
{
"property": "name",
"value": ""
},
{
"property": "icon",
"value": ""
}
],
"entityidfilter": "group.presence_home",
"entityidfiltertype": "exact",
"outputinitially": true,
"state_type": "str",
"haltifstate": "home",
"halt_if_type": "str",
"halt_if_compare": "is",
"outputs": 2,
"output_only_on_state_change": true,
"for": 0,
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": false,
"ignoreCurrentStateUnavailable": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "eventData"
},
{
"property": "topic",
"propertyType": "msg",
"value": "",
"valueType": "triggerId"
}
],
"x": 525.7999877929688,
"y": 56.80000305175781,
"wires": [
[
"2661e01f1bbdf1cf"
],
[]
]
},
{
"id": "2661e01f1bbdf1cf",
"type": "switch",
"z": "36958ee10b93002c",
"name": "Family Is Home",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "home",
"vt": "str"
},
{
"t": "eq",
"v": "away",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 825,
"y": 109.20002746582031,
"wires": [
[
"8a874552aec2b1a3"
],
[]
]
},
{
"id": "e204944a.31bc78",
"type": "server",
"name": "Home Assistant",
"version": 2,
"addon": false,
"rejectUnauthorizedCerts": false,
"ha_boolean": "y|yes|true|on|home|open",
"connectionDelay": true,
"cacheJson": true,
"heartbeat": false,
"heartbeatInterval": 30
}
]