SNZB-06P (fw 1.0.6) resets occupancy_timeout/sensitivity to 60 s/medium every 2–8 min on Z-Stack, holds on Ember (likely unanswered Keep-Alive 0x0025)

Open
#33,929 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
1-2 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript
Domain
backend

Research direction

Start by tracing how Zigbee2MQTT handles coordinator endpoint clusters and reads for the Keep-Alive cluster (0x0025), then compare the Z-Stack and Ember coordinator behavior. The report provides reproducible SNZB-06P steps and debug logs; use them to confirm whether the device's reads reach the coordinator and what response it needs. Done means its occupancy settings remain set on Z-Stack, with a regression test covering the behavior.

Written by the indexing model from the issue text.

Description

What happened?

SONOFF SNZB-06P (firmware 1.0.6 / OTA file version 4102) does not keep occupancy_timeout or occupancy_sensitivity when used with a Z-Stack coordinator. A value written from Z2M is accepted and reads back correctly, but 2–8 minutes later the device is back on its factory defaults (60 s / medium). Nothing is written in between.

The frontend and HA keep showing the last written value until someone does a fresh read. So this is easy to miss: on my network it had been happening unnoticed since the sensors were paired.

The same model and firmware on Zigbee2MQTT with an EmberZNet coordinator (another site of mine) has kept 15 s for months, checked by reading the device directly.

This looks like the issue fixed for ZHA in zigpy/zha-device-handlers#5597 / #5598 ("SNZB-06P reboots every ~8 min because its Keep-Alive (0x0025) reads go unanswered"). There the device reads the coordinator's Keep-Alive cluster (0x0025) and reboots to its defaults when it gets no valid answer. See also zigpy/zigpy#1984.

Timeout reads after each write (each value is a fresh read from the device):

Coordinator firmware Device Written Last read 15 First read 60
20261129 radar A 00:08:05 00:09:12 00:15:00
20261129 radar A 00:16:48 00:18:59 00:19:22 (≈2.5 min)
20261203 radar A 00:25:08 00:26:45 00:27:15 (≈2 min)
20261124 radar A 00:29:57 00:33:46 00:34:18 (≈4.3 min)
20261124 new, factory-fresh unit, LQI 216 00:43:28 00:50:47 00:51:06 (≈7.6 min)
20261124 new unit, button pressed after the write 01:00:33 01:04:46 01:05:05 (≈4.5 min)

Sensitivity goes back to medium (ultrasonicUToOThreshold 2) at the same time. A second SNZB-06P on the same network does the same.

Ruled out: power supply (swapped, and a separate unit on its own supply), link quality/routing (the factory-fresh unit had LQI 216; radar A has no source route, it talks directly to the coordinator), re-interview / fresh pairing, three Z-Stack coordinator firmwares, retained MQTT messages and any HA automation (the debug log shows no /set other than mine).

In a debug log covering one revert (below), the radar sends nothing between the last good read and the revert. No cluster 0x0025 frame (clusterID=37) reaches Z2M at any point. Only a genOta queryNextImage at 00:15:28 shows up, which may be a post-boot query.

What did you expect to happen?

The written occupancy_timeout / occupancy_sensitivity should be kept, as they are on the EmberZNet setup.

How to reproduce it (minimal and precise)
  1. Z-Stack coordinator, SNZB-06P on firmware 1.0.6 (4102).
  2. Set occupancy_timeout to 15 (and/or occupancy_sensitivity to low).
  3. Read it back from the device every 30 s (zigbee2mqtt/<device>/get with {"occupancy_timeout": ""}).
  4. Within 2–8 minutes the read returns 60 (and sensitivity medium), with no write in between.
Zigbee2MQTT version

2.14.4 (zigbee-herdsman 11.3.0)

Working comparison: 2.14.3 (zigbee-herdsman 11.2.0, zigbee-herdsman-converters 26.125.0)

Adapter firmware version

Failing: {"meta":{"maintrel":14,"majorrel":0,"minorrel":9,"product":1,"revision":20261124,"transportrev":2},"type":"ZStack3x0"}. Also tried revisions 20261129 and 20261203, same result.

