[ZBM5-1C-80/86 / SONOFF] Binding to a group makes the switch add itself to the group; group commands then toggle its relay in detached mode

Open
#33,841 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
47/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript
Domain
backend

Research direction

Start by reading the device bind request handling and its group binding flow; the issue does not name specific files or tests. Check whether Zigbee2MQTT can prevent or clean up the source endpoint becoming a group member after binding, and verify the behavior with the reported SONOFF ZBM5 detached relay setup. Done means group commands control the bulbs while the switch relay stays on.

Written by the indexing model from the issue text.

Description

problem
What happened?

On a SONOFF ZBM5 one-channel wall switch (firmware 1.0.6, router mode) with detach_relay_outlet1: ENABLE, binding endpoint 1 (genOnOff) to a Zigbee2MQTT group makes the switch add its own endpoint 1 to that group on the device. After that, every command sent to the group, from Z2M/Home Assistant or from the switch's own button through the binding, also switches the switch's relay.

Z2M does not list the switch as a group member, so group/members/remove on its own has no effect.

Seen on two separate units, bound to two different groups: 3 × Philips Hue bulbs and 6 × Tuya TS0505B bulbs.

In detached mode the relay normally stays on permanently to power smart bulbs. A group OFF therefore cuts power to the bulbs, which makes group binding unusable. Binding to each bulb individually works, but the bulbs then switch visibly out of step.

What did you expect to happen?

Only the group members (the bulbs) respond to the group command. The switch is only the bind source and is in detached mode, so its relay should stay ON.

How to reproduce it (minimal and precise)

ZBM5-1C-80/86 on 1.0.6 (router). Set detach_relay_mode.detach_relay_outlet1 = ENABLE, relay state: ON, power_on_behavior: on.

Make sure the switch is not a member of the group and has no other bindings.
Bind endpoint 1 → group: zigbee2mqtt/bridge/request/device/bind with {"from": "", "from_endpoint": 1, "to": "", "clusters": ["genOnOff"]}. Response: status: ok.

Turn the group ON, then OFF, from the frontend or MQTT

The switch reports state: OFF: its relay switched off with the group.

Workaround to undo it: unbind from the group, then group/members/add followed by group/members/remove for the switch's endpoint 1. After that, group commands no longer affect the relay.

Zigbee2MQTT version

2.14.3

Adapter firmware version

Z-Stack 3.x.0, build 20250321

Adapter

SONOFF Universal Zigbee 3.0 USB Dongle Plus

Setup

Home Assistant OS, Zigbee2MQTT app (add-on).

Device database.db entry

No response

Debug log

zigbee2mqtt/bridge/response/device/bind
{"data":{"clusters":["genOnOff"],"failed":[],"from":"Bathroom Light Switch","from_endpoint":1,"to":"Bathroom Light"},"status":"ok"}

z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Bathroom Light', payload '{"brightness":152,...,"state":"ON"}'
z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Bathroom Light', payload '{"brightness":152,...,"state":"OFF"}'

z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Bathroom Light Switch', payload '{"detach_relay_mode":{"detach_relay_outlet1":"ENABLE","detach_relay_outlet2":"DISABLE","detach_relay_outlet3":"DISABLE"},"device_work_mode":"Zigbee router","last_seen":"2026-11-27T13:07:45+00:00","linkquality":36,"network_indicator":true,"power_on_behavior":"on","state":"OFF","update":{"installed_version":4102,"latest_source":"https://raw.githubusercontent.com/Koenkk/zigbee-OTA/master/images/Sonoff/zbm5-120-zr_v1.0.6.ota","latest_version":4102,"state":"idle"}}'

(The switch reported relay OFF straight after the group OFF, still in detached mode and not a group member in Z2M.)

Notes

Probably a firmware bug, since the device adds itself to the group it's bound to. Reporting here so it's documented and in case Z2M can work around it, e.g. by sending a Groups remove to the source endpoint after a group bind.

Checked and not the same: #32679 (1.0.4 end-device firmware can't bind), #32664 (no-neutral units don't receive group broadcasts), #33185 (1.0.6 OTA server issue), #30088 (ZBMINI R2 detach regression).

Dominant language
TypeScript
Stars
15.9k
Forks
2.1k
Avg merge
12h 11m
Merged PRs (30d)
32

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Koenkk/zigbee2mqtt

All issues in Koenkk/zigbee2mqtt

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.