
The Sonoff SNZB-01 is a compact Zigbee 3.0 wireless button powered by a CR2450 coin cell battery. It communicates with TapHome indirectly — the button pairs with a Zigbee2MQTT coordinator (e.g., Sonoff ZBDongle-P/E or CC2652-based stick), which bridges Zigbee messages to MQTT topics. TapHome subscribes to these MQTT topics via a PacketParser MQTT module.
The template detects three button actions (single press, double press, long press) and monitors battery percentage, battery voltage, and Zigbee link quality.
Configuration
Zigbee2MQTT setup
Before importing the TapHome template, the SNZB-01 must be paired with a Zigbee2MQTT coordinator:
- Open the Zigbee2MQTT web UI and enable pairing mode (Permit join)
- On the SNZB-01, remove the back cover and long press the reset button for 5 seconds until the LED flashes three times
- The device appears in the Zigbee2MQTT device list with an IEEE address (e.g.,
0x00124b001eab21e5) or a friendly name
Module variable
After importing the template in TapHome, set the SonoffSNZB01 custom variable to identify the device on the MQTT broker:
| Variable | Description | How to obtain | Example |
|---|---|---|---|
SonoffSNZB01 | Zigbee2MQTT friendly name or IEEE address of the SNZB-01 | Zigbee2MQTT web UI → Devices → find SNZB-01 → copy friendly name or IEEE address | 0x00124b001eab21e5 |
The variable is used as the MQTT topic prefix — the listener script subscribes to zigbee2mqtt/{SonoffSNZB01} and zigbee2mqtt/{SonoffSNZB01}/action.
Using the friendly name (e.g.,
living_room_button) instead of the IEEE address makes the configuration more readable. The friendly name can be changed in the Zigbee2MQTT web UI under device settings.
Device capabilities
Button press detection
The template maps the SNZB-01 as a Push Button device in TapHome. Button press events arrive on the zigbee2mqtt/{id}/action topic and are mapped to numeric values:
| Physical action | MQTT payload | TapHome value |
|---|---|---|
| Single press (release + 0.6 s wait) | single | 1 |
| Double press | double | 3 |
| Long press (hold 2 seconds) | long | 2 |
After reading the button state, the value resets to 0 — button actions are event-based and cannot be read back.
Battery and signal monitoring
Each button instance exposes three service attributes:
- Battery — remaining battery percentage (0–100 %) from the JSON state topic. The SNZB-01 uses a CR2450 coin cell with typical lifespan of 1–2 years.
- BatteryVoltage — battery voltage in millivolts from the JSON state topic.
- LinkQuality — Zigbee signal quality indicator (0–255 lqi) from the JSON state topic. Higher values indicate better signal.
All attributes display "-" until the first message is received from the device.
Additional capabilities
The Zigbee2MQTT bridge also exposes a proactive state request topic (zigbee2mqtt/{id}/get) that can request battery and voltage values on demand, and an availability topic for online/offline detection. These capabilities can be added in a future template update.
Troubleshooting
Button presses not detected
- Verify the SNZB-01 is paired with the Zigbee2MQTT coordinator — it should appear in the device list with a green status
- Check that the
SonoffSNZB01custom variable matches the device’s friendly name or IEEE address exactly (case-sensitive) - Use an MQTT client (e.g., MQTT Explorer) to subscribe to
zigbee2mqtt/#and press the button — a message should appear on the/actiontopic - If no MQTT messages appear, the device may have lost its Zigbee connection — re-pair by long pressing the reset button for 5 seconds
Stale battery or link quality values
- Battery and signal data update only when the device wakes up (on button press or periodic reporting)
- If values show
"-", no message has been received yet — press the button to trigger an update - Ensure the Zigbee coordinator has good reception — the SNZB-01 range depends on the Zigbee mesh network
The Sonoff SNZB-01 is discontinued and replaced by the SNZB-01P. The TapHome template remains valid for existing SNZB-01 devices, but new purchases should consider the SNZB-01P which offers improved range and a USB-C rechargeable battery.