Working comparison: EZSP v13, EmberZNet 7.4.4.0 build 0

Adapter

Failing: zstack (SMLIGHT SLZB-06U, TCP)

Working comparison: ember

Setup

Home Assistant add-on (both sites)

Device database.db entry
{"id":27,"type":"Router","ieeeAddr":"0xf044d3fffe0c0b9e","nwkAddr":60747,"manufId":4742,"manufName":"SONOFF","powerSource":"DC Source","modelId":"SNZB-06P","epList":[1],"endpoints":{"1":{"profId":260,"epId":1,"devId":263,"inClusterList":[0,3,1030,1280,64599,64529],"outClusterList":[3,25],"meta":{}}},"appVersion":1,"hwVersion":0,"dateCode":"20231213","swBuildId":"1.0.6","zclVersion":3,"interviewCompleted":true,"interviewState":"SUCCESSFUL"}

The device does not list 0x0025 in either cluster list, which matches the ZHA reports.

Debug log

Debug log filtered to this device, trimmed (timeout/options blocks removed). There is no other traffic from this device (nwk 60747) in the window.

[00:08:05] zh:controller:endpoint: ZCL command 0xf044d3fffe0c0b9e/1 msOccupancySensing.write({"ultrasonicOToUDelay":15}
[00:08:08] zh:controller:endpoint: ZCL command 0xf044d3fffe0c0b9e/1 msOccupancySensing.write({"ultrasonicUToOThreshold":1}
[00:08:11] z2m: Received Zigbee message from 'Bathroom Occupancy', type 'readResponse', cluster 'msOccupancySensing', data '{"ultrasonicOToUDelay":15}'
[00:09:12] z2m: Received Zigbee message from 'Bathroom Occupancy', type 'readResponse', cluster 'msOccupancySensing', data '{"ultrasonicOToUDelay":15}'
   (nothing from the device 00:09:12 - 00:15:00)
[00:15:00] z2m: Received Zigbee message from 'Bathroom Occupancy', type 'readResponse', cluster 'msOccupancySensing', data '{"ultrasonicOToUDelay":60}'
[00:15:00] z2m: Received Zigbee message from 'Bathroom Occupancy', type 'readResponse', cluster 'msOccupancySensing', data '{"ultrasonicUToOThreshold":2}'
[00:15:28] z2m: Received Zigbee message from 'Bathroom Occupancy', type 'commandQueryNextImageRequest', cluster 'genOta', data '{"fieldControl":0,"fileVersion":4102,"imageType":2060,"manufacturerCode":4742}'
[00:16:48] zh:controller:endpoint: ZCL command 0xf044d3fffe0c0b9e/1 msOccupancySensing.write({"ultrasonicOToUDelay":15}
[00:16:53] z2m: Received Zigbee message from 'Bathroom Occupancy', type 'readResponse', cluster 'msOccupancySensing', data '{"ultrasonicOToUDelay":15}'
[00:17:48] ... '{"ultrasonicOToUDelay":15}'
[00:18:12] ... '{"ultrasonicOToUDelay":15}'
[00:18:35] ... '{"ultrasonicOToUDelay":15}'
[00:18:59] ... '{"ultrasonicOToUDelay":15}'
[00:19:22] z2m: Received Zigbee message from 'Bathroom Occupancy', type 'readResponse', cluster 'msOccupancySensing', data '{"ultrasonicOToUDelay":60}'
Notes

My guess, not verified against the herdsman source: on Z-Stack the coordinator endpoint doesn't advertise the Keep-Alive server cluster 0x0025. So the device either can't find a Keep-Alive server or its reads are dropped before they reach herdsman. Either way it never gets an answer and reboots. The ZHA fix answers the reads with real values (base 10 min / jitter 300 s). With herdsman#1716, a read that does arrive would get UNSUPPORTED_ATTRIBUTE, which may not be enough either.

Happy to test a build or collect more logs.

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.