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

Prevent Eve devices with newer firmware to be polled #893

Merged
merged 3 commits into from
Sep 23, 2024

Conversation

marcelveldt
Copy link
Contributor

The server has some logic to poll custom attributes when needed, this is for example needed for the custom power/energy attributes on Eve Energy with firmware version < 3.5.

The newer Eve Energy firmware however implements the official Matter 1.3 clusters for power and energy measurements so no need to to poll these attributes anymore.

  • Changes should_poll in the custom cluster/attribute definitions into a method/callback that accepts the MatterNodeData as argument. That way the implementation can do some conditional checks based on node attribute/firmware version etc.

  • Disable polling if the node is not Eve - this catches e.g. the MatterBridge which (ab)uses the Eve custom cluster to send power measurements. There is no reason to poll those values.

  • Disable polling on the Eve power attributes if the node has the new ElectricalPowerMeasurement cluster.

Strictly taken this means that you need to update HA in order to use the new sensors but since the Eve firmware is not yet available this is not a real problem. I could have gone with a super dynamic client-dependent approach where the client determines what attributes should be polled but imo that is overkill for these few attributes and the fact that we're just preparing for the future here. Home Assistant 2024.9 will have the new power sensors available.

matter_server/common/custom_clusters.py Outdated Show resolved Hide resolved
matter_server/common/custom_clusters.py Outdated Show resolved Hide resolved
@marcelveldt marcelveldt added the maintenance Code (quality) improvement or small enhancement which not a new feature label Sep 20, 2024
@marcelveldt marcelveldt merged commit 27ca3f5 into main Sep 23, 2024
4 of 5 checks passed
@marcelveldt marcelveldt deleted the optional-poll-eve branch September 23, 2024 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Code (quality) improvement or small enhancement which not a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants