Z2M - 2 switches, 1 lamp - direct bind

Good day,

im looking into implementing a 2 way switch set up without the need of home assistant (direct bind). Both switches should independently turn on or off the light.

The Problem is that, each switch sends presumably a on or off command to the group. Now if the group has already the state on from the first switch, the received on command from the second switch is not turned into off. Which results into having rocking the switch again.
Is there something i have overlooked?

My set up: 2 Philips hue wall modules, 1 Sonoff zbminir2 relais.

no, i cannot add both switches to the light group „Korridorlicht_group“, i already tried but received an error. according to the documentation in Philips 929003017102 control via MQTT | Zigbee2MQTT this is expected



1 Like

Hi everyone,

I’m facing the same issue as described here with two Hue Wall Switches and one lamp. The binding works, but the switches don’t toggle the lamp correctly unless I toggle them twice.

Has anyone found a solution for this?

Thanks!

1 Like

Hello,

I figured out a partial solution to this with HA stepping in to toggle the switch in case the direct approach has not worked in 100ms delay. its not perfect, but at least if HA is not available (during restart for example) wife can still use the switches…
Hope it helps you in the meanwhile until someone can address that.

Basically, on click it saves the current light state, then compares after 100ms if the toggle happened. if not HA will toggle it.

alias: MQTT Helper2
description: >-
  For this purpose, every actuator must have a binding with a
  lamp. If the actuator does not trigger directly when a switch is pressed, HA
  assists by toggling the lamp. This eliminates the need for pressing the switch
  again for direct binding.
triggers:
  - domain: mqtt
    device_id: 30081cf42eb5fb5669e5808ff0952b7f
    type: action
    subtype: left_press
    trigger: device
    id: OG_AK1
    alias: Korridorlicht OG Aktor 1
  - domain: mqtt
    device_id: faf7dde35053b6f95d5daae8c7e59964
    type: action
    subtype: left_press
    trigger: device
    id: OG_AK2
    alias: Korridorlicht OG Aktor 2
conditions: []
actions:
  - variables:
      korridorlicht_zustand: "{{ states('light.korridorlicht') }}"
  - delay:
      milliseconds: 100
    enabled: true
  - choose:
      - conditions:
          - condition: and
            conditions:
              - condition: template
                value_template: "{{ states('light.korridorlicht') == korridorlicht_zustand }}"
              - condition: trigger
                id:
                  - OG_AK2
                  - OG_AK1
        sequence:
          - target:
              entity_id: light.korridorlicht
            action: light.toggle
            data: {}
        alias: Korridorlicht
mode: single