zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

After power is restored, the SNZB-02B problem

Open qubitest opened this issue 2 months ago • 14 comments

What happened?

Hello,

I am experiencing a problem with the SONOFF SNZB-02B temperature and humidity sensor in my Zigbee network.

In my country, power outages happen quite frequently. When the power goes out, my Zigbee coordinator and all Zigbee routers are powered off. After the power is restored, most of my Zigbee devices reconnect and work normally, but the SNZB-02B does not properly recover its communication with the Zigbee network.

Previously, I was using an SNZB-02P in exactly the same location, and it worked correctly in this situation: after a complete power outage and restoration, it automatically resumed normal communication.

I replaced the SNZB-02P with an SNZB-02B because I specifically need the Dew Point measurement provided by the SNZB-02B.

I have now tested two different SNZB-02B devices, and both behave exactly the same way.

There is an important detail: the SNZB-02B does not necessarily become completely "offline" in Zigbee2MQTT.

For example, Zigbee2MQTT currently shows:

Availability: Online 1 day ago
Last seen: 2026-09-13 03:31:06 +03:00

and the current device state is:

{
    "battery": 100,
    "dew_point": 17.7,
    "humidity": 74.3,
    "humidity_calibration": 0,
    "last_seen": "2026-09-13T03:31:06+03:00",
    "linkquality": 204,
    "temperature": 22.5,
    "temperature_calibration": 0,
    "update": {
        "installed_version": 4101,
        "latest_release_notes": null,
        "latest_source": null,
        "latest_version": 4101,
        "state": "idle"
    },
    "vpd": 0.7
}

The firmware is therefore already at the latest available version, 4101.

However, although Zigbee2MQTT may report the device as Online, the sensor stops providing regular measurements. The Home Assistant history shows the following behavior:

sensor.t_g1_temperature,24.7,2026-09-12T23:54:03.556Z
sensor.t_g1_temperature,24.5,2026-09-12T23:55:24.587Z
sensor.t_g1_temperature,24.3,2026-09-12T23:55:58.285Z
sensor.t_g1_temperature,24.1,2026-09-12T23:56:36.274Z
sensor.t_g1_temperature,23.9,2026-09-12T23:57:09.394Z
sensor.t_g1_temperature,23.7,2026-09-12T23:57:59.404Z
sensor.t_g1_temperature,23.5,2026-09-12T23:59:05.452Z
sensor.t_g1_temperature,23.3,2026-09-13T00:00:39.474Z
sensor.t_g1_temperature,23.1,2026-09-13T00:02:56.769Z
sensor.t_g1_temperature,22.9,2026-09-13T00:06:26.738Z
sensor.t_g1_temperature,22.7,2026-09-13T00:12:52.122Z
sensor.t_g1_temperature,22.5,2026-09-13T00:22:31.188Z
sensor.t_g1_temperature,unavailable,2026-09-13T00:37:37.640Z
sensor.t_g1_temperature,22.5,2026-09-13T03:08:01.445Z
sensor.t_g1_temperature,unavailable,2026-09-13T06:13:06.068Z
sensor.t_g1_temperature,22.5,2026-09-13T07:59:35.902Z
sensor.t_g1_temperature,unavailable,2026-09-13T12:00:01.114Z
sensor.t_g1_temperature,22.5,2026-09-13T15:03:40.679Z
sensor.t_g1_temperature,unavailable,2026-09-13T21:21:19.706Z
sensor.t_g1_temperature,unknown,2026-09-13T21:21:20.938Z
sensor.t_g1_temperature,22.5,2026-09-13T21:22:08.035Z
sensor.t_g1_temperature,unavailable,2026-09-14T01:14:03.840Z
sensor.t_g1_temperature,22.5,2026-09-14T01:14:06.879Z

This suggests that the device is not simply disconnected permanently. Instead, after the power outage it appears to lose normal communication with the Zigbee network and only occasionally sends or responds to something. The device can remain marked as Online in Zigbee2MQTT while the sensor data is no longer updated normally.

A short press of the button on the SNZB-02B does not restore normal communication.

The only reliable way I have found to recover the device is to hold the button for a longer period and then enable pairing mode in Zigbee2MQTT, effectively forcing the device to join the network again.

This is particularly inconvenient because the sensor is installed in my basement. Manually going there and repairing the device after every power outage is not practical.

My Zigbee network itself appears to be working correctly because the other Zigbee devices recover normally after the coordinator and routers restart.

@CubeZ2mDeveloper

What did you expect to happen?

No response

How to reproduce it (minimal and precise)

No response

Zigbee2MQTT version

2.14.1

Adapter firmware version

9.1.1 [GA]

Adapter

Ember

Setup

x86-64, containerized

Device database.db entry

No response

Debug log

No response

Notes

No response

qubitest avatar Sep 14 '26 16:09 qubitest

Thank you for reporting this issue and for providing the details. We are currently working to reproduce the issue and have started investigating it. We will keep you updated as soon as we have any further information or progress.

CubeZ2mDeveloper avatar Sep 17 '26 01:09 CubeZ2mDeveloper

Hi, are there any updates regarding my issue, or perhaps an early firmware version available for testing?

