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

transfer zigbeeCommandOptions into setupAttributes from enumLookup #7336

Closed
wants to merge 1 commit into from

Conversation

grebenyuk51
Copy link

@grebenyuk51 grebenyuk51 commented Apr 4, 2024

fixed issue when zigbeeCommandOptions not transferred from enumLookup to read attribute method
in this case modernExtend does not work with manufacturer specific attributes
unfortunately I don't know how to modify unit-test :(

@sjorge
Copy link
Contributor

sjorge commented Apr 5, 2024

It should in theory figure out it needs the manufacturerCode from the cluster definition.

What cluster.attribute is it failing for is it failing for?

@grebenyuk51
Copy link
Author

@sjorge
here is my code:

modernExtend.enumLookup({
                                name: 'switch_mode',
                                lookup: {
                                    'toggle': 0,
                                    'alternate': 2,
                                },
                                endpointName: 'button_1',
                                cluster: 0xfcb0,
                                attribute: {
                                    ID: 0x0a00,
                                    type: 0x30,
                                },
                                description: 'Operation method of the switch',
                                access: 'ALL',
                                entityCategory: 'config',
                                zigbeeCommandOptions: {
                                    manufacturerCode: 0x4c44,
                                },
                            })

in modernExtend.ts calls method
without options param, than in setupConfigureForReporting calls setupAttributes without optins param, and finally calls endpoint.read without transferring manufacturerCode

@sjorge
Copy link
Contributor

sjorge commented Apr 7, 2024

Ah you are using a cluster/attribute not yet in zh's cluster.ts

Adding it there would have made zh pick the right manufacturerCode.

@Koenkk having per device cluster would also fix this, but it might still be useful for debugging/while adding support for a new device. On the other hand it does add more code to modernExtend to maintain.

I feel once we have per device cluster definitions we could probably do away with handing of numeric cluster/attrib/dataType stuff in modernExtend and make it a bit simpler/more readable.

@grebenyuk51
Copy link
Author

grebenyuk51 commented Apr 7, 2024

Ah you are using a cluster/attribute not yet in zh's cluster.ts

yeah, and, as far as I understand the code, cannot add it using external-converter. Right now I cannot publish my device (working on it) thus cannot add it to z2m

@Koenkk
Copy link
Owner

Koenkk commented Apr 7, 2024

It seems it's better to wait until custom cluster device definitions are supported, I already started working on this in Koenkk/zigbee-herdsman#1011

@grebenyuk51
Copy link
Author

sure, be in touch

@grebenyuk51 grebenyuk51 closed this Apr 7, 2024
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.

3 participants