-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attribute reporting on startup happens before the device is connected (TZ-292) #102
Comments
Hello @nomis , Regarding the reported attribute issue, if the attribute value is modified before the network startup, the phenomenon you described does indeed occur. This appears to have a minor impact on the Zigbee network, as the report will be transmitted again once it reaches the maximum reporting interval. We plan to optimize this by implementing the following:
|
I'm not changing the value before the network is connected, this is the initial power on value. It could change before the network is connected too (e.g. someone turns the switch on) so that cannot be restricted either. |
Hello @nomis, The attributes will not be reported before the Zigbee network starts up in esp-zboss-lib v1.0.0. Please test this behavior. |
This appears to work as expected, and I can change the attribute value between:
|
Typically when a device is restarted some of its attributes will be reset to a different state (e.g. an on/off outlet will be "off" if the power is reconnected).
With other Zigbee devices, if I restart the device I get an immediate report of the state when it reconnects to the network.
There's automatic attribute reporting on startup but it happens before the device is connected. What's happening here is that the min_interval is 5 seconds and it takes more than 5 seconds to connect. This results in attempts to send messages to devices that are unreachable because we're not connected. If the min_interval is 0 then the reporting can happen so early that the failures don't get reported as an event. It then doesn't resend reports until the max_interval is reached.
I have wrapped
zb_zcl_send_report_attr_command
in order to fix #86 and observe when it sends reports:I can partially work around this by calling
zb_zcl_find_reporting_info()
andzb_zcl_put_reporting_info()
as soon as it connects which has the side effect of resetting the reporting timer so that it runs at the next min_interval. This only produces a good outcome if the min_interval happens to be low enough. (I'm also overriding min_interval to be 0 because I don't like the hard-coded 5s default.)Ideally it should always send a report immediately on connect if the system has restarted or there was a report attempted while disconnected. There's a
zb_zcl_mark_attr_for_reporting()
but it doesn't appear to trigger reports.The text was updated successfully, but these errors were encountered: