Skip to content
Setting up the Sonoff Zigbee Door/Window Sensor with Home Assistant

Setting up the Sonoff Zigbee Door/Window Sensor with Home Assistant

Want to know instantly when a door or window opens — without relying on cloud apps or Wi-Fi? The Sonoff Zigbee Door/Window Sensor connects directly to your Home Assistant Zigbee network for fast, local, and reliable automation. You can use it to turn lights on/off, save energy and keep track of who's where. 


What You’ll Need

  • Sonoff Zigbee Door/Window Sensor (SNZB-04)

  • A Zigbee coordinator set up (e.g. Sonoff Zigbee 3.0 USB Dongle Plus)

  • A working ZHA or Zigbee2MQTT setup in Home Assistant


Step 1 — Power the Sensor

The Sonoff SNZB-04 ships with a pre-installed CR2477 battery and a pull tab that prevents contact during shipping.
Simply pull out the plastic tab — the LED will blink once to confirm it’s now powered on.
No battery installation is needed.


Step 2 — Prepare Home Assistant

Option A: Using Zigbee2MQTT (Follow this to setup Zigbee2MQTT)

  1. Go to Settings → Add-ons → Zigbee2MQTT → Open Web UI.

  2. Click Permit join (All) this will allow devices to automatically connect. 

  3. Once the device has connected, press Disable join.

Option B: Using ZHA

  1. Go to Settings → Devices & Services → Zigbee Home Automation → Configure → Add device.
    It will search for zigbee devices.


Step 3 — Put the Sensor Into Pairing Mode

On the SNZB-04 sensor, press and hold the button on the bottom (next to the LED) for about 5 seconds until the light begins blinking (it is quite dim and hard to see).
This indicates that the sensor is now in pairing mode and broadcasting to join your Zigbee network.


Step 4 — Wait for Detection

After a few seconds, the sensor should appear automatically:

  • In Zigbee2MQTT, it will show up in the Devices list or logs with a name like:
    0x00124b00294a1234 (SONOFF SNZB-04)

  • In ZHA, Home Assistant will display a popup saying “Device found” and automatically add the sensor to your device list.


Step 5 — Test the Sensor

  1. Simply move the smaller sensor, next to and then away from the other:

    • In ZHA, the device will swap between on/off.

    • In Zigbee2MQTT, the “contact” value should toggle between true/false.

Your sensor is now ready for automations, simply mount it, so when the door/window is shut the gap is less than 30mm. 


FAQ

How can I check the battery level?
Both ZHA and Zigbee2MQTT expose a battery entity or attribute. It usually updates once every few hours. You can view it from the device page in Home Assistant.

How do I re-pair or reset the sensor?
Press and hold the pairing button for 5 seconds until the LED blinks rapidly. This clears the previous network and re-enters pairing mode. You can then follow the pairing steps again.

What is the connectivity range of the SNZB-04?
Typically up to 30 m indoors depending on wall thickness and interference. Range can be extended by adding Zigbee routers or powered devices (such as smart plugs or bulbs).

Does it work offline?
Yes. Like all Zigbee devices, it communicates directly with your coordinator and doesn’t require internet access once paired.

Previous article Setting up the Sonoff Zigbee Human Presence Sensor
Next article How to Set Up the Sonoff Zigbee 3.0 USB Dongle Plus for Home Assistant

Leave a comment

Comments must be approved before appearing

* Required fields

See More

  • Choosing the right Home Assistant Server: HAS-B1, HAS-B2, or HAS-H3

    Choosing the right Home Assistant Server: HAS-B1, HAS-B2, or HAS-H3

    We stock a large range of Home Assistant servers that come pre-installed with Home Assistant OS. Each machine is hand-picked to provide reliable, local smart home control with silent, fanless operation. Below, we compare the specifications of each model so you can decide which one is the right choice to run your Home Assistant server on.

    Read now
  • Matter vs Reality: What Home Assistant Users Should Know

    Matter vs Reality: What Home Assistant Users Should Know

    You’ve probably heard of Matter — the new smart home standard backed by Apple, Google, Amazon, and others. It promises to fix compatibility headaches by letting all your devices talk to each other, regardless of brand or ecosystem.

    Sounds great. But if you’re already deep into smart home setups — especially with Home Assistant and Zigbee — you might be wondering: is Matter even relevant to me?

    Read now
  • Are Smart Home Products Effective at Saving Energy Over Winter?

    Are Smart Home Products Effective at Saving Energy Over Winter?

    Winter is when energy bills hit hardest — and it’s also when smart home technology proves its real value. While no single device is a magic fix, the latest research shows that well-designed smart heating systems consistently help households cut waste, improve comfort, and make heating far more efficient during the coldest months.

    Read now

Compare products

{"one"=>"Select 2 or 3 items to compare", "other"=>"{{ count }} of 3 items selected"}

Select first item to compare

Select second item to compare

Select third item to compare

Compare