-
Notifications
You must be signed in to change notification settings - Fork 315
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fix wrong attribute names when device manufacturer ID is missing…
… from message (#787) * fix: AttributeReport: Erroneous attribute names Remap cluster attributes names using the target device's manufacturer ID, as certain devices fail to set the manufacturerSpecific and customerCode data in the ZCL Frame header. * fix: Apply fix to all commands * fix: Made remapping of attributes mandatory * zclFrameConverter: deviceManufacturerID is now mandatory * Updated calls to ZclFrameConverter due to the method signature change * test: Added new device (Legrand) to test suite * test: Added new tests to validate PR#787
- Loading branch information
1 parent
fd5bf6c
commit d8e4b5b
Showing
5 changed files
with
107 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d8e4b5b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Koenkk this seems to have caused issues for Ubisys devices.
e.g. setting the vacation_mode writes to custom attribute but to read it it simply uses hvacThermostat.occupany, now the reports coming from the device match rawOutdoorTemperature
Now returns
Before it returned
This is because with this change the manufacturer code is always enforced, so it matches
zigbee-herdsman/src/zcl/definition/cluster.ts
Line 4271 in 81ec998
Which is not valid for the Ubisys H1 for example but only for the H10, before when the manufacturer code was not set it defaulted to the default hvecThermostat cluster definition which is correct in this case, also I think the new behavior is incorrect.
The ZCL is not super clear on it IMHO, but as I read it, it seems valid for a device to use a cluster without manufacturer code to use the default attributes and with manufacturer code set to use custom ones where the attribute ID in both cases can be the same. They should still be treated as different.
I'm pretty sure the Ubisys H1/H10 are not going to be the only devices/manufacturers to be effected by this.
For the time being I've reverted my install to pre this change, I am seeing some other odd behavior too that i haven't traced down to the cause but I suspect it is also this. I'm traveling currently so it's hard to debug.
d8e4b5b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@FabianMangold can you update your PR to only do the new logic in
getCluster
when the device manufacturer ID == Legrand?d8e4b5b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, i am on it, I'll restrict the change to Legrand devices only.
Alternatively, we could remove this code alltogether, and patch the reporting on the known faulty Legrand devices.
Let me know what ever you prefer.
@sjorge is right about ZCL.
Generally speaking, manufacturers tend to use the custom attribute if they bother to create them, otherwise fall back to the generic ones and use generic frames for this purpose.
But then again, there is so many devices out there behaving completely differently.
Sorry for the regression really.
Edit: The PR is here:
#797
d8e4b5b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fixed now!
Changes will be available in the dev branch in a few hours from now. (https://www.zigbee2mqtt.io/advanced/more/switch-to-dev-branch.html)