Nodered e Zigbee2mqtt

Bom dia pessoal,
Estou com fluxo para fazer um paralelo virtual entre três interruptores, mas percebi que, se algumas dos interruptores forem pressionados algumas vezes seguidas, acaba entrando em um loop de liga e desliga, só voltando ao normal depois de muito tempo, ou se o zigbee2mqtt for reiniciado, vou mandar meu fluxo ai, para caso alguèm consiga me auxiliar numa solução.

[
    {
        "id": "cc61a24f4d167b79",
        "type": "zigbee2mqtt-in",
        "z": "8f101509f3e50272",
        "g": "772ff2dbe3cf93c1",
        "name": "Sala de Estar",
        "server": "a083951191e3670c",
        "friendly_name": "interruptores_sala (TS0004)",
        "device_id": "0x90395efffe404fcc",
        "state": "state_l1",
        "outputAtStartup": true,
        "filterChanges": true,
        "enableMultiple": false,
        "x": 130,
        "y": 120,
        "wires": [
            [
                "b63059e7efdfb06c"
            ]
        ]
    },
    {
        "id": "b63059e7efdfb06c",
        "type": "change",
        "z": "8f101509f3e50272",
        "g": "772ff2dbe3cf93c1",
        "name": "Definir state_l2",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "{\"state_l2\": payload}",
                "tot": "jsonata"
            }
        ],
        "x": 440,
        "y": 120,
        "wires": [
            [
                "85a2c4d9fa23f9d0",
                "1724a60312d08048"
            ]
        ]
    },
    {
        "id": "85a2c4d9fa23f9d0",
        "type": "zigbee2mqtt-out",
        "z": "8f101509f3e50272",
        "g": "772ff2dbe3cf93c1",
        "name": "Auxiliar Quarto 1",
        "server": "a083951191e3670c",
        "friendly_name": "interruptores_quarto_social (ZM-L03E-Z)",
        "device_id": "0x881a14fffefe9ed4",
        "command": "state",
        "commandType": "z2m_cmd",
        "payload": "payload",
        "payloadType": "msg",
        "optionsValue": "",
        "optionsType": "nothing",
        "x": 710,
        "y": 80,
        "wires": []
    },
    {
        "id": "9345c75bbd4f6262",
        "type": "zigbee2mqtt-in",
        "z": "8f101509f3e50272",
        "g": "772ff2dbe3cf93c1",
        "name": "Auxiliar Quarto 1",
        "server": "a083951191e3670c",
        "friendly_name": "interruptores_quarto_social (ZM-L03E-Z)",
        "device_id": "0x881a14fffefe9ed4",
        "state": "state_l2",
        "outputAtStartup": true,
        "filterChanges": true,
        "enableMultiple": false,
        "x": 140,
        "y": 200,
        "wires": [
            [
                "e9e46a7337eea8a1"
            ]
        ]
    },
    {
        "id": "bddf59cd62383b4b",
        "type": "zigbee2mqtt-out",
        "z": "8f101509f3e50272",
        "g": "772ff2dbe3cf93c1",
        "name": "Sala de Estar",
        "server": "a083951191e3670c",
        "friendly_name": "interruptores_sala (TS0004)",
        "device_id": "0x90395efffe404fcc",
        "command": "state",
        "commandType": "z2m_cmd",
        "payload": "payload",
        "payloadType": "msg",
        "optionsValue": "",
        "optionsType": "nothing",
        "x": 580,
        "y": 220,
        "wires": []
    },
    {
        "id": "1724a60312d08048",
        "type": "zigbee2mqtt-out",
        "z": "8f101509f3e50272",
        "g": "772ff2dbe3cf93c1",
        "name": "Auxiliar Hall 1",
        "server": "a083951191e3670c",
        "friendly_name": "interruptores_hall (ZM-L03E-Z)",
        "device_id": "0x881a14fffefea35f",
        "command": "state",
        "commandType": "z2m_cmd",
        "payload": "payload",
        "payloadType": "msg",
        "optionsValue": "",
        "optionsType": "nothing",
        "x": 700,
        "y": 140,
        "wires": []
    },
    {
        "id": "7ce8cddea439e81e",
        "type": "zigbee2mqtt-in",
        "z": "8f101509f3e50272",
        "g": "772ff2dbe3cf93c1",
        "name": "Auxiliar Hall 1",
        "server": "a083951191e3670c",
        "friendly_name": "interruptores_hall (ZM-L03E-Z)",
        "device_id": "0x881a14fffefea35f",
        "state": "state_l2",
        "outputAtStartup": true,
        "filterChanges": true,
        "enableMultiple": false,
        "x": 130,
        "y": 260,
        "wires": [
            [
                "e9e46a7337eea8a1"
            ]
        ]
    },
    {
        "id": "e9e46a7337eea8a1",
        "type": "change",
        "z": "8f101509f3e50272",
        "g": "772ff2dbe3cf93c1",
        "name": "Definir state_l1",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "{\"state_l1\": payload}",
                "tot": "jsonata"
            }
        ],
        "x": 360,
        "y": 220,
        "wires": [
            [
                "bddf59cd62383b4b"
            ]
        ]
    },
    {
        "id": "a083951191e3670c",
        "type": "zigbee2mqtt-server",
        "name": "Server MQTT",
        "host": "192.168.1.105",
        "mqtt_port": "1883",
        "mqtt_username": "user",
        "mqtt_password": "password",
        "mqtt_qos": "1",
        "tls": "",
        "usetls": false,
        "base_topic": "zigbee2mqtt"
    }
]

Prefiro o paralelo direto na automação do HA. Meus dispositivos são switches ligados em interruptores comuns, portanto, não faz muita diferença se os dispositivos (só virtuais) não precisam estar em sincronia com os que alimentam realmente a lâmpada, já que não possuem led.

Por isso, não complico a lógica.

alias: Sala Three Way Sala Controle
description: ""
mode: single
triggers:
  - entity_id:
      - switch.SUA_ENTIDADE_VIRTUAL
    to: "on"
    from: "off"
    trigger: state
  - entity_id:
      - switch.SUA_ENTIDADE_VIRTUAL
    to: "off"
    from: "on"
    trigger: state
conditions: []
actions:
  - data: {}
    target:
      entity_id: light.SUA_ENTIDADE_REAL
    action: light.toggle
1 Like

Obrigado, vou criar diretamente no Home Assistant para ver se resolvo esse loop.