Zigbee

configurations

Réseau principal

Conbee II sur raspberry Pi Zero 2W (succède à un Zero de première génération). Matériel Domotique actif.

Réseaux d’essais

zigbee2mqtt

Raspberry Pi 4 raspdomo, SMlight SLZB-MRW10

  • using zigbee by Zigbee2mqtt (secondary network)
  • using zWave by FHEM ZWDongle (test)

Raspberry PI 3B+ Homeassistant sur SonOff dongle E, flashed with multiprotocol firmware.

  • Using zigbee2mqtt on ESP32 C6 and C6 Zero weather station
  • Using openthread (via OT border router & Thread modules)

So far so good.

Raspberry Pi 5 (foreseen to replace raspdomo) sur clé SOnOff P, zigbee2mqtt.

NucPC G3 N150 proxmox LXC (Z2M) HA (ZHA) sur clé Dongle Banggood Clone SOnOff P (réserved). Le test du linux container n’est pas très satisfaisant (pas super stable).

When implementing the weather statio I realized that, unlike TCP/IP NTM, there was no zigbeenetwork time reference, so if one of the zigbee devices need to get the time, a kind of time server needs to be installed, as ZCL foresee an endpoint with the time as solution is possible.

  • Using a single D6/H2 that connects to WiFi and get the time from a NTP server, then disconnects the WiFi to join the zigbee network to provide the time update internally (Cheapest)
  • Using a RTC connected eg. DS3231 to a C6/H2, RTS can be initialized via a NTP WiFi connexion at the start
  • Using a NTP client module (ESP8266 or ESP32) conneted via WiFi and a C6/H2 that gets the ntp information via serial.
  • Using an ESP32 C5 providing it can connect NTP via WiFi on 5GHz and the zigbee on 2.4 GHz simulaneously.

From github article, I found out some methods for the time Cluster on End Point Devices (EP) . The source code is available here Example to be found (here)[https://github.com/AndroidCrypto/ESP32_C6_Zigbee_Coordinator/blob/main/Esp32_C6_Zigbee_ED_Time_Cluster_OLED_v05/Esp32_C6_Zigbee_ED_Time_Cluster_OLED_v05.ino]

// Set time
bool addTimeCluster(tm time = {}, int32_t gmt_offset = 0);  // gmt offset in seconds
bool setTime(tm time);
bool setTimezone(int32_t gmt_offset);

// Get time from Coordinator or specific endpoint (blocking until response)
struct tm getTime(uint8_t endpoint = 1, int32_t short_addr = 0x0000, esp_zb_ieee_addr_t ieee_addr = {0});
int32_t getTimezone(uint8_t endpoint = 1, int32_t short_addr = 0x0000, esp_zb_ieee_addr_t ieee_addr = {0});  // gmt offset in seconds

So A time cluster can be added to a zigbee End-Point, for example a temperature sensor:

#define TEMP_SENSOR_ENDPOINT_NUMBER 10

ZigbeeTempSensor zbTempSensor = ZigbeeTempSensor(TEMP_SENSOR_ENDPOINT_NUMBER);

In the setup before zigbee.begin

// timeinfo is an initialized struct tm
struct tm timeinfo = {};

// initialize timeinfo structure January 13, 2025 13:30:30 CET
timeinfo.tm_year = 2025 - 1900; // = 2025
timeinfo.tm_mon = 0; // January
timeinfo.tm_mday = 13; // 13th
timeinfo.tm_hour = 12; // 12 hours - 1 hour (CET)
timeinfo.tm_min = 30; // 30 minutes
timeinfo.tm_sec = 30; // 30 seconds
timeinfo.tm_isdst = -1;

zbTempSensor.addTimeCluster(timeinfo, 3600);  //bool addTimeCluster(tm time = {}, int32_t gmt_offset = 0);  // gmt offset in seconds

// Set time
void addTimeCluster(tm time = {0}, int32_t gmt_offset = 0); // gmt offset in seconds
void setTime(tm time);
void setTimezone(int32_t gmt_offset);

// Get time from Coordinator or specific endpoint (blocking until response)
struct tm getTime(uint8_t endpoint = 1, int32_t short_addr = 0x0000, esp_zb_ieee_addr_t ieee_addr = {0});
int32_t getTimezone(uint8_t endpoint = 1, int32_t short_addr = 0x0000, esp_zb_ieee_addr_t ieee_addr = {0}); // gmt offset in seconds