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

endpoint.configureReporting does not take into account attribute specific manufacturerCode ? #843

Closed
sjorge opened this issue Dec 27, 2023 · 1 comment · Fixed by #844
Closed

Comments

@sjorge
Copy link
Contributor

sjorge commented Dec 27, 2023

public async configureReporting(

I'm debugging a weird issue I'm seeing on a Ubisys H1, it looks like when I send:

mosquitto_pub -t zigbee2mqtt/bridge/request/device/configure_reporting -m '{"attribute":"ubisysVacationMode","cluster":"hvacThermostat","id":"trv/office/1","maximum_report_interval":3600,"minimum_report_interval":0,"reportable_change":0}'

It ends up configuring occupiedHeatingSetpoint for reporting not ubisysVacationMode, it seems it somehow ignores the manufactureringCode specified in the definitions.ts for the ubisysVacationMode attribute.

I'm not sure yet why or how though.

@sjorge
Copy link
Contributor Author

sjorge commented Dec 27, 2023

@Koenkk I think we need to update options.manufacturerCode in this block if attribute.manufacturerCode exists ?

if (cluster.hasAttribute(item.attribute)) {
const attribute = cluster.getAttribute(item.attribute);
dataType = attribute.type;
attrId = attribute.ID;
}

Or am I missing something ?

I think I'm missing something:

diff --git a/src/controller/model/endpoint.ts b/src/controller/model/endpoint.ts
index 9ec931b..6182ad6 100644
--- a/src/controller/model/endpoint.ts
+++ b/src/controller/model/endpoint.ts
@@ -627,12 +627,14 @@ class Endpoint extends Entity {
             if (typeof item.attribute === 'object') {
                 dataType = item.attribute.type;
                 attrId = item.attribute.ID;
+                if (item.attribute.hasOwnProperty('manufacturerCode')) options.manufacturerCode = item.attribute.manufacturerCode;
             } else {
                 /* istanbul ignore else */
                 if (cluster.hasAttribute(item.attribute)) {
                     const attribute = cluster.getAttribute(item.attribute);
                     dataType = attribute.type;
                     attrId = attribute.ID;
+                    if (attribute.hasOwnProperty('manufacturerCode')) options.manufacturerCode = attribute.manufacturerCode;
                 }
             }

Doesn't seem to work, I seem to have completely broken it now.

Edit: maybe not, am messing with the tests and it seems to work but my new test may be bad, let me fiddle some more and open a PR.

sjorge added a commit to sjorge/zigbee-herdsman that referenced this issue Dec 27, 2023
sjorge added a commit to sjorge/zigbee-herdsman that referenced this issue Dec 27, 2023
sjorge added a commit to sjorge/zigbee-herdsman that referenced this issue Dec 27, 2023
Koenkk added a commit that referenced this issue Dec 27, 2023
…acturer specific attribute (#844)

* fix: add test for ep.configureReporting with manufacturerCode

When defining a manufacturerCode in the ZCL cluster definition, it should be used when configuring reporting, even when not specified.

* fix: endpoint.configureReporting should use manufacturerCode when defined

Fixes #843

* Update endpoint.ts

* Update endpoint.ts

---------

Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant