Add events for LevelControl, Color and OnOff - #594
Conversation
|
Just noticed that #419 exists too. I think this is simpler and stands on the main standardized clusters. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #594 +/- ##
==========================================
- Coverage 97.17% 97.17% -0.01%
==========================================
Files 57 57
Lines 10538 10566 +28
==========================================
+ Hits 10240 10267 +27
- Misses 298 299 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Btw. I've explicitly avoided some fixed structure here. Tried to keep the original cluster commands as is. Currently HA has very few devices classes for events, so the structure of the event data there has not given correct structure. Given the above situation, inventing some in-between structure that isn't 1 to 1 mapped to zigbee spec seem pointless and only adds complexity. |
bfdb1b8 to
4605fb6
Compare
|
So rebased on the new cluster rework. Must say it looks much cleaner and less complicated. |
|
Any updates on this? PR for initial event support for zha in Home Assistant depends on it -> home-assistant/core#157853 Also related to #419 It was btw mentioned in this other pull request that adding that event entity support pull request first "is the way to go": |
|
I wonder the same |
|
Will see if i get some time to rebase it. |
- Add event entities for LevelControl client clusters
|
Rebased with a lil-help from a friend. Much cleaner and simpler now. Nice work again on the removal of cluster handlers. I've not yet tested this thou, so must remain draft until tested, but the main ideas could be reviewed if wanted. |
|
Working well with the updated HA change. Seem to be an issue with hiding on/off cluster somewhere on my rotary dimmer (_TZ3000_ixla93vd). But i suspect that is a bug in the quirks. It has On/Off clusters both on server side and client side. |
|
Thanks for rebasing! Right now, my main concern with generic discovery is that the emitted events are exposing low-level ZCL functionality rather than user-understandable button names: they all are cluster operations. Devices can emit This is an annoying situation because spec-complaint ZCL discovery and user-friendliness really don't intersect 😅. ZHA already exposes this information via The only alternative is per-device quirks to map these to buttons, which is what we do now. I was thinking of maybe amending the quirks automation triggers method to also create event entities, since those are "vetted" and already do button mapping? @TheJulianJES what are your thoughts? |
|
Just small comment. My though is that, we should map to "standardized" HA events where they exists. But in absence, we should show the original events that it is possible to read a spec on how they are expected to work. These are proper events with proper translations which can be automated on, in comparison to the global device event emitter that is hard to match and see. |
|
I don't think it's a matter of non-compliance in this case. Server clusters have attributes that indicate support for commands and such. But a client cluster is entirely open ended: the device is free to send any command with any command parameters (i.e. different move rates for different directions or even buttons). |
Depends on home-assistant/core#157853 for support in HA