docs/en/zigbee/zigbee.rst
Zigbee
The Zigbee library provides support for creating Zigbee 3.0 compatible devices including:
The Zigbee library is built on top of ESP-ZIGBEE-SDK <https://github.com/espressif/esp-zigbee-sdk>_ and provides a high-level Arduino-style interface for creating Zigbee devices.
Zigbee Network Topology
.. code-block:: text
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Coordinator │◄─────►│ Router │◄─────►│ Router │
│ (Gateway) │ │ (Repeater) │ │ (Thermostat) │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│ │ │
│ ▼ │
│ ┌─────────────────┐ │
│ │ End Device │ │
│ │ (Sensor) │ │
│ └─────────────────┘ │
│ │
▼ ▼
┌─────────────────┐ ┌─────────────────┐
│ End Device │ │ End Device │
│ (Sensor) │ │ (Sensor) │
└─────────────────┘ └─────────────────┘
Device Roles
The library is split into three main components:
ZigbeeCore: The main class that manages the Zigbee networkZigbeeEP: The base class for all Zigbee endpoints, which provides common functionality for all endpoint typesSpecific endpoint classes: The classes for all Zigbee endpoints, which provides the specific functionality for each endpoint typeZigbeeCore
The ZigbeeCore class is the main entry point for all Zigbee operations. It serves as the central coordinator that manages:
The ZigbeeCore class is implemented as a singleton, meaning there's only one instance available globally. You access it directly as Zigbee without creating an instance.
.. toctree:: :maxdepth: 3
zigbee_core
ZigbeeEP
The ZigbeeEP class is the base class for all Zigbee endpoints. It provides common functionality for all endpoint types.
.. toctree:: :maxdepth: 2
zigbee_ep
Specific endpoint classes
Library provides the following endpoint classes from lights, switches, sensors, etc. Each endpoint class provides the specific functionality for each endpoint type and inherits from the ZigbeeEP class.
.. toctree:: :maxdepth: 1 :glob:
ep_*
Common Issues
Device won't join network
OTA updates fail
Battery devices not working
Binding issues
Network connectivity problems
Factory Reset
If you have problems with connecting to the network, you can try to factory reset the device. This will erase all the network settings and act as brand new device.
.. code-block:: arduino
Zigbee.factoryReset(true); // true = restart after reset
Debug Mode
For better debugging, you can enable debug mode to get detailed information about network operations. Call debug mode before starting Zigbee. Also selecting zigbee mode with debug suffix is recommended.
.. code-block:: arduino
Zigbee.setDebugMode(true);
// Start Zigbee with debug output
Zigbee.begin();