Help me condense/simplify my flow

So I have a lamp over the couch that has 3 smart bulbs in it. I always want them ALL on or ALL off. But sometimes for whatever reason, 1 fails to turn off or on with the others.

I created the flow below to check each one against each other so if 2 are one way and 1 is not, the 1 is made to conform to the 2. Right now I have them being checked against each other when another lamp in the room changes state and every minute.

But there has to be a cleaner way to do this.

[
    {
        "id": "7fb0c6f8a4ad507e",
        "type": "tab",
        "label": "Flow 2",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "cf7c317535a9c090",
        "type": "api-current-state",
        "z": "7fb0c6f8a4ad507e",
        "name": "Couch light 1 on?",
        "server": "ab3e2c53.e3491",
        "version": 3,
        "outputs": 2,
        "halt_if": "on",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "entity_id": "light.living_room_couch_lamp1",
        "state_type": "str",
        "blockInputOverrides": true,
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "entityState"
            },
            {
                "property": "data",
                "propertyType": "msg",
                "value": "",
                "valueType": "entity"
            }
        ],
        "for": "0",
        "forType": "num",
        "forUnits": "minutes",
        "override_topic": false,
        "state_location": "payload",
        "override_payload": "msg",
        "entity_location": "data",
        "override_data": "msg",
        "x": 645,
        "y": 135,
        "wires": [
            [
                "d5df2e4a86ce652b"
            ],
            []
        ]
    },
    {
        "id": "bd22c467809fc49a",
        "type": "inject",
        "z": "7fb0c6f8a4ad507e",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "60",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 130,
        "y": 135,
        "wires": [
            [
                "cf7c317535a9c090",
                "755e1ff0e41c8594",
                "5c4360104a8f4f49",
                "7b4cf5d1210eedb2",
                "ea833815ed243b2c",
                "278e5b9dfc8b1efa"
            ]
        ]
    },
    {
        "id": "d5df2e4a86ce652b",
        "type": "api-current-state",
        "z": "7fb0c6f8a4ad507e",
        "name": "Couch light 2 on?",
        "server": "ab3e2c53.e3491",
        "version": 3,
        "outputs": 2,
        "halt_if": "on",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "entity_id": "light.living_room_couch_lamp2",
        "state_type": "str",
        "blockInputOverrides": true,
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "entityState"
            },
            {
                "property": "data",
                "propertyType": "msg",
                "value": "",
                "valueType": "entity"
            }
        ],
        "for": "0",
        "forType": "num",
        "forUnits": "minutes",
        "override_topic": false,
        "state_location": "payload",
        "override_payload": "msg",
        "entity_location": "data",
        "override_data": "msg",
        "x": 855,
        "y": 135,
        "wires": [
            [
                "0b0fa4a0a7805189"
            ],
            []
        ]
    },
    {
        "id": "0b0fa4a0a7805189",
        "type": "api-current-state",
        "z": "7fb0c6f8a4ad507e",
        "name": "Couch light 3 on?",
        "server": "ab3e2c53.e3491",
        "version": 3,
        "outputs": 2,
        "halt_if": "on",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "entity_id": "light.living_room_couch_lamp3",
        "state_type": "str",
        "blockInputOverrides": true,
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "entityState"
            },
            {
                "property": "data",
                "propertyType": "msg",
                "value": "",
                "valueType": "entity"
            }
        ],
        "for": "0",
        "forType": "num",
        "forUnits": "minutes",
        "override_topic": false,
        "state_location": "payload",
        "override_payload": "msg",
        "entity_location": "data",
        "override_data": "msg",
        "x": 1065,
        "y": 135,
        "wires": [
            [],
            [
                "0b7c5ffc69e13d4d"
            ]
        ]
    },
    {
        "id": "0b7c5ffc69e13d4d",
        "type": "api-call-service",
        "z": "7fb0c6f8a4ad507e",
        "name": "ON: Couch light 3",
        "server": "ab3e2c53.e3491",
        "version": 7,
        "debugenabled": false,
        "action": "light.turn_on",
        "floorId": [],
        "areaId": [],
        "deviceId": [],
        "entityId": [
            "light.living_room_couch_lamp3"
        ],
        "labelId": [],
        "data": "",
        "dataType": "jsonata",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "none",
        "blockInputOverrides": true,
        "domain": "light",
        "service": "turn_on",
        "x": 1275,
        "y": 135,
        "wires": [
            []
        ]
    },
    {
        "id": "755e1ff0e41c8594",
        "type": "api-current-state",
        "z": "7fb0c6f8a4ad507e",
        "name": "Couch light 2 on?",
        "server": "ab3e2c53.e3491",
        "version": 3,
        "outputs": 2,
        "halt_if": "on",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "entity_id": "light.living_room_couch_lamp2",
        "state_type": "str",
        "blockInputOverrides": true,
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "entityState"
            },
            {
                "property": "data",
                "propertyType": "msg",
                "value": "",
                "valueType": "entity"
            }
        ],
        "for": "0",
        "forType": "num",
        "forUnits": "minutes",
        "override_topic": false,
        "state_location": "payload",
        "override_payload": "msg",
        "entity_location": "data",
        "override_data": "msg",
        "x": 645,
        "y": 165,
        "wires": [
            [
                "c14a15b50c000710"
            ],
            []
        ]
    },
    {
        "id": "c14a15b50c000710",
        "type": "api-current-state",
        "z": "7fb0c6f8a4ad507e",
        "name": "Couch light 3 on?",
        "server": "ab3e2c53.e3491",
        "version": 3,
        "outputs": 2,
        "halt_if": "on",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "entity_id": "light.living_room_couch_lamp3",
        "state_type": "str",
        "blockInputOverrides": true,
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "entityState"
            },
            {
                "property": "data",
                "propertyType": "msg",
                "value": "",
                "valueType": "entity"
            }
        ],
        "for": "0",
        "forType": "num",
        "forUnits": "minutes",
        "override_topic": false,
        "state_location": "payload",
        "override_payload": "msg",
        "entity_location": "data",
        "override_data": "msg",
        "x": 855,
        "y": 165,
        "wires": [
            [
                "6538c03ece6bb30b"
            ],
            []
        ]
    },
    {
        "id": "6538c03ece6bb30b",
        "type": "api-current-state",
        "z": "7fb0c6f8a4ad507e",
        "name": "Couch light 1 on?",
        "server": "ab3e2c53.e3491",
        "version": 3,
        "outputs": 2,
        "halt_if": "on",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "entity_id": "light.living_room_couch_lamp1",
        "state_type": "str",
        "blockInputOverrides": true,
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "entityState"
            },
            {
                "property": "data",
                "propertyType": "msg",
                "value": "",
                "valueType": "entity"
            }
        ],
        "for": "0",
        "forType": "num",
        "forUnits": "minutes",
        "override_topic": false,
        "state_location": "payload",
        "override_payload": "msg",
        "entity_location": "data",
        "override_data": "msg",
        "x": 1065,
        "y": 165,
        "wires": [
            [],
            [
                "836951de1a9e9750"
            ]
        ]
    },
    {
        "id": "836951de1a9e9750",
        "type": "api-call-service",
        "z": "7fb0c6f8a4ad507e",
        "name": "ON: Couch light 1",
        "server": "ab3e2c53.e3491",
        "version": 7,
        "debugenabled": false,
        "action": "light.turn_on",
        "floorId": [],
        "areaId": [],
        "deviceId": [],
        "entityId": [
            "light.living_room_couch_lamp1"
        ],
        "labelId": [],
        "data": "",
        "dataType": "jsonata",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "none",
        "blockInputOverrides": true,
        "domain": "light",
        "service": "turn_on",
        "x": 1275,
        "y": 165,
        "wires": [
            []
        ]
    },
    {
        "id": "5c4360104a8f4f49",
        "type": "api-current-state",
        "z": "7fb0c6f8a4ad507e",
        "name": "Couch light 3 on?",
        "server": "ab3e2c53.e3491",
        "version": 3,
        "outputs": 2,
        "halt_if": "on",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "entity_id": "light.living_room_couch_lamp3",
        "state_type": "str",
        "blockInputOverrides": true,
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "entityState"
            },
            {
                "property": "data",
                "propertyType": "msg",
                "value": "",
                "valueType": "entity"
            }
        ],
        "for": "0",
        "forType": "num",
        "forUnits": "minutes",
        "override_topic": false,
        "state_location": "payload",
        "override_payload": "msg",
        "entity_location": "data",
        "override_data": "msg",
        "x": 645,
        "y": 195,
        "wires": [
            [
                "323a8f0975dadcbd"
            ],
            []
        ]
    },
    {
        "id": "c21e0083907a4bf2",
        "type": "api-current-state",
        "z": "7fb0c6f8a4ad507e",
        "name": "Couch light 2 on?",
        "server": "ab3e2c53.e3491",
        "version": 3,
        "outputs": 2,
        "halt_if": "on",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "entity_id": "light.living_room_couch_lamp2",
        "state_type": "str",
        "blockInputOverrides": true,
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "entityState"
            },
            {
                "property": "data",
                "propertyType": "msg",
                "value": "",
                "valueType": "entity"
            }
        ],
        "for": "0",
        "forType": "num",
        "forUnits": "minutes",
        "override_topic": false,
        "state_location": "payload",
        "override_payload": "msg",
        "entity_location": "data",
        "override_data": "msg",
        "x": 1065,
        "y": 195,
        "wires": [
            [],
            [
                "10fade48a20eddea"
            ]
        ]
    },
    {
        "id": "323a8f0975dadcbd",
        "type": "api-current-state",
        "z": "7fb0c6f8a4ad507e",
        "name": "Couch light 1 on?",
        "server": "ab3e2c53.e3491",
        "version": 3,
        "outputs": 2,
        "halt_if": "on",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "entity_id": "light.living_room_couch_lamp1",
        "state_type": "str",
        "blockInputOverrides": true,
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "entityState"
            },
            {
                "property": "data",
                "propertyType": "msg",
                "value": "",
                "valueType": "entity"
            }
        ],
        "for": "0",
        "forType": "num",
        "forUnits": "minutes",
        "override_topic": false,
        "state_location": "payload",
        "override_payload": "msg",
        "entity_location": "data",
        "override_data": "msg",
        "x": 855,
        "y": 195,
        "wires": [
            [
                "c21e0083907a4bf2"
            ],
            []
        ]
    },
    {
        "id": "10fade48a20eddea",
        "type": "api-call-service",
        "z": "7fb0c6f8a4ad507e",
        "name": "ON: Couch light 2",
        "server": "ab3e2c53.e3491",
        "version": 7,
        "debugenabled": false,
        "action": "light.turn_on",
        "floorId": [],
        "areaId": [],
        "deviceId": [],
        "entityId": [
            "light.living_room_couch_lamp2"
        ],
        "labelId": [],
        "data": "",
        "dataType": "jsonata",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "none",
        "blockInputOverrides": true,
        "domain": "light",
        "service": "turn_on",
        "x": 1275,
        "y": 195,
        "wires": [
            []
        ]
    },
    {
        "id": "7b4cf5d1210eedb2",
        "type": "api-current-state",
        "z": "7fb0c6f8a4ad507e",
        "name": "Couch light 1 off?",
        "server": "ab3e2c53.e3491",
        "version": 3,
        "outputs": 2,
        "halt_if": "off",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "entity_id": "light.living_room_couch_lamp1",
        "state_type": "str",
        "blockInputOverrides": true,
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "entityState"
            },
            {
                "property": "data",
                "propertyType": "msg",
                "value": "",
                "valueType": "entity"
            }
        ],
        "for": "0",
        "forType": "num",
        "forUnits": "minutes",
        "override_topic": false,
        "state_location": "payload",
        "override_payload": "msg",
        "entity_location": "data",
        "override_data": "msg",
        "x": 645,
        "y": 225,
        "wires": [
            [
                "a7f0880f05324738"
            ],
            []
        ]
    },
    {
        "id": "a7f0880f05324738",
        "type": "api-current-state",
        "z": "7fb0c6f8a4ad507e",
        "name": "Couch light 2 off?",
        "server": "ab3e2c53.e3491",
        "version": 3,
        "outputs": 2,
        "halt_if": "off",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "entity_id": "light.living_room_couch_lamp2",
        "state_type": "str",
        "blockInputOverrides": true,
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "entityState"
            },
            {
                "property": "data",
                "propertyType": "msg",
                "value": "",
                "valueType": "entity"
            }
        ],
        "for": "0",
        "forType": "num",
        "forUnits": "minutes",
        "override_topic": false,
        "state_location": "payload",
        "override_payload": "msg",
        "entity_location": "data",
        "override_data": "msg",
        "x": 855,
        "y": 225,
        "wires": [
            [
                "1971be2af0682ca7"
            ],
            []
        ]
    },
    {
        "id": "1971be2af0682ca7",
        "type": "api-current-state",
        "z": "7fb0c6f8a4ad507e",
        "name": "Couch light 3 off?",
        "server": "ab3e2c53.e3491",
        "version": 3,
        "outputs": 2,
        "halt_if": "off",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "entity_id": "light.living_room_couch_lamp3",
        "state_type": "str",
        "blockInputOverrides": true,
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "entityState"
            },
            {
                "property": "data",
                "propertyType": "msg",
                "value": "",
                "valueType": "entity"
            }
        ],
        "for": "0",
        "forType": "num",
        "forUnits": "minutes",
        "override_topic": false,
        "state_location": "payload",
        "override_payload": "msg",
        "entity_location": "data",
        "override_data": "msg",
        "x": 1065,
        "y": 225,
        "wires": [
            [],
            [
                "fd7eaf9abf479e0c"
            ]
        ]
    },
    {
        "id": "fd7eaf9abf479e0c",
        "type": "api-call-service",
        "z": "7fb0c6f8a4ad507e",
        "name": "OFF: Couch light 3",
        "server": "ab3e2c53.e3491",
        "version": 7,
        "debugenabled": false,
        "action": "light.turn_off",
        "floorId": [],
        "areaId": [],
        "deviceId": [],
        "entityId": [
            "light.living_room_couch_lamp3"
        ],
        "labelId": [],
        "data": "",
        "dataType": "jsonata",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "none",
        "blockInputOverrides": true,
        "domain": "light",
        "service": "turn_off",
        "x": 1275,
        "y": 225,
        "wires": [
            []
        ]
    },
    {
        "id": "639ff6a4c30f7da4",
        "type": "api-current-state",
        "z": "7fb0c6f8a4ad507e",
        "name": "Couch light 1 off?",
        "server": "ab3e2c53.e3491",
        "version": 3,
        "outputs": 2,
        "halt_if": "off",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "entity_id": "light.living_room_couch_lamp1",
        "state_type": "str",
        "blockInputOverrides": true,
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "entityState"
            },
            {
                "property": "data",
                "propertyType": "msg",
                "value": "",
                "valueType": "entity"
            }
        ],
        "for": "0",
        "forType": "num",
        "forUnits": "minutes",
        "override_topic": false,
        "state_location": "payload",
        "override_payload": "msg",
        "entity_location": "data",
        "override_data": "msg",
        "x": 1065,
        "y": 255,
        "wires": [
            [],
            [
                "e6db7a222f12cdc5"
            ]
        ]
    },
    {
        "id": "ea833815ed243b2c",
        "type": "api-current-state",
        "z": "7fb0c6f8a4ad507e",
        "name": "Couch light 2 off?",
        "server": "ab3e2c53.e3491",
        "version": 3,
        "outputs": 2,
        "halt_if": "off",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "entity_id": "light.living_room_couch_lamp2",
        "state_type": "str",
        "blockInputOverrides": true,
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "entityState"
            },
            {
                "property": "data",
                "propertyType": "msg",
                "value": "",
                "valueType": "entity"
            }
        ],
        "for": "0",
        "forType": "num",
        "forUnits": "minutes",
        "override_topic": false,
        "state_location": "payload",
        "override_payload": "msg",
        "entity_location": "data",
        "override_data": "msg",
        "x": 645,
        "y": 255,
        "wires": [
            [
                "38dd7c7b52f87b79"
            ],
            []
        ]
    },
    {
        "id": "38dd7c7b52f87b79",
        "type": "api-current-state",
        "z": "7fb0c6f8a4ad507e",
        "name": "Couch light 3 off?",
        "server": "ab3e2c53.e3491",
        "version": 3,
        "outputs": 2,
        "halt_if": "off",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "entity_id": "light.living_room_couch_lamp3",
        "state_type": "str",
        "blockInputOverrides": true,
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "entityState"
            },
            {
                "property": "data",
                "propertyType": "msg",
                "value": "",
                "valueType": "entity"
            }
        ],
        "for": "0",
        "forType": "num",
        "forUnits": "minutes",
        "override_topic": false,
        "state_location": "payload",
        "override_payload": "msg",
        "entity_location": "data",
        "override_data": "msg",
        "x": 855,
        "y": 255,
        "wires": [
            [
                "639ff6a4c30f7da4"
            ],
            []
        ]
    },
    {
        "id": "e6db7a222f12cdc5",
        "type": "api-call-service",
        "z": "7fb0c6f8a4ad507e",
        "name": "OFF: Couch light 1",
        "server": "ab3e2c53.e3491",
        "version": 7,
        "debugenabled": false,
        "action": "light.turn_off",
        "floorId": [],
        "areaId": [],
        "deviceId": [],
        "entityId": [
            "light.living_room_couch_lamp1"
        ],
        "labelId": [],
        "data": "",
        "dataType": "jsonata",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "none",
        "blockInputOverrides": true,
        "domain": "light",
        "service": "turn_off",
        "x": 1275,
        "y": 255,
        "wires": [
            []
        ]
    },
    {
        "id": "6bbfe8d5e2a8cb38",
        "type": "api-current-state",
        "z": "7fb0c6f8a4ad507e",
        "name": "Couch light 1 off?",
        "server": "ab3e2c53.e3491",
        "version": 3,
        "outputs": 2,
        "halt_if": "off",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "entity_id": "light.living_room_couch_lamp1",
        "state_type": "str",
        "blockInputOverrides": true,
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "entityState"
            },
            {
                "property": "data",
                "propertyType": "msg",
                "value": "",
                "valueType": "entity"
            }
        ],
        "for": "0",
        "forType": "num",
        "forUnits": "minutes",
        "override_topic": false,
        "state_location": "payload",
        "override_payload": "msg",
        "entity_location": "data",
        "override_data": "msg",
        "x": 855,
        "y": 285,
        "wires": [
            [
                "93424166989f36db"
            ],
            []
        ]
    },
    {
        "id": "278e5b9dfc8b1efa",
        "type": "api-current-state",
        "z": "7fb0c6f8a4ad507e",
        "name": "Couch light 3 off?",
        "server": "ab3e2c53.e3491",
        "version": 3,
        "outputs": 2,
        "halt_if": "off",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "entity_id": "light.living_room_couch_lamp3",
        "state_type": "str",
        "blockInputOverrides": true,
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "entityState"
            },
            {
                "property": "data",
                "propertyType": "msg",
                "value": "",
                "valueType": "entity"
            }
        ],
        "for": "0",
        "forType": "num",
        "forUnits": "minutes",
        "override_topic": false,
        "state_location": "payload",
        "override_payload": "msg",
        "entity_location": "data",
        "override_data": "msg",
        "x": 645,
        "y": 285,
        "wires": [
            [
                "6bbfe8d5e2a8cb38"
            ],
            []
        ]
    },
    {
        "id": "93424166989f36db",
        "type": "api-current-state",
        "z": "7fb0c6f8a4ad507e",
        "name": "Couch light 2 off?",
        "server": "ab3e2c53.e3491",
        "version": 3,
        "outputs": 2,
        "halt_if": "off",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "entity_id": "light.living_room_couch_lamp2",
        "state_type": "str",
        "blockInputOverrides": true,
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "entityState"
            },
            {
                "property": "data",
                "propertyType": "msg",
                "value": "",
                "valueType": "entity"
            }
        ],
        "for": "0",
        "forType": "num",
        "forUnits": "minutes",
        "override_topic": false,
        "state_location": "payload",
        "override_payload": "msg",
        "entity_location": "data",
        "override_data": "msg",
        "x": 1065,
        "y": 285,
        "wires": [
            [],
            [
                "cc2d7ff84e908f2b"
            ]
        ]
    },
    {
        "id": "cc2d7ff84e908f2b",
        "type": "api-call-service",
        "z": "7fb0c6f8a4ad507e",
        "name": "OFF: Couch light 2",
        "server": "ab3e2c53.e3491",
        "version": 7,
        "debugenabled": false,
        "action": "light.turn_off",
        "floorId": [],
        "areaId": [],
        "deviceId": [],
        "entityId": [
            "light.living_room_couch_lamp2"
        ],
        "labelId": [],
        "data": "",
        "dataType": "jsonata",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "none",
        "blockInputOverrides": true,
        "domain": "light",
        "service": "turn_off",
        "x": 1275,
        "y": 285,
        "wires": [
            []
        ]
    },
    {
        "id": "4625e9cc31496995",
        "type": "server-state-changed",
        "z": "7fb0c6f8a4ad507e",
        "name": "",
        "server": "ab3e2c53.e3491",
        "version": 6,
        "outputs": 1,
        "exposeAsEntityConfig": "",
        "entities": {
            "entity": [
                "light.living_room_lamp2"
            ],
            "substring": [],
            "regex": []
        },
        "outputInitially": false,
        "stateType": "str",
        "ifState": "",
        "ifStateType": "str",
        "ifStateOperator": "is",
        "outputOnlyOnStateChange": 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": 195,
        "y": 195,
        "wires": [
            [
                "9af23e0648886f8b"
            ]
        ]
    },
    {
        "id": "9af23e0648886f8b",
        "type": "trigger",
        "z": "7fb0c6f8a4ad507e",
        "name": "",
        "op1": "",
        "op2": "0",
        "op1type": "nul",
        "op2type": "str",
        "duration": "15",
        "extend": false,
        "overrideDelay": false,
        "units": "s",
        "reset": "",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 1,
        "x": 430,
        "y": 195,
        "wires": [
            [
                "278e5b9dfc8b1efa",
                "ea833815ed243b2c",
                "7b4cf5d1210eedb2",
                "5c4360104a8f4f49",
                "755e1ff0e41c8594",
                "cf7c317535a9c090"
            ]
        ]
    },
    {
        "id": "ab3e2c53.e3491",
        "type": "server",
        "name": "AvilaSmartHome",
        "version": 5,
        "addon": true,
        "rejectUnauthorizedCerts": true,
        "ha_boolean": "y|yes|true|on|home|open",
        "connectionDelay": true,
        "cacheJson": true,
        "heartbeat": false,
        "heartbeatInterval": 30,
        "areaSelector": "friendlyName",
        "deviceSelector": "friendlyName",
        "entitySelector": "friendlyName",
        "statusSeparator": "at: ",
        "statusYear": "hidden",
        "statusMonth": "short",
        "statusDay": "numeric",
        "statusHourCycle": "h23",
        "statusTimeFormat": "h:m",
        "enableGlobalContextStore": true
    }
]

