Here’s a simple example of the flow. Rather than have this same flow for five different rooms (areas). I’m trying to strip out the area value from the entity name to then turn on the appropriate light in that area.
[
{
"id": "7e8c20b971e9be1e",
"type": "tab",
"label": "Flow 3",
"disabled": false,
"info": "",
"env": []
},
{
"id": "e2d1d51e1d85446d",
"type": "server-state-changed",
"z": "7e8c20b971e9be1e",
"name": "Bathroom Motion",
"server": "2244d24e336a3d2c",
"version": 4,
"exposeToHomeAssistant": false,
"haConfig": [
{
"property": "name",
"value": ""
},
{
"property": "icon",
"value": ""
}
],
"entityidfilter": "binary_sensor.bathroom_occupancy",
"entityidfiltertype": "exact",
"outputinitially": false,
"state_type": "str",
"haltifstate": "on",
"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": 460,
"y": 280,
"wires": [
[
"529b17eb6a6e860d"
],
[
"c2bf93062e4d1c77"
]
]
},
{
"id": "c2bf93062e4d1c77",
"type": "api-call-service",
"z": "7e8c20b971e9be1e",
"name": "Lights Off",
"server": "2244d24e336a3d2c",
"version": 5,
"debugenabled": true,
"domain": "light",
"service": "turn_off",
"areaId": [],
"deviceId": [],
"entityId": [
"light.bathroom"
],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"x": 940,
"y": 280,
"wires": [
[]
]
},
{
"id": "529b17eb6a6e860d",
"type": "api-call-service",
"z": "7e8c20b971e9be1e",
"name": "Lights On",
"server": "2244d24e336a3d2c",
"version": 5,
"debugenabled": true,
"domain": "light",
"service": "turn_on",
"areaId": [],
"deviceId": [],
"entityId": [
"light.bathroom"
],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"x": 940,
"y": 200,
"wires": [
[]
]
},
{
"id": "2244d24e336a3d2c",
"type": "server",
"name": "Home Assistant",
"version": 2,
"addon": false,
"rejectUnauthorizedCerts": true,
"ha_boolean": "y|yes|true|on|home|open",
"connectionDelay": true,
"cacheJson": true,
"heartbeat": false,
"heartbeatInterval": 30
}
]