-
Notifications
You must be signed in to change notification settings - Fork 739
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
Add quirk for Aqara T2 relay #2821
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #2821 +/- ##
==========================================
+ Coverage 87.35% 87.49% +0.14%
==========================================
Files 287 291 +4
Lines 8835 8934 +99
==========================================
+ Hits 7718 7817 +99
Misses 1117 1117 ☔ View full report in Codecov by Sentry. |
Scenes.cluster_id, | ||
Groups.cluster_id, | ||
OnOff.cluster_id, | ||
MultistateInput.cluster_id, |
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.
I think most Aqara devices use the custom MultistateInputCluster
cluster from opple_remote
, but I'm not sure we need it.
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.
I don't have one of these to test.... I wonder if this is for events if the switch is in decoupled mode? If so we would probably need a custom one?
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.
It disables setting up attribute reporting and sends ZHA events depending on an attribute update.
So yeah, seems to be for decoupled mode.
From a quick look, Z2M seems to do something with that cluster: https://github.com/Koenkk/zigbee-herdsman-converters/blob/ab11b8a796bab2620e233e5a7a0b92506c6d6639/src/lib/xiaomi.ts#L1378-L1383
Should be fine to merge this as-is of course. If it's needed in the future, it can be added (or adapted if the T2 relay works differently).
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.
done
Scenes.cluster_id, | ||
Groups.cluster_id, | ||
OnOff.cluster_id, | ||
MultistateInput.cluster_id, |
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.
Same as comment above with MultistateInputCluster
from opple_remote
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.
see above
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.
done
Interlock confirmed working! The only attribute that appears to be used in OppleCluster endpoint 2 is |
I've tested the quirk with my Aqara T2 relay and sadly the fancy enums (for switch type) won't work. Reading the attributes is great as one gets a human readable output but writing an attribute back always fails. When switching back to simple t.uint8_t writing 2 for e.g. switch type worked. |
Try writing 1, 2, or 3. |
That is what I did. Remove SwitchType.Toggle and wrote a 2 instead. Pushed write attribute - doesn't work. |
Ah, I see what you mean now. When you change the quirk to use If that also doesn't work, does something like |
gonna change the type here... I remember what to do now. Use the correct type in the quirk and the enum in HA config entity. |
Yeah, same for the P1 door sensor PR then probably. |
We do have some places where we use this combination of inheriting zha-device-handlers/zhaquirks/xiaomi/aqara/opple_switch.py Lines 63 to 67 in f2a1ce5
Although I'm not sure if that's a good solution. Current changes regarding types look good. I'd keep them like this (for now). |
I don't think this will work either? we need to send the devices that are checking types the correct type. |
Haven't tested, but |
it is but I think that is what needs to be defined in the attribute definition (the actual type) |
* Add quirk for Aqara T2 relay * fix cluster * rename mode to switch mode * update based on z2m * add test * oops
* Add quirk for Aqara T2 relay * fix cluster * rename mode to switch mode * update based on z2m * add test * oops
Proposed change
Adds a quirk for the Aqara T2 relay. Fixes #2793
TODO:
Additional information
Checklist
pre-commit
checks pass / the code has been formatted using Black