It’s been two weeks since the last disconnection, but the device still hasn’t reconnected to the Zigbee network.

Image

qubitest avatar Oct 08 '26 19:10 qubitest

Hello, I’d like to learn more about the issue related to the 02B you mentioned. You described that "A short press of the button on the SNZB-02B does not restore normal communication". I would like to know: when the device is offline, if the button is pressed once, does the indicator light flash in a repeating pattern of two quick flashes followed by one slow flash?

luckyyy33456 avatar Oct 10 '26 07:10 luckyyy33456

Hi, I’ve just checked, and it seems that my statement was incorrect.

After two weeks in offline mode, I pressed the button and observed two short flashes followed by one long flash, and the device reconnected to the network.

The same thing happened with my main network, which is powered by a UPS. Due to my mistake, a circuit breaker tripped, and the coordinator and all the routers in the network shut down simultaneously. The SNZB-02LD device exhibited the same behavior: it went offline and did not reconnect automatically. Pressing the button brought it back online as well.

qubitest avatar Oct 10 '26 15:10 qubitest

The auto-reconnect behavior of the temperature and humidity sensor devices follows a pattern: they scan the network at intervals, and the interval gradually gets longer. Since we don’t know how long power outages typically last in your area, it’s possible that the power remains off during the auto-reconnect period, which would cause auto-reconnect to fail. Manually pressing the button to reconnect is the most effective method.

I’d like to understand your situation better, as it will help us test and fix the bug :) ① Could you please tell me how long a power outage typically lasts for you? ② Aside from the 02B and 02WD, how do the other temperature and humidity sensors behave when reconnecting?

luckyyy33456 avatar Oct 12 '26 07:10 luckyyy33456

1)The power outage lasts approximately 2–3 hours. 2)The SNZB-02DR2 reliably reconnects to the network every time power is restored. The six scene buttons also reconnect to the network, and no issues have been observed with them either. I would also like to add that the last power outage occurred approximately 18 days ago, and the SNZB-02B has not reconnected the network since then.

I would also like to point out that, in the second network, which had an SNZB-02LD, the power outage lasted only 7–8 minutes while the hybrid inverter and Zigbee server were rebooting. After that, the SNZB-02LD showed "Last seen: 1 day", meaning it had not rejoined the network for 24 hours until I pressed the button.

qubitest avatar Oct 12 '26 15:10 qubitest

A 2–3 hour power outage is quite short. Logically, the device should attempt to reconnect frequently during that period, so it shouldn't fail to connect.

Also, all SONOFF temperature and humidity sensors actually use the same reconnection mechanism. So, it shouldn't be the case that some devices can reconnect while others cannot. Could it be that the distances between different devices and the gateway vary, or that other signals are causing interference?

Connectivity stability issues are difficult to analyze. Our internal tests all meet the standards, and we also can't rule out the impact of differences in users' home network environments. Therefore, we currently have no plans for improvements in this area. I'm very sorry. o(╥﹏╥)o However, if you're willing, we can discuss further to see if other factors might be involved.(* ̄︶ ̄)

luckyyy33456 avatar Oct 13 '26 07:10 luckyyy33456

Yes, of course. Let’s discuss this in more detail. Do you think the problem is related to signal quality?

I’ve also ordered an SNZB-02P, which will be installed next to the SNZB-02B so that both devices operate under the same conditions for further diagnostics.

qubitest avatar Oct 20 '26 18:10 qubitest

OK, fine :) I’d like to know which gateway model the 02B and the 02P mentioned above are connected to. Also,how many devices are connected to this gateway?Aside from the auto-reconnect issue, have you experienced any disconnection problems with the 02B?

luckyyy33456 avatar Oct 28 '26 02:10 luckyyy33456

If it’s convenient, I’d also like to ask about the device’s signal strength, the distance between the device and the gateway, and the IDs of both the device and the gateway.

luckyyy33456 avatar Oct 28 '26 03:10 luckyyy33456

here is another related case involving six SNZB-02P and one SNZB-02D

Setup: Home Assistant app/add-on; Zigbee2MQTT 2.14.3 (app 2.14.3-1); SONOFF ZBDongle-P, ZStack3x0 firmware 20250321. Five 02P run 2.2.0, one runs 2.1.0; the 02D runs 2.3.0.

On 5 November 2026, after an approximately 1.5-hour power interruption, HA restarted around 13:15. One 02P sensor resumed reporting early, but the other sensors' last_seen timestamps did not advance until about two hours after that restart.

A similar incidents occurred in October.

Impact: these sensors supply room temperatures to heating control, which can continue using stale readings.

msemenkin avatar Nov 05 '26 13:11 msemenkin

I've been following this discussion for a while, as I've experienced a very similar issue with my SONOFF SNZB-02B.

I thought I'd share my findings, as I may have found something that significantly improves stability.

