Hi
What is the best way to read cluster attributes periodically in zigbee network coordnicator?
any sample code available for one time request or subscription for value change or periodic subscription ?
Hi
What is the best way to read cluster attributes periodically in zigbee network coordnicator?
any sample code available for one time request or subscription for value change or periodic subscription ?
Hi,
You can for instance use attribute reporting. This method allows the coordinator to receive automatic updates from devices when attribute values change, without having to constantly poll for data. Here's how you can set it up:
1. Create a binding between the coordinator and the device for the specific cluster you want to monitor. This is done using the `zdo bind on` command [Zigbee shell](developer.nordicsemi.com/.../shell.html).
2. Configure attribute reporting using the `zcl subscribe on` command. This sets up the reporting intervals for the attributes you're interested in [Zigbee shell](developer.nordicsemi.com/.../shell.html).
Here's an example of how to set this up:
1. Create a binding: zdo bind on <source_eui64> <source_ep> <dst_addr> <dst_ep> <cluster_id> <request_dst_addr>
2. Configure attribute reporting: zcl subscribe on <addr> <ep> <cluster> <profile> <attr_id> <attr_type> [<min_interval>] [<max_interval>]
For example, to set up reporting for a temperature attribute every 5 to 20 seconds: zcl subscribe on 0x1234 10 0x0402 0x0104 0x0000 29 5 20
This approach is more efficient than constantly reading attributes, as it reduces network traffic and power consumption on battery-operated devices. The coordinator will receive automatic updates when attribute values change within the specified intervals https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/applications/zigbee_weather_station/README.html#creating_bindings_for_periodic_notifications
If you need to manually read attributes at specific times, you can use the `zcl attr read` command https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/nrf/libraries/zigbee/shell.html, but this is not recommended for frequent, periodic readings.
Kind regards,
Andreas
Hi,
You can for instance use attribute reporting. This method allows the coordinator to receive automatic updates from devices when attribute values change, without having to constantly poll for data. Here's how you can set it up:
1. Create a binding between the coordinator and the device for the specific cluster you want to monitor. This is done using the `zdo bind on` command [Zigbee shell](developer.nordicsemi.com/.../shell.html).
2. Configure attribute reporting using the `zcl subscribe on` command. This sets up the reporting intervals for the attributes you're interested in [Zigbee shell](developer.nordicsemi.com/.../shell.html).
Here's an example of how to set this up:
1. Create a binding: zdo bind on <source_eui64> <source_ep> <dst_addr> <dst_ep> <cluster_id> <request_dst_addr>
2. Configure attribute reporting: zcl subscribe on <addr> <ep> <cluster> <profile> <attr_id> <attr_type> [<min_interval>] [<max_interval>]
For example, to set up reporting for a temperature attribute every 5 to 20 seconds: zcl subscribe on 0x1234 10 0x0402 0x0104 0x0000 29 5 20
This approach is more efficient than constantly reading attributes, as it reduces network traffic and power consumption on battery-operated devices. The coordinator will receive automatic updates when attribute values change within the specified intervals https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/applications/zigbee_weather_station/README.html#creating_bindings_for_periodic_notifications
If you need to manually read attributes at specific times, you can use the `zcl attr read` command https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/nrf/libraries/zigbee/shell.html, but this is not recommended for frequent, periodic readings.
Kind regards,
Andreas