VZM31-SN, ZHA, Binding, Sync, Dashboard -- Help

Sorry for the weird “subject” but it mostly explains why I’m asking for help.

I’m running:
- Home Assistant OS 2024.5.5 on a RPI4
- Sonoff Dongle-E (EZSP)
- VZM31-SN in Smart Bulb Mode, Dimmer, Firmware 2.18 bound to…
- ZHA Light Group (2 x hue bulbs)

For simplicity, the ZHA Light Group entity is, “light.zigbee_group” and I have a dashboard light card that references “light.zigbee_group”.

Everything works properly via the switch, even if HA is shut down.
Everything works properly via the dashboard card (with HA running, of course).

My problem is that the dashboard and the switch don’t update each other, despite referencing the same entity. If I turn on the lights via the switch, the dashboard will say the lights are still off (for several minutes). If I then turn off the lights via the dashboard, the switch LED will remain bright blue. Dimming with one will not be reflected by the other (but the lights operate, mostly, as expected).

I have two other switches that I setup several months ago, with almost identical setups, and they both work flawlessly.

I’m not the brightest light in the room when it comes to this stuff, but I’m hoping the community can suggest something to look for.

Thank you.

PS. Big kitchen renovation happening here. Eight more switches will need setting up (I’m staring at four of them in their boxes and hoping I can wait for four mmwave versions near the beginning of August – our deadline).

MrGrey.

In my experience, this requires adding the switch (endpoint 1) to the group as well. Otherwise the switch has no idea that the group has changed and it should update its status.

I’ve been trying to read/understand things about endpoints and groups. It’s my understanding that the switch should NOT be part of the group. Also, endpoint 1 isn’t available via the ZHA UI which, I believe, is also correct because endpoint 2 (and a new 3, depending on firmware) is more proper (like, more better), like I don’t know the English language anymore. :slight_smile:

I’m willing to try adding endpoint 1 of the switch to the light group. Can you tell me how to make endpoint 1 appear in the ZHA UI?

Thank you for your time.

MrGrey.

Endpoint 1 is how the switch receives commands, endpoint 2 is how the switch transmits commands (to bound devices). Endpoint 3 is new and used to bind the config button to devices.

Unfortunately, I do not use ZHA, so I’m not sure how to add endpoint 1 to the group, but I can confirm that I have all of my groups set up this way in Zigbee2mqtt and they maintain sync properly.

I believe @chack is one of our ZHA experts and may be able to help here.

1 Like

I’m confused why two switches work and one doesn’t. I’m really hoping that the two are correct and the one is just an outcast or configuration error on my part.

Thank you for helping. Not being on ZHA must make it almost impossible.

MrGrey.

Instead of using the group light entity on the dashboard, what happens if you use the switch light entity instead on the dashboard? That should keep them in sync, and as long as they’re bound to the bulbs, I believe it’ll work as expected.

I wrote the below off the comment instead of doing the smart thing and reading the whole thread first (leaving it in case you want to go down that path though :slight_smile:)


I believe the official instructions don’t include using endpoint 1 in the same group, but you could try it following the same steps to get to your group and then you should see all endpoints available to add to the group, (just confirmed all 3 are available to add to a group for me) -

image

Now if you’re looking at the binding of the switch to the group from the device page that will only show endpoint 2 (and/or 3) as that’s the endpoint you’ll bind to the group.

The switch light entity does work and keeps everything in sync. The only problem is that color/temp controls aren’t available via the switch (which makes sense). The dashboard is the logical place to have color/temp controls available and that’s why I chose the group entity with my first two switches.

The official instructions are pretty old and I understand that its impossible to keep up with all of the changes. I started using Home Assistant about a month after the “Configuration” menu became the “Settings” menu – every setup video/tutorial I watched was “wrong”. :rofl:

I’ll keep trying different things. I have two switches that work with the group entity – there must be a way.

Thank you for your help.

MrGrey.

I don’t get enough time in the day… sound familiar to some? :slight_smile: With many thanks to rohan and chack (don’t want to @ them, their busy enough). I found the solution with their help (even better than my original switches).

My solution has two parts:

Part One:

Just as suggested above; add endpoint #1 of the switch to the light group being attached to the switch. I’m sure instructions, I’ve read somewhere, say to specifically NOT do that, but that was “dog” years ago. :slight_smile: This solved “sync” from switch to Dashboard/Light_Group.

Part Two:

I wrote a pretty simple automation:

alias: Bedroom1 Ceiling Lights
description: ""
trigger:
  - platform: state
    entity_id:
      - light.bedroom1_light_switch_light
    from: "on"
    to: "off"
    id: turn_off
  - platform: state
    entity_id:
      - light.bedroom1_light_switch_light
    from: "off"
    to: "on"
    id: turn_on
  - platform: state
    entity_id:
      - light.bedroom1_light_switch_light
    attribute: brightness
    id: set_brightness
    enabled: false
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - turn_off
        sequence:
          - service: light.turn_off
            target:
              entity_id:
                - light.bedroom1_ceiling_lights_group
            data: {}
          - delay:
              milliseconds: 200
          - service: input_boolean.turn_off
            metadata: {}
            data: {}
            target:
              entity_id: input_boolean.dashboard_bedroom1_lights_dropdown
      - conditions:
          - condition: trigger
            id:
              - turn_on
        sequence:
          - service: light.turn_on
            target:
              entity_id:
                - light.bedroom1_ceiling_lights_group
            data: {}
          - delay:
              milliseconds: 200
      - conditions:
          - condition: trigger
            id: set_brightness
        sequence:
          - variables:
              set_light_brightness: "{{ trigger.to_state.attributes.brightness }}"
          - service: light.turn_on
            data:
              entity_id:
                - light.bedroom1_ceiling_lights_group
              brightness: "{{ set_light_brightness }}"
          - delay:
              milliseconds: 200
mode: single
max_exceeded: silent

It seems big, but it just does a “sync” in the other direction.

I’m not the sharpest tool in the drawer. I modified this automation from a blueprint that’s freely available. I don’t mind saying that I screwed up many times trying to make the “brightness” work and, only now looking at the code, did I realize that “brightness” was still there. ( :rofl: enabled is false :rofl: )

Well… Hows that for a silly contribution?..

I hope this helps others trying to synchronize the LED bar of the Inovelli (<- Why is that spelt wrong?) switch to light cards in a dashboard in Home Assistant.

MrGrey.

I’ll probably be back here in two months when none of the Kitchen lights work (knocking on wood). :rofl: