What’s the most efficient way to setup lights that have a master slave relationship eg I have 1 switch that controls the light (wired to the light) but I have multiple other “slave” switches that I want to control the same light via automation (not wired to the light). Each time I’ve set up a flow in node red it creates a loop. The loop eventually ends but I’d prefer to have something that doesn’t create a loop. Here’s what I currently have for 3 light switches.
[
{
"id": "a018dcfff48028ac",
"type": "trigger-state",
"z": "aa85dabc648140dc",
"name": "Office Bathroom ON",
"server": "d3151d26.c0d4f",
"version": 5,
"inputs": 0,
"outputs": 2,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"light.office_bathroom"
],
"substring": [],
"regex": []
},
"debugEnabled": false,
"constraints": [
{
"targetType": "this_entity",
"targetValue": "",
"propertyType": "current_state",
"propertyValue": "new_state.state",
"comparatorType": "is",
"comparatorValueDatatype": "str",
"comparatorValue": "on"
},
{
"targetType": "entity_id",
"targetValue": "light.sw_office_koi_in_office_2",
"propertyType": "current_state",
"propertyValue": "new_state.state",
"comparatorType": "is",
"comparatorValueDatatype": "str",
"comparatorValue": "off"
},
{
"targetType": "entity_id",
"targetValue": "light.sonoff_10009954d0_1",
"propertyType": "current_state",
"propertyValue": "new_state.state",
"comparatorType": "is",
"comparatorValueDatatype": "str",
"comparatorValue": "off"
}
],
"customOutputs": [],
"outputInitially": false,
"stateType": "str",
"enableInput": false,
"x": 170,
"y": 80,
"wires": [
[
"8435b896eb93246d"
],
[]
]
},
{
"id": "8435b896eb93246d",
"type": "api-call-service",
"z": "aa85dabc648140dc",
"name": "Turn ON ALL others",
"server": "d3151d26.c0d4f",
"version": 7,
"debugenabled": false,
"action": "light.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.sw_office_koi_in_office_2",
"light.sonoff_10009954d0_1"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "light",
"service": "turn_on",
"x": 430,
"y": 80,
"wires": [
[]
]
},
{
"id": "b6fa67a9cc83dd77",
"type": "trigger-state",
"z": "aa85dabc648140dc",
"name": "Koi in Office ON",
"server": "d3151d26.c0d4f",
"version": 5,
"inputs": 0,
"outputs": 2,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"light.sw_office_koi_in_office_2"
],
"substring": [],
"regex": []
},
"debugEnabled": false,
"constraints": [
{
"targetType": "this_entity",
"targetValue": "",
"propertyType": "current_state",
"propertyValue": "new_state.state",
"comparatorType": "is",
"comparatorValueDatatype": "str",
"comparatorValue": "on"
},
{
"targetType": "entity_id",
"targetValue": "light.office_bathroom",
"propertyType": "current_state",
"propertyValue": "new_state.state",
"comparatorType": "is",
"comparatorValueDatatype": "str",
"comparatorValue": "off"
},
{
"targetType": "entity_id",
"targetValue": "light.sonoff_10009954d0_1",
"propertyType": "current_state",
"propertyValue": "new_state.state",
"comparatorType": "is",
"comparatorValueDatatype": "str",
"comparatorValue": "off"
}
],
"customOutputs": [],
"outputInitially": false,
"stateType": "str",
"enableInput": false,
"x": 160,
"y": 240,
"wires": [
[
"2255252f13a66138"
],
[]
]
},
{
"id": "2255252f13a66138",
"type": "api-call-service",
"z": "aa85dabc648140dc",
"name": "Turn ON all others",
"server": "d3151d26.c0d4f",
"version": 7,
"debugenabled": false,
"action": "light.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.office_bathroom",
"light.sonoff_10009954d0_1"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "light",
"service": "turn_on",
"x": 430,
"y": 240,
"wires": [
[]
]
},
{
"id": "67b389c23cfb2ae0",
"type": "trigger-state",
"z": "aa85dabc648140dc",
"name": "Office Bathroom OFF",
"server": "d3151d26.c0d4f",
"version": 5,
"inputs": 0,
"outputs": 2,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"light.office_bathroom"
],
"substring": [],
"regex": []
},
"debugEnabled": false,
"constraints": [
{
"targetType": "this_entity",
"targetValue": "",
"propertyType": "current_state",
"propertyValue": "new_state.state",
"comparatorType": "is",
"comparatorValueDatatype": "str",
"comparatorValue": "off"
},
{
"targetType": "entity_id",
"targetValue": "light.sw_office_koi_in_office_2",
"propertyType": "current_state",
"propertyValue": "new_state.state",
"comparatorType": "is",
"comparatorValueDatatype": "str",
"comparatorValue": "on"
},
{
"targetType": "entity_id",
"targetValue": "light.sonoff_10009954d0_1",
"propertyType": "current_state",
"propertyValue": "new_state.state",
"comparatorType": "is",
"comparatorValueDatatype": "str",
"comparatorValue": "on"
}
],
"customOutputs": [],
"outputInitially": false,
"stateType": "str",
"enableInput": false,
"x": 180,
"y": 160,
"wires": [
[
"5ee3de2adaf51920"
],
[]
]
},
{
"id": "5ee3de2adaf51920",
"type": "api-call-service",
"z": "aa85dabc648140dc",
"name": "Turn OFF ALL others",
"server": "d3151d26.c0d4f",
"version": 7,
"debugenabled": false,
"action": "light.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.sw_office_koi_in_office_2",
"light.sonoff_10009954d0_1"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "light",
"service": "turn_off",
"x": 440,
"y": 160,
"wires": [
[]
]
},
{
"id": "fb30b2e9690d734a",
"type": "trigger-state",
"z": "aa85dabc648140dc",
"name": "Koi in Office OFF",
"server": "d3151d26.c0d4f",
"version": 5,
"inputs": 0,
"outputs": 2,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"light.sw_office_koi_in_office_2"
],
"substring": [],
"regex": []
},
"debugEnabled": false,
"constraints": [
{
"targetType": "this_entity",
"targetValue": "",
"propertyType": "current_state",
"propertyValue": "new_state.state",
"comparatorType": "is",
"comparatorValueDatatype": "str",
"comparatorValue": "off"
},
{
"targetType": "entity_id",
"targetValue": "light.office_bathroom",
"propertyType": "current_state",
"propertyValue": "new_state.state",
"comparatorType": "is",
"comparatorValueDatatype": "str",
"comparatorValue": "on"
},
{
"targetType": "entity_id",
"targetValue": "light.sonoff_10009954d0_1",
"propertyType": "current_state",
"propertyValue": "new_state.state",
"comparatorType": "is",
"comparatorValueDatatype": "str",
"comparatorValue": "on"
}
],
"customOutputs": [],
"outputInitially": false,
"stateType": "str",
"enableInput": false,
"x": 160,
"y": 320,
"wires": [
[
"54bd2711b2a06cc4"
],
[]
]
},
{
"id": "54bd2711b2a06cc4",
"type": "api-call-service",
"z": "aa85dabc648140dc",
"name": "Turn OFF ALL others",
"server": "d3151d26.c0d4f",
"version": 7,
"debugenabled": false,
"action": "light.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.office_bathroom",
"light.sonoff_10009954d0_1"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "light",
"service": "turn_off",
"x": 440,
"y": 320,
"wires": [
[]
]
},
{
"id": "18dc1b7ff68d23dc",
"type": "trigger-state",
"z": "aa85dabc648140dc",
"name": "Office light ON",
"server": "d3151d26.c0d4f",
"version": 5,
"inputs": 0,
"outputs": 2,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"light.sonoff_10009954d0_1"
],
"substring": [],
"regex": []
},
"debugEnabled": false,
"constraints": [
{
"targetType": "this_entity",
"targetValue": "",
"propertyType": "current_state",
"propertyValue": "new_state.state",
"comparatorType": "is",
"comparatorValueDatatype": "str",
"comparatorValue": "on"
},
{
"targetType": "entity_id",
"targetValue": "light.office_bathroom",
"propertyType": "current_state",
"propertyValue": "new_state.state",
"comparatorType": "is",
"comparatorValueDatatype": "str",
"comparatorValue": "off"
},
{
"targetType": "entity_id",
"targetValue": "light.sw_office_koi_in_office_2",
"propertyType": "current_state",
"propertyValue": "new_state.state",
"comparatorType": "is",
"comparatorValueDatatype": "str",
"comparatorValue": "off"
}
],
"customOutputs": [],
"outputInitially": false,
"stateType": "str",
"enableInput": false,
"x": 160,
"y": 400,
"wires": [
[
"76b12068f9ec7c4b"
],
[]
]
},
{
"id": "76b12068f9ec7c4b",
"type": "api-call-service",
"z": "aa85dabc648140dc",
"name": "Turn ON ALL others",
"server": "d3151d26.c0d4f",
"version": 7,
"debugenabled": false,
"action": "light.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.office_bathroom",
"light.sw_office_koi_in_office_2"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "light",
"service": "turn_on",
"x": 430,
"y": 400,
"wires": [
[]
]
},
{
"id": "731afb276233a9fc",
"type": "trigger-state",
"z": "aa85dabc648140dc",
"name": "Office light OFF",
"server": "d3151d26.c0d4f",
"version": 5,
"inputs": 0,
"outputs": 2,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"light.sonoff_10009954d0_1"
],
"substring": [],
"regex": []
},
"debugEnabled": false,
"constraints": [
{
"targetType": "this_entity",
"targetValue": "",
"propertyType": "current_state",
"propertyValue": "new_state.state",
"comparatorType": "is",
"comparatorValueDatatype": "str",
"comparatorValue": "off"
},
{
"targetType": "entity_id",
"targetValue": "light.office_bathroom",
"propertyType": "current_state",
"propertyValue": "new_state.state",
"comparatorType": "is",
"comparatorValueDatatype": "str",
"comparatorValue": "on"
},
{
"targetType": "entity_id",
"targetValue": "light.sw_office_koi_in_office_2",
"propertyType": "current_state",
"propertyValue": "new_state.state",
"comparatorType": "is",
"comparatorValueDatatype": "str",
"comparatorValue": "on"
}
],
"customOutputs": [],
"outputInitially": false,
"stateType": "str",
"enableInput": false,
"x": 160,
"y": 480,
"wires": [
[
"bbeaca38bd4efe4f"
],
[]
]
},
{
"id": "bbeaca38bd4efe4f",
"type": "api-call-service",
"z": "aa85dabc648140dc",
"name": "Turn OFF ALL others",
"server": "d3151d26.c0d4f",
"version": 7,
"debugenabled": false,
"action": "light.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.office_bathroom",
"light.sw_office_koi_in_office_2"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "light",
"service": "turn_off",
"x": 440,
"y": 480,
"wires": [
[]
]
},
{
"id": "d3151d26.c0d4f",
"type": "server",
"name": "Home Assistant Tyrrell",
"addon": true,
"rejectUnauthorizedCerts": true,
"ha_boolean": "",
"connectionDelay": false,
"cacheJson": false,
"heartbeat": false,
"heartbeatInterval": "",
"areaSelector": "friendlyName",
"deviceSelector": "friendlyName",
"entitySelector": "friendlyName",
"statusSeparator": "/",
"statusYear": "numeric",
"statusMonth": "numeric",
"statusDay": "numeric",
"statusHourCycle": "h23",
"statusTimeFormat": "h:m",
"enableGlobalContextStore": true
}
]