Koenkk / Koenkk/zigbee2mqtt

SONOFF MINI-ZB2GS-L (1.0.4 / build 4100): relay powers up OFF after mains loss, `startUpOnOff` accepted but not applied

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

Nobody has claimed this yet.

problem
Dominant language
TypeScript
Stars
15.7k
Forks
2k
Avg merge
18h 55m
Merged PRs (30d)
35

Description

What happened?

Both relays on a SONOFF MINI-ZB2GS-L come up OFF after every mains interruption, regardless of power_on_behavior. The write to startUpOnOff succeeds and the device stores the value; it is not applied at startup.

Detach relay mode is enabled on both channels and the load is a set of Hue bulbs, so the relays are meant to stay closed permanently.

Device: SONOFF MINI-ZB2GS-L, firmware 1.0.4, build 4100, date code 20250821. detach_relay_mode ENABLE on both channels, external_trigger_mode edge, latching wall switches.

The relays boot open. In all four cycles below, the first state reported after boot is off; there is no intermediate on.

The relay is physically open, not misreporting. After cycle 2, commanding a downstream Hue bulb produced no response and its state was never updated; the bulbs have no mains power.

The write is accepted. Changing power_on_behavior (on to previous) completes with no error on zigbee2mqtt/bridge/logging. delayed_power_on_state and delayed_power_on_time in the eWeLink cluster are also accepted and reported back by the device, and likewise have no effect on power-up state.

detach_relay_mode is unchanged across cycles, reading ENABLE/ENABLE before and after each.

What did you expect to happen?

With power_on_behavior: on the relay closes at power-up. With previous it restores its pre-outage state, which was on in every cycle below.

How to reproduce it (minimal and precise)

Four mains cycles at the breaker, ~60 s off. Both relays confirmed on immediately before each.

# power_on_behavior delayed_power_on_state Result
1 l1 on, l2 on disabled both off
2 l1 on, l2 on enabled, 1 s, both channels both off
3 l1 previous, l2 on disabled both off
4 l1 on, l2 on disabled both off

All cycles 2026-09-08; l1 reported off first in each, l2 six to seven seconds later. Cycle 3 sets a different value per channel in one power cycle. Cycle 4 was run on Z2M 2.14.1-1, cycles 1-3 on 2.12.1-1.

Zigbee2MQTT version

2.14.1-1

Adapter firmware version

20240710

Adapter

SMLIGHT SLZB-06 (core firmware v3.3.1)

Setup

Zigbee2MQTT Home Assistant add-on 2.14.1-1, running under Home Assistant 2026.6.3 in a VM on an x86-64 NAS with an Ubuntu Server host.

Coordinator is a SMLIGHT SLZB-06 attached over Ethernet (connection mode eth), so Z2M reaches it over TCP rather than USB.

Device database.db entry

{"ieee_address":"0x403802fffe0f329f","type":"EndDevice","network_address":36631,"power_source":"Mains (single phase)","manufacturer":"SONOFF","model_id":"MINI-ZB2GS-L","software_build_id":"1.0.4","date_code":"20250821","supported":true,"disabled":false,"interview_completed":true,"endpoints":{"1":{"bindings":[{"cluster":"genPollCtrl","target":{"endpoint":1,"ieee_address":"0x00124b002e1e03c1","type":"endpoint"}},{"cluster":"genOnOff","target":{"endpoint":1,"ieee_address":"0x00124b002e1e03c1","type":"endpoint"}},{"cluster":"customClusterEwelink","target":{"endpoint":1,"ieee_address":"0x00124b002e1e03c1","type":"endpoint"}}],"configured_reportings":[{"cluster":"customClusterEwelink","attribute":"externalTriggerMode"},{"cluster":"genOnOff","attribute":"onOff"}],"clusters":{"input":["genBasic","genIdentify","genGroups","genOnOff","genPollCtrl","haDiagnostic","manuSpecificAmazonWWAH","customClusterEwelink"],"output":["genIdentify","genOnOff","genOta"]}},"2":{"bindings":[{"cluster":"genOnOff","target":{"endpoint":1,"ieee_address":"0x00124b002e1e03c1","type":"endpoint"}},{"cluster":"customClusterEwelink","target":{"endpoint":1,"ieee_address":"0x00124b002e1e03c1","type":"endpoint"}}],"configured_reportings":[{"cluster":"customClusterEwelink","attribute":"externalTriggerMode"},{"cluster":"genOnOff","attribute":"onOff"}],"clusters":{"input":["genBasic","genIdentify","genGroups","genOnOff","customClusterEwelink"],"output":["genIdentify","genOnOff"]}}},"definition_model":"MINI-ZB2GS-L"}

Debug log

No response

Notes

Koenkk/zigbee-OTA contains one ZB2GS image, images/Sonoff/mini-zb2gs_v1.0.7.ota (fileVersion 4103, manufacturerCode 4742, imageType 68), which is the neutral MINI-ZB2GS. This device is at 4100 and is offered no update, so there is currently no OTA path for the -L variant.

The device entry above is from zigbee2mqtt/bridge/devices rather than database.db.

Contributor guide

Open the contributing guide

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.

Research direction

Start by tracing the MINI-ZB2GS-L device definition and the handling of power_on_behavior, then compare it with the reported bridge/devices entry and customClusterEwelink attributes. Done means power_on_behavior on and previous produce the expected relay state after mains cycles, including with detach_relay_mode enabled; verify the behavior against the four reproduction cases.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.