I’d like this conversation to be a tutorial on the different custom configurations for ZigBee and Zwave devices. I don’t know if and how this can be done, but I’m going to open another new conversation, linked to this one, to discuss any questions you may have. Therefore, if you want to comment on anything, please do so in that new conversation. Thank you.
I’m going to try to make and share how it works and how to customize the cluster and attribute reporting settings for ZigBee devices. I also want it to be useful for advanced users who want to try creating their own custom drivers.
In 2020, I had no idea what Zigbee, ZWave, or anything else was. I just bought some SmartThings devices and a hub. I quickly realized I needed to customize features, so I started using Groovy and customizing my DTHs. Edge came later, and I started from scratch, like everyone else.
I encourage you to learn Lua and modify and create your own drivers. SmartThings platform allows us to do, soEverything can be learned, and there’s a lot of information shared within the SmartThings community.
- What is attribute reporting configuration on standard ZigBee 3.0 devices in SmartThings?:
It is a command that is sent to the device in which a variable with the fields and values to be configured must be included:
Include this code in the init lifecycle function and when the doConfigure lifecycle is executed, this configuration will be sent to the device.
local config {
cluster = cluster.ID,
attribute = attributes.ID,
minimum_interval = in seconds,
maximum_interval = in secondos,
data_type = attributeData_type,
reportable_change = value variation to reported. (no need for boolean attributes). }
device:add_configured_attribute(config)
It can also be sent more easily using the default libraries, if the attribute has them defined.
device:send(cluster.id.attribute.id:configure_reporting(device, min_rep_int, max_rep_int, rep_change)))
This is the zigbee 3.0 specification and how manage minimum, maximum intervals and reportable change values:
The minimum reporting interval field is 16 bits in length and SHALL contain the minimum interval, in seconds, between issuing reports for the attribute specified in the attribute identifier field. If the minimum reporting interval has not been configured, his field SHALL contain the value 0xffff.
Maximum Reporting Interval Field
The maximum reporting interval field is 16 bits in length and SHALL contain the maximum , in seconds, between issuing reports for the attribute specified in the attribute identifier field. If the maximum reporting interval has not been configured, this field SHALL contain the value 0xffff.
If this value is set to 0x0000 and the Minimum Reporting Interval Field equals 0xffff, then device revert to its default reporting configuration. The reportable change field, if present, SHALL be set to zero.
Reportable Change Field:The reportable change field SHALL contain the minimum change to the attribute that will result in a report being issued. For attributes with Analog data type (see 2.6.2), the field has the same data type as the attribute. If the reportable change has not been configured, this field SHALL contain the invalid value for the relevant data type.
For attributes of Discrete or Composite data (see 2.6.2 chapter), this field is omittedWhen all attribute reporting configuration records have been processed, the device SHALL generate the constructed
Configure Reporting Response command. If there are no attribute status records in the constructed command, indicating that all attributes were configured successfully, a single attribute status record SHALL be included in the command, with the status field set to SUCCESS and the direction and attribute identifier fields omitted.Periodic Report ing.
A report SHALL be generated when the time that has elapsed since the previous report of the same attribute A report SHALL be generated when the time that has elapsed since the previous report of the same attribute configuration is not specified.The maximum reporting interval of an attribute may be reduced, as it SHOULD not normally cause a problem to devices to receive reports more frequently than expected typical reporting intervals are seconds to minutes.
Minimum values are generally used to reduce network traffic, but this is less important than ensuring that the application timing needs are satisfied.
-
When is the configuration sent to the device in smartthings?:
Sent during device installation in lifeCycle doConfigure
Smartthings never reconfigures or modifies these settings, even if you change the driver for the device. -
Does Zigbee 3.0 allow you to dynamically modify device settings?:
Yes, it is allowed, but some circumstances must be taken into account:
The device must be online and awake, that is, if it is a battery-powered device that sleeps between reporting intervals, to save battery, it must be woken up so that it listens for the configuration command, executes it, and responds to the Hub with the result (success, failure, etc.). -
Can Zigbee device settings be modified or customized with SmartThings?:
Yes, it is possible using custom edge drivers (Edge MC drivers and other community or manufacturer drivers)
Settings can be customized using the device preferences, visible in the App-device-settings
Preferences are encoded and managed in the driver using the lifeCycle InfoChange.
Advanced users can see examples of how to code and handle preferences with Mc drivers on my public github. -
How to successfully change ZigBee settings in SmartThings without having to uninstall and reinstall the device?:
Since SmartThings doesn’t allow for changing the configuration made during device installation, it doesn’t have a specific procedure defined in its libraries for doing so.For zwave devices smartthings have it in its libraries.
Non-battery powered devices and IR Moes allow configuration changes dynamically, as they are always awake.
You just have to change the custom values in the device preferences, with the App-device-settings menu and save it. -
I’m going to describe a procedure that allows you to successfully change the reporting configuration on battery-powered devices that are normally asleep. Samjin (now Aeotec), Motion, Button, Water Leak, and Contact devices don’t need this procedure, because don’t sleep deeply and have one ear always listening, so they consume slightly more battery than other devices that sleep deeply.
The procedure I’m going to describe allows me to modify the configuration of a battery-powered device using App functions and implementing custom code in my Mc drivers in the doConfigure and nit lifecycles.
Step 1: With the App open the device and go to the settings menu
Step 2: Modify the report configuration values in each preference, changing them one by one and clicking Save.
Step 3: On the device to be modified, put it into pairing mode.
Step 4: In the app, tap Add Device and select Search Nearby.
Step 5: The app will find your device, with the same name and driver, it will perform the doConfigure lifecycle, reconfiguring the device, now with the custom values you modified in preferences.
All routines and other settings remain as they were.
The configuration process can be viewed using the CLI and logcat, and you can check whether commands were sent to the device correctly and whether confirmations were received, whether the device was successful, or if there was some kind of failure.
- What can cause an error and prevent the configuration from being changed?
Some manufacturers don’t strictly follow the ZigBee standard and use a different data type for some attributes. I’ve seen cases with Tuya devices.
The device may have failed. The configuration values are stored in flash memory, and it may be very old and have exceeded the write cycle limit, or the memory may simply be broken. I have had a case involving a Lidl power strip and a Tuya switch.
Some messages may have been missed due to Zigbee network congestion at the time.
Smartthings Removing the health check feature from stock drivers, then makes it easier to customize attribute settings, as this feature uses the configured intervals to ensure devices are reporting correctly. If not, it sends a read commands to determine if the device is active on the network or disconnected, and then try recover the device before hub marking it as offline.
This requires that if the intervals are changed, the table used by health check be updated to know the new reporting intervals for each attribute.
On my Mc drivers the health check function is still maintained on drivers with devices NOT powered by batteries-
I’ll be editing post to add any important details I’ve forgotten or errors.
I’ll be adding, in separate posts to this conversation, how to modify and what reasons might require customizing the custom reporting intervals, their advantages and disadvantages, based on my experience of using them for almost two years now.



