Skip to content
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

Streamline attribute reporting config and align polling #4765

Merged
merged 2 commits into from
Apr 26, 2021

Conversation

SwoopX
Copy link
Collaborator

@SwoopX SwoopX commented Apr 13, 2021

This PR is intended to streamline the behavior in checkLightBindingsForAttributeReporting() and checkSensorBindingsForAttributeReporting() to check if the corresponding bindings exist and require attribute reporting.

For both functions, a grace time of (val.maxInterval * 3 / 2) is now given (the resources must have the maxInterval already set internally), so that basically 2 reports are allowed to have gone MIA before configuring the reporting again. Otherwise, a default value will be assumed (60 * 6 secs for lights, 60 * 15 secs for sensors (previously 60 * 45)).

All this also has been better aligned with the poll manager, which takes the same code as checkLightBindingsForAttributeReporting(). This should ensure light nodes get a proper fall back to polling, in case no reports come in after (val.maxInterval * 3 / 2).

Some XAL related code has been removed as is seemed to be duplicate code, but required a slight amendment of the maxInterval value (now 1200 instead of 3600) to reflect the initial polling conditions.

All in all, this should prevent some unnecessary requests to set up reporting configration and prevent unnecessary polling of light nodes based on a larger maxInterval of the previous allowed 6 minutes (e.g. light nodes maxInterval is configured to 10 mins, but with the old code, it always gets polled after 6 mins. New code would allow for up to 2 missed maxInterval 10 mins reports before falling back to polling).

@SwoopX SwoopX requested review from manup, ebaauw and Smanar April 13, 2021 13:26
@manup manup added this to the v2.11.2-beta milestone Apr 23, 2021
poll_manager.cpp Outdated Show resolved Hide resolved
Copy link
Collaborator

@ebaauw ebaauw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a good idea, but I don't think I can oversee the impact. The polling and re-issuing the bindings/reporting configuration have always been like magic to me.

@manup manup merged commit 4f53c5b into dresden-elektronik:master Apr 26, 2021
@manup
Copy link
Member

manup commented Apr 26, 2021

Merged to check how it behaves in my network, I have 4x IKEA GU10 CW and 2x IKEA E27 dimable lights.

@SwoopX SwoopX linked an issue May 5, 2021 that may be closed by this pull request
SwoopX added a commit to SwoopX/deconz-rest-plugin that referenced this pull request Jun 9, 2021
This should, in conjunction with PR dresden-elektronik#4765, prevent 1002 ghost events.
@SwoopX SwoopX deleted the reporting branch June 14, 2021 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Apex smart plug - adjust reporting
3 participants