How to Create a Raspberry Pi Zigbee Gateway | The Complete Guide (2026)

How to Create a Raspberry Pi Zigbee Gateway

Managing five smart home apps to control five different devices from five different brands is not a smart home, it is a headache. A Philips Hue Bridge for the lights, an IKEA hub for the blinds, an Aqara hub for the sensors. Each one locked to its own ecosystem. Each one dependent on a company's cloud server staying online.

A Raspberry Pi Zigbee Gateway solves all of this in one build.

This guide covers everything you need to build one: what hardware to buy, how to set it up step by step, which software to use, and how to troubleshoot the most common problems.

💡
Quick Answer: To create a Raspberry Pi Zigbee Gateway, you need a Raspberry Pi (3, 4, or 5), a Zigbee coordinator (USB dongle or GPIO HAT), and gateway software like Home Assistant with ZHA or Zigbee2MQTT. The setup takes 30–60 minutes, runs entirely on your local network without cloud dependency, and controls devices from 5,000+ brands including Philips Hue, IKEA, and Aqara all through one interface.

What Is a Raspberry Pi Zigbee Gateway?

A Raspberry Pi Zigbee Gateway is a DIY smart home hub built from two components: a Raspberry Pi single-board computer and a Zigbee coordinator (either a USB dongle or GPIO HAT). Together, they manage a mesh network of smart devices such as lights, sensors, plugs, locks from a single local interface.

Unlike commercial hubs from Philips, IKEA, or Aqara, a DIY gateway is brand-agnostic. It speaks the Zigbee protocol directly, which means it can communicate with devices from any manufacturer that supports the standard.

The gateway software (typically Home Assistant) runs on the Raspberry Pi and serves as your control center like handling automations, scheduling, and device management without sending any data to an external server.


Why Should You Build a Raspberry Pi Zigbee Gateway?

No Cloud Dependency

Your smart home keeps working during internet outages. All control, automation logic, and device data stays entirely on your local network. Commercial hubs from most manufacturers require an active cloud connection for basic function.

Universal Device Compatibility

A Raspberry Pi Zigbee Gateway controls devices from Philips Hue, IKEA TRÅDFRI, Aqara, Xiaomi, Sonoff, and hundreds of other brands through one interface. You are no longer locked into a single manufacturer's ecosystem or forced to buy brand-specific bridges.

Cost-Effective at Scale

A Raspberry Pi 4 and a $20 Zigbee coordinator replaces multiple proprietary hubs. If you currently run a Hue Bridge, an IKEA hub, and an Aqara hub in parallel, you can consolidate all three into one local gateway.

How Zigbee's Mesh Network Works

Zigbee is a self-managing mesh protocol. Mains-powered devices like smart bulbs, plugs that automatically act as signal repeaters, extending the network's reach across your home. The more mains-powered devices you have, the stronger and more reliable your mesh becomes.


What Hardware Do You Need to Build a Raspberry Pi Zigbee Gateway?

You only need four components to get started.

1. Raspberry Pi (3, 4, or 5) A Raspberry Pi 3 handles a basic ZHA setup without issue. For a full Home Assistant installation with multiple integrations and dashboards, a Pi 4 or Pi 5 provides noticeably better performance. The Pi 4 (4GB or 8GB) is the most widely recommended option for a primary smart home gateway.

2. Zigbee Coordinator This is the radio that speaks Zigbee. Two form factors are available:

  • USB dongles — plug into a USB port and are detected automatically by most gateway software. Simple and widely supported.
  • GPIO HATs — mount directly onto the Pi's GPIO pins, keeping all USB ports free and often including a real-time clock (RTC) module.

We cover the top coordinator options in the hardware section below.

3. USB 2.0 Extension Cable (Essential for USB Dongles) This is the most commonly skipped component and the source of most Zigbee interference problems. USB 3.0 ports emit electromagnetic noise on the 2.4 GHz band that actively disrupts Zigbee signals. A short extension cable physically separates the dongle from both the USB 3.0 ports and the Pi's Wi-Fi antenna. Do not skip this.

4. MicroSD Card (32GB or larger) A Class 10 or A1-rated card ensures fast read/write performance for Home Assistant OS. Avoid cheap, unbranded cards. They are a common cause of data corruption in always-on Raspberry Pi deployments.


How Do You Set Up a Raspberry Pi Zigbee Gateway?

Step 1: Install Your Operating System

Flash Home Assistant OS to your microSD card using the Raspberry Pi Imager tool. This is the recommended path for most users. It includes native ZHA support, a built-in add-on store, and a web-based interface that requires no command-line work.

For a manual Zigbee2MQTT deployment, Raspberry Pi OS (64-bit) works fine. Enable SPI and I2C in the raspi-config tool if you are using an advanced GPIO HAT module.

Step 2: Connect Your Zigbee Coordinator

For USB dongles: Plug the dongle into a USB 2.0 port via your extension cable. Avoid the blue USB 3.0 ports on the Pi 4 and Pi 5. They cause 2.4 GHz interference that prevents reliable Zigbee operation.

For GPIO HATs (RaspBee II or ZigiHAT): Seat the HAT firmly onto the GPIO pins. Disable Bluetooth before booting. Bluetooth and Zigbee share the same serial interface and cannot run simultaneously without specific configuration.

Step 3: Add Your Zigbee Integration

In Home Assistant, open Settings → Devices & Services → Add Integration, then search for Zigbee Home Automation (ZHA). Select your coordinator from the detected serial port list — USB dongles typically appear as /dev/ttyUSB0, GPIO HATs as /dev/ttyAMA0.

For Zigbee2MQTT, install the add-on from the Home Assistant Add-on Store and set your serial port in the add-on configuration panel. The add-on detects most coordinators automatically.

Step 4: Pair Your First Devices

Open a pairing window by clicking Permit Join or Add Device in your gateway software. You have 60 seconds to put your device into pairing mode.

Common pairing methods:

  • IKEA bulbs: Toggle power five times rapidly
  • Aqara sensors: Hold the reset button until the LED flashes
  • Sonoff devices: Hold the pairing button for five seconds

Keep the device within one to two metres of the coordinator during first pairing, then move it to its permanent location. The mesh network adjusts automatically.


Which Zigbee Software Should You Use: Zigbee2MQTT, ZHA, or deCONZ?

Feature Zigbee2MQTT ZHA deCONZ
Platform Standalone (requires MQTT broker) Built into Home Assistant Phoscon app (proprietary)
Device Support 5,290+ devices Extensive High (specific brands)
Complexity Moderate Easiest Moderate
Best For Advanced users Beginners RaspBee II users

Choose ZHA if you're running Home Assistant and want the simplest path. It is built directly into Home Assistant, requires no additional software, and gets most users to their first paired device in under fifteen minutes.

Choose Zigbee2MQTT if you want maximum device compatibility and are comfortable setting up a Mosquitto MQTT broker. It also exposes raw MQTT data for advanced integrations and complex automations.

Choose deCONZ if you are using a RaspBee II or ConBee II coordinator. The Phoscon interface is designed specifically for dresden electronic hardware and is the most natural fit.


Why Is My Zigbee Device Not Pairing or Dropping Connection?

Interference causes the overwhelming majority of Zigbee problems. Work through this list before assuming a software fault.

Check your hardware placement:

  • Confirm the USB dongle is in a USB 2.0 port via an extension cable — not directly in USB 3.0
  • Keep the coordinator away from Wi-Fi routers, microwaves, and metal enclosures
  • Set your Wi-Fi router to channels 1 or 6 on 2.4 GHz, and your Zigbee network to channels 15, 20, or 25 — these frequencies have minimal overlap

Check power and firmware:

  • If your coordinator disconnects intermittently, the Pi may not be supplying enough current. A powered USB hub eliminates this variable.
  • Update coordinator firmware using the zha-firmware-updater tool — newer firmware significantly improves pairing reliability and reduces latency

Strengthen your mesh coverage:

  • Battery-powered sensors do not repeat Zigbee signals. A network heavy on sensors and light on mains-powered devices will have coverage gaps.
  • Add at least one mains-powered Zigbee device — a smart plug works well — per 10 to 15 metres of coverage area

Our Top Coordinator Picks at a Glance

Product Best For Rating
Sonoff Zigbee 3.0 USB Dongle Plus — Editor's Choice Most users, plug-and-play ⭐⭐⭐⭐
RaspBee II — Best for Clean Builds GPIO form factor, offline RTC ⭐⭐⭐⭐
ZigiHAT — Best for Advanced Projects Industrial-grade stability ⭐⭐⭐⭐

Sonoff Zigbee 3.0 USB Dongle Plus — Editor's Choice

Sonoff Zigbee 3.0 USB Dongle Plus

The Sonoff dongle runs on the EFR32MG21 chip, supports Zigbee 3.0, and works out of the box with ZHA, Zigbee2MQTT, and openHAB. No firmware flashing required. In our testing, it paired every device we tried within two minutes, and the full Home Assistant setup took under ten minutes.

Pros:

  • True plug-and-play — no firmware prep for standard use
  • Widest software compatibility: ZHA, Zigbee2MQTT, openHAB
  • Strong community support and regular firmware updates
  • Best price-to-performance of any coordinator we tested

Cons:

  • Requires a USB 2.0 extension cable (essential, not optional)
  • Occupies one USB port — minor issue on Pi 4/5, more relevant on Pi 3

Best For: First-time builders and anyone who wants the least friction possible.

Verdict: The right starting point for 80% of users. If you are unsure which coordinator to buy, buy this one.


RaspBee II — Best for Clean Builds

RaspBee II

The RaspBee II is a GPIO HAT from dresden elektronik. It mounts onto the Pi's GPIO pins, freeing all USB ports. It also includes a battery-operated real-time clock — meaning automation timers stay accurate through power outages, which the Pi cannot do without additional hardware.

Pros:

  • Built-in RTC keeps timers accurate through power interruptions
  • GPIO form factor — all USB ports remain free
  • Excellent deCONZ and Phoscon app support
  • Clean, compact long-term build

Cons:

  • Requires disabling Bluetooth before use
  • More involved initial setup than USB options
  • Higher cost than the Sonoff dongle

Best For: Users who want a USB-free build or need reliable timer accuracy through power interruptions.

Verdict: Premium choice for build quality and offline resilience. Worth the extra cost if those specifics matter to your setup.


ZigiHAT — Best for Advanced Projects

The ZigiHAT is a GPIO HAT designed for demanding, always-on deployments. It combines Zigbee coordination with a built-in RTC and is built for long-term stability in complex environments — including ProviewR-based industrial automation systems.

Pros:

  • Designed for high-stability, long-running environments
  • Built-in RTC included
  • Full Zigbee2MQTT and ProviewR compatibility
  • Compact GPIO form factor

Cons:

  • Smaller community — fewer troubleshooting resources online
  • Overkill for standard home automation
  • Highest price point of the three

Best For: Developers or engineers building complex, semi-professional automation systems.

Verdict: Strong hardware with a narrower use case. Clear choice for industrial-grade stability requirements.


Which Coordinator Is Right for You?

Choose the Sonoff Dongle Plus if:

  • You're setting up your first Raspberry Pi Zigbee Gateway
  • You want to plug-and-play with Home Assistant
  • Budget is a priority

Choose the RaspBee II if:

  • You want a clean GPIO build with no USB ports occupied
  • You need automation timers to survive power outages
  • You're planning to use deCONZ or the Phoscon app

Choose the ZigiHAT if:

  • You're building a complex or semi-professional automation system
  • You need long-term hardware stability for an always-on deployment
  • You're integrating with Proview or industrial MQTT tools

Ready to Build? Start Here

You now have everything you need to build and run a Raspberry Pi Zigbee Gateway. Setup takes under an hour, and the long-term payoff controlling any Zigbee-compatible device from any brand through a single local system. It is something no commercial hub delivers at this price point.

The fastest path to a working gateway:

  1. Buy the Sonoff Zigbee 3.0 USB Dongle Plus
  2. Flash Home Assistant OS to a microSD card
  3. Add the ZHA integration and plug in your coordinator
  4. Start pairing devices

Frequently Asked Questions

Can a Raspberry Pi Zigbee Gateway control devices from multiple brands?

Yes — and this is the core reason most people build one. Devices from Philips Hue, IKEA TRÅDFRI, Aqara, Xiaomi, Sonoff, and hundreds of other brands are managed through a single local interface. No separate manufacturer apps or brand-specific hubs required.

Does the gateway work without an internet connection?

Yes, fully. The gateway runs entirely on your local network. Automations, scheduling, and device control continue to function during internet outages — a significant advantage over commercial hubs that depend on cloud connectivity for basic operation.

Do I need to flash custom firmware onto the Sonoff dongle?

No. The factory firmware works out of the box with ZHA and Zigbee2MQTT. Firmware updates are optional useful only if you want the latest pairing improvements or specific bug fixes.

Can I run multiple Zigbee networks on one Raspberry Pi?

Yes. Home Assistant supports running separate Zigbee integrations simultaneously for example, one ZHA network and one Zigbee2MQTT network, each using its own physical coordinator.

How many devices can this gateway support?

The Zigbee protocol theoretically supports up to 65,000 devices per network. In practice, most home setups run 50–100 devices comfortably. The number of mains-powered repeater devices is the main practical limit on range and reliability.

Is a Raspberry Pi 5 required, or will an older model work?

A Raspberry Pi 3 is sufficient for a basic ZHA gateway. For a full Home Assistant installation with multiple integrations and dashboards, a Pi 4 or Pi 5 provides better performance and faster automation response times.

Is this setup compatible with openHAB?

Yes. EFR32MG21-based coordinators including the Sonoff dongle — work with openHAB via the Zigbee binding. Configuration follows a similar process to the Home Assistant approach described above.

What is the difference between a Zigbee gateway and a Zigbee hub?

The terms are commonly used interchangeably. A hub typically refers to a manufacturer's proprietary device like a Philips Hue Bridge. A gateway here refers to a DIY Raspberry Pi system that serves the same function without brand restrictions, cloud dependency, or manufacturer lock-in.