Closed Koenkk closed 2 weeks 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!
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.
Ready for review!
These 2 tests show the API, the idea is that you can use this from the zhc definition onEvent()
.
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?
onEvent
is also called when device interview completes and z2m starts (type == 'start' || type == 'deviceInterview'
)
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.
LGTM
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.
Created a PR to use the custom cluster for sonoff devices https://github.com/Koenkk/zigbee-herdsman-converters/pull/7432 🥳
Requires https://github.com/Koenkk/zigbee-herdsman/pull/1011, implements https://github.com/Koenkk/zigbee-herdsman/pull/971