Why not just create a group so you have one entity to check and one entity to turn on/off?

Or, get all entities that match “light.couch_light_*” and then do some logic on that result.

The sum of all lights on is 3. The sum of all lights off is 0. If the action is turn-on and the value is less than 3, turn all on. If the action is turn-off and the value is greater than 0, turn all off.

If I understand correctly, when this is triggered, if 2 lights are on the third goes on. If 2 are off the third is off?

Make a group of the lights and try it with this flow.

[{"id":"3872e51b6f676518","type":"inject","z":"d4b982ad2e73341f","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":620,"y":120,"wires":[["f3b564c6c10e3ffa"]]},{"id":"f3b564c6c10e3ffa","type":"ha-get-entities","z":"d4b982ad2e73341f","name":"","server":"","version":1,"rules":[{"condition":"state_object","property":"entity_id","logic":"in_group","value":"light.front_group","valueType":"str"}],"outputType":"array","outputEmptyResults":false,"outputLocationType":"msg","outputLocation":"payload","outputResultsCount":1,"x":770,"y":120,"wires":[["63be713ba603b3e1"]]},{"id":"63be713ba603b3e1","type":"function","z":"d4b982ad2e73341f","name":"on/off","func":"let group = msg.payload; //group info\nlet states = []; // array to hold states\n\n// look for lights that are on\nfor (let i = 0; i < group.length; i++) {\n    const element = group[i].state;    \n    if (element == \"on\" ) {\n        states.push(group[i].state);\n    }\n\n};\n\nmsg = {}; //clear existing message\n\n// if 2 lights are on send on otherwise send off\nif (states.length >= 2){\n    msg.payload = \"on\"\n} else {\n    msg.payload = \"off\"\n};\n\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":930,"y":120,"wires":[["c8554cca1198bc46","65d3c07bb89880e6"]]},{"id":"c8554cca1198bc46","type":"api-call-service","z":"d4b982ad2e73341f","name":"","server":"","version":7,"debugenabled":false,"action":"light.turn_{{payload}}","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.front_group"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":true,"domain":"light","service":"turn_{{payload}}","x":1120,"y":120,"wires":[[]]}]

image

If a group is partially on, sending on to the group entity will then turn them all on.