Koenkk / zigbee-herdsman

A Node.js Zigbee library
MIT License
485 stars 300 forks source link

Support custom clusters #1019

Closed Koenkk closed 7 months ago

Koenkk commented 7 months ago

Requires https://github.com/Koenkk/zigbee-herdsman/pull/1011, implements https://github.com/Koenkk/zigbee-herdsman/pull/971

liubotongs commented 7 months ago

OK, what I've learned is that the custom cluster needs to be injected at the Device Level. Can you provide an example to help people like me who are not familiar with Z2M better understand? Thank you!

LaurentChardin commented 7 months ago

OK, what I've learned is that the custom cluster needs to be injected at the Device Level. Can you provide an example to help people like me who are not familiar with Z2M better understand? Thank you!

@liubotongs This is really work in progress so far. I believe you need to wait a bit before the full setup is explained by the devs as they are just in the process to implement it. Especially if you are not yet familiar with z2m, better wait for official documentation.

Koenkk commented 7 months ago

Ready for review!

These 2 tests show the API, the idea is that you can use this from the zhc definition onEvent().

sjorge commented 7 months ago

It's a bit late so I'll give this a proper look tomorrow (if I am home on time)

So the idea is to inject them via the onEvent every time the device sends a message ? If so, how did we inject them before we send a message?

Koenkk commented 7 months ago

onEvent is also called when device interview completes and z2m starts (type == 'start' || type == 'deviceInterview')

sjorge commented 7 months ago

onEvent is also called when device interview completes and z2m starts (type == 'start' || type == 'deviceInterview')

Ah that makes more sense, when this is merged I'll use it to fix the vindstyrka, I'll make a generic modernExtend for it and then it will be nicely abstracted.

sjorge commented 7 months ago

LGTM

sjorge commented 7 months ago

I have a bit of time this weekend, so I'll take a go at adding a modernExtend to add a cluster/override a cluster so I can fix the vindstyrke.

Koenkk commented 7 months ago

Created a PR to use the custom cluster for sonoff devices https://github.com/Koenkk/zigbee-herdsman-converters/pull/7432 🥳

liubotongs commented 6 months ago

When I updated Z2M 1.37.0 to version 1.37.1, the ZBMicro device of sonoff.js still had the problem that custom clusters 64529 did not exist, but it was normal in the previous version 1.37.0. Can you tell me what's going on here? What are the solutions? For example, version rollback. thank you.

liubotongs commented 6 months ago

When I updated Z2M 1.37.0 to version 1.37.1, the ZBMicro device of sonoff.js still had the problem that custom clusters 64529 did not exist, but it was normal in the previous version 1.37.0. Can you tell me what's going on here? What are the solutions? For example, version rollback. thank you.

It seems that sonoff.js in zigbee-herdsman-converters has not been updated using the latest version.

LaurentChardin commented 6 months ago

Can you check with version of ZHC you have if your installation ? This was added 2 weeks ago as part as release 19.38.0

Chilli-liu commented 6 months ago

zigbee-herdsman-converters

I found that the ZHC version under my current Z2M is 19.37.2. How do I individually update the ZHC version to the latest version? Thank you! zigbee2mqtt@1.37.1 /opt/zigbee2mqtt └── zigbee-herdsman-converters@19.37.2 overridden