logo elektroda
logo elektroda
X
logo elektroda

Which hassle-free door opening sensor for Home Assistant? Sonoff SNZB-04

p.kaczmarek2 
Orange box with Sonoff logo, showing a wireless door/window sensor illustration. .
Door opening sensors with WiFi communication have already been discussed extensively on our forum. We even managed to find, with our joint efforts, a way to reprogram such sensors based on a module from BK7231 so that they could be activated locally and Home Assistant paired over MQTT. However, this proved to be a rather difficult and problematic task, so here I want to show a simpler and more reliable alternative.

For comparison - the aforementioned topics about sensors on WiFi:
Door/window sensor without TuyaMCU - deep sleep and energy saving, OpenBeken .
Energy-saving (?) battery-operated door/window sensor on WiFi DS06

So let's start with the purchase. It is said that products on Zigbee are a bit more expensive, but I only paid £35 for the Sonoff SNZB-04. Is there a catch somewhere?
An orange box of the Sonoff SNZB-04 wireless door/window sensor rests on a wooden surface. Orange box with white SNZB-04 text on the top edge. Back of Sonoff SNZB-04 door/window sensor box with technical specifications. .
Sonoff SNZB-04 door/window sensor kit with manual and mounting tape on a wooden surface. .
The sensor is very small indeed. The transmitter measures 47x27x13.5mm and the magnet 32x15.6x13mm. The whole thing is powered by a CR2032 (3V) battery. Normally this sensor works with the manufacturer's gateway, so I'll post its instructions here, but I'll pair it myself with HA via Zigbee2MQTT:
An open user manual showing steps for adding a sensor to an app and removing the battery insulation sheet. Open user manual of Sonoff SNZB-04 sensor with visible QR code and link to the product manual website. .
Markings:
White Sonoff SNZB-04 door/window sensor shown from the back with technical markings, lying on a wooden surface. .

Pairing with Home Assistant .
There is not much to tell here. I have Home Assistant set up according to a theme from a couple of years ago, but updated of course:
Home Assistant tutorial - configuration, WiFi, MQTT, Zigbee, Tasmota .
Zigbee2MQTT I also updated:
How do I update Zigbee2MQTT Home Assistant to the latest version? Unsupported device? .
If we need to, we reset the device according to the instructions, at HA we make sure that pairing is enabled. The sensor should appear in our panel:
Zigbee2MQTT panel showing device list, including a newly added device labeled as “Unsupported.” .
The sensor provides its status (open or closed door), battery status (separately true/false determination if low and numerical voltage) and signal quality:
Configuration panel for the Sonoff SNZB-04 door/window sensor in Zigbee2MQTT. Zigbee2MQTT information panel displaying Sonoff SNZB-04 door sensor status: door open, battery full, voltage 3000 mV, signal quality 81 lqi. Screenshot of the Zigbee2MQTT panel showing the state details of a Sonoff SNZB-04 door sensor, including battery, contact, and signal status. .
And that's it, you can already do automation based on that.


Interior of the Sonoff SNZB-04 .
Now we'll take a look inside, essentially just for educational purposes. We remove the lid:
Opened Sonoff SNZB-04 door sensor with visible CR2032 battery and PCB on a wooden surface. .
The PCB can also be removed, it is only held on by the clips:
Disassembled Sonoff SNZB-04 door sensor on a wooden surface: visible case parts, coin cell battery, and PCB. .
PCB designation: RB-DS01 V1.0 2020/12/17
Close-up of a PCB with a CC2530 chip inside a Sonoff SNZB-04 door sensor. Inside of Sonoff SNZB-04 door sensor with visible battery and PCB. Sonoff SNZB-04 sensor PCB with visible CC2530 chip on a wooden surface. Close-up of Sonoff SNZB-04 sensor PCB with prominent CC2530 chip and electronic components. .
The whole is based on a CC2530, just like the relay shown in the past:
Sonoff Basic ZBR3, which is the famous relay version on Zigbee. Interior, schematic .
The whole thing runs directly from the battery, there's no inverter, so it's economical and efficient.

Summary .
For small battery-powered devices, just like door/window sensors or temperature sensors, Zigbee is in my opinion by far the better and more convenient choice, even more so if you want to pair the whole thing with Home Assistant. With WiFi-based sensors, this is problematic and the batteries wear out quickly anyway. I guess the only plus of the WiFi-based solution is that it can be scripted a bit more, e.g. such a WiFi-based door-opening sensor, after changing the firmware, can send an HTTP GET packet we specify to the server when an event is detected.... but to what end?
For most applications, what I have shown here will definitely suffice.
Finally, this Zigbee device, being battery powered, does not extend the range of our network. This should be kept in mind.
All in all, I recommend it - especially for this price.
And which door/window sensor do you guys use? .

About Author
p.kaczmarek2
p.kaczmarek2 wrote 11780 posts with rating 9909 , helped 563 times. Been with us since 2014 year.

Comments

Add a comment
TechEkspert 24 May 2025 07:50

What is the estimated battery life? [Read more]

gulson 24 May 2025 08:10

£35 for a ZigBee sensor is really not much. If there is nothing wrong with the design, the battery will last for 2 years. I use Aqara, although the price is high. [Read more]

p.kaczmarek2 24 May 2025 08:14

It depends on how many times the door is opened, but more or less. The manufacturer's website about the SNZB-04P states that: https://obrazki.elektroda.pl/6305988200_1748067180_bigthumb.jpg . Overall,... [Read more]

krzbor 24 May 2025 20:22

I recommend AQARA - dimensions 41 x 22 x 11 which is even smaller. All AQARA products are characterised by exceptional aesthetics, which is no small matter when it comes to windows and doors. They can... [Read more]

gulson 24 May 2025 21:22

Interesting idea with this redesign, basically you could send the state of any electronic device (even a complex one) that makes a momentary short circuit. Thanks! [Read more]

TechEkspert 24 May 2025 21:39

A good result for such small batteries, Zigbee is, however, highly energy efficient. For the more power-hungry, a rechargeable version has been developed in the CR2032 format: LIR2032H on Ali at £5... [Read more]

TechEkspert 25 May 2025 12:29

@pkaczmarek2 is there any chance to compare the dynamic power consumption to send one message in a sensor with WiFi and zigbee and the power consumption in standby? E.g. using a measurement resistor and... [Read more]

łuki_mar44 25 May 2025 13:03

I personally use Shelly BLU Door/Window . https://obrazki.elektroda.pl/6541155200_1748170348_thumb.jpg . This is a bluetooth contractron connected to my HomeAssistant via an ESP32 Gateway.... [Read more]

TechEkspert 25 May 2025 16:11

BLE, also an interesting solution, 5 years on CR2032 is very good. I wonder how many times a day they report presence regardless of reed switch activity. [Read more]

łuki_mar44 26 May 2025 07:10

From what I can see from the Logs in HA the reed switch only reports when there is an event. [Read more]

TechEkspert 26 May 2025 09:00

Is there monitoring of battery status in addition to events? [Read more]

łuki_mar44 26 May 2025 09:17

The reed switch has battery control as much as possible. In addition, window angle + light sensor. https://obrazki.elektroda.pl/9928164900_1748243699_thumb.jpg . https://obrazki.elektroda.pl/9604609600_1748243860_thumb.jpg... [Read more]

TechEkspert 26 May 2025 09:43

Not bad, what time does it send status information when no events occur? [Read more]

łuki_mar44 26 May 2025 10:24

Unfortunately, as far as I can see, this integration does not have a status entity for this device. There is only an option to tick regarding the cyclic querying of entities for the BTHome integration. ... [Read more]