My setup

  • Coordinator: SMLIGHT SLZB-06p7U
  • Zigbee channel: 11
  • Coordinator transmit power: Initially 20 dBm, later reduced to 15 dBm
  • Software: Zigbee2MQTT + Home Assistant
  • Sensors: SONOFF SNZB-02B and a cheaper Tuya TS0201 temperature/humidity sensor
  • Routers: Several Zigbee routers, including two Tuya TS011F_plug_3 smart plugs and a ZRM01
  • Power: Coordinator, network equipment and Zigbee routers are continuously powered, with UPS backup

Both temperature sensors are installed outside, next to each other, in a Stevenson-style radiation shield. The signal passes through two walls to reach the coordinator. There are also Zigbee routers indoors, approximately 2 metres from the sensors, but separated by a thick exterior wall.

Original problem

The Tuya sensor occasionally stopped reporting measurements for several hours (sometimes around 4 hours), but eventually recovered on its own.

The SNZB-02B was worse. With firmware 1.0.5 (4101), it typically stopped reporting completely after approximately 2 days.

Once this happened, Zigbee2MQTT received no further measurements or messages from the sensor. Normal reporting did not resume until I physically interacted with the device (pressing its button or removing/reinserting the battery).

Unlike the original issue here, I did not experience power outages or coordinator restarts before these failures.

Both sensors had previously worked without these issues indoors, where Zigbee reception was better.

Investigating the Zigbee network

I noticed that both sensors had originally been paired indoors and were connected directly to the coordinator, despite having several Zigbee routers available.

The Tuya sensor sometimes showed extremely low LQI values (0–1).

I tried pairing the sensors through specific routers using Zigbee2MQTT's "Permit join via" feature.

Some observations:

  • The Tuya TS0201 successfully joined through one of the TS011F smart plugs.
  • However, after a short time, it switched back to the coordinator without any manual intervention.
  • I couldn't reliably get the SNZB-02B to join through any of the three tested routers, even after a factory reset.
  • With joining permitted on the entire network, the SNZB-02B connected directly to the coordinator again.
  • I also tried pairing with the sensor temporarily placed in a better reception area.

I cannot conclude that the SNZB-02B is incompatible with these routers, but I found this behaviour interesting.

Changes and results

On October 21, I updated the SNZB-02B to firmware 1.0.7 (4103, dated 2026-10-16).

I also experimented with reducing the SLZB coordinator's transmit power from 20 dBm to 15 dBm.

My theory was that the coordinator's relatively high transmit power might create an asymmetric link: battery-powered sensors could hear the coordinator well enough to select it as their parent, but their own transmissions might not reliably reach it through the walls.

Reducing the coordinator's transmit power might encourage devices to use nearby routers instead.

As of November 14, the SNZB-02B has been running for approximately 24 days without another complete communication freeze.

Previously, it usually stopped reporting after around 2 days.

The SNZB-02B is still connected directly to the coordinator and continues to report normally, despite relatively low LQI values (around 40–50 in my earlier observations).

Interestingly, the Tuya sensor eventually switched back to the PC display smart plug on its own. It still occasionally shows flatlines in its temperature history, but the SONOFF has remained stable.

Conclusion

I cannot say whether the improvement came from:

  1. Updating the SNZB-02B firmware from 1.0.5 to 1.0.7.
  2. Reducing the coordinator's transmit power from 20 to 15 dBm.
  3. A combination of both.

However, the difference is substantial: previously approximately 2 days between freezes, now more than 3 weeks without one.

For anyone experiencing similar problems, it may be worth investigating coordinator transmit power and possible asymmetric Zigbee links, rather than only trying to increase signal strength.

Of course, reducing transmit power can also make coverage worse elsewhere, so this needs to be tested carefully.

I hope these observations are useful. I'll update this comment if the sensor freezes again.

Ashus avatar Nov 14 '26 02:11 Ashus

Wow, that's a pretty cool idea! 😄 And it's great to see you've managed to get things working much better!

Thanks for sticking around and sharing all this with us! We hadn't really thought about it from this angle, so your findings give us something interesting to look into when it comes to Zigbee signal issues.

Really appreciate you sharing this!

luckyyy33456 avatar Nov 18 '26 08:11 luckyyy33456

here is another related case involving six SNZB-02P and one SNZB-02D

Setup: Home Assistant app/add-on; Zigbee2MQTT 2.14.3 (app 2.14.3-1); SONOFF ZBDongle-P, ZStack3x0 firmware 20250321. Five 02P run 2.2.0, one runs 2.1.0; the 02D runs 2.3.0.

On 5 November 2026, after an approximately 1.5-hour power interruption, HA restarted around 13:15. One 02P sensor resumed reporting early, but the other sensors' last_seen timestamps did not advance until about two hours after that restart.

A similar incidents occurred in October.

Impact: these sensors supply room temperatures to heating control, which can continue using stale readings.

@CubeZ2mDeveloper @luckyyy33456 Could SONOFF add a firmware option for the SNZB‑02P and SNZB‑02D to disable the increasing Zigbee reconnect delay or set a shorter maximum retry interval?

These sensors supply room temperatures to our heating control. After power and the Zigbee network were restored, most of our sensors took about 10 more hours to resume reporting. Reliable automatic recovery is critical for us. If there’s no way to limit that delay, we’ll have to replace these sensors.

msemenkin avatar Nov 22 '26 05:11 msemenkin