The firmware supports the most popular RTC chips like DS3231 and DS1307. These battery-powered chips can count time independently with the main module. The firmware reads the time from these chips at the boot time and periodically synchronizes the module’s time with RTC.

RTC chips support the I2C protocol. Therefore, you can add them in a similar way, like other I2C sensors.

⚠️ THIS FEATURE IS AVAILABLE IN THE PREMIUM VERSION

⚠️ THIS FEATURE IS NOT AVAILABLE IN THE CC2530/CC2531 ROUTER FIRMWARE

RTC clock setup

Zigbee internals

Zigbee cluster: ZCL_CLUSTER_ID_GEN_TIME
Zigbee attributes: ATTRID_TIME_TIME (UTC data type, 32-bit number of seconds since Jan 1, 2000)
Zigbee commands: read, write.

Zigbee2MQTT commands

You should create a custom converter for your device, place it in the “data” folder, and add it to the configuration.

read - immediately reads the current time.
Topic: zigbee2mqtt/[friedly_name]/get/[channel]
Channel: l1, l2, l3 … l16
Payload: 1
Returns: The counter value {"[channel]": float_value}
write - this command allows you to synchronize time with the host. It is not recommended to call it directly because the device expects an encoded value. The custom converter gets the current host's time and calculates the correct value automatically.
Command example:
const values = {timeStatus: 3, time: time};
endpoint.write('genTime', values);

There are no comments.

Leave a Reply