WIP: Add quirk for Sonoff TRVZB
This only adds child lock and window open attributes from the Sonoff manufacturer specific cluster without any further integration.
I've zero experience in Zigbee/ZHA/quirk space and was just playing around a bit. Maybe this can be a starting point but I feel like there are multiple things I don't yet understand how they're supposed to be implemented/quirked. So help/comments/discussions appreciated!
/cc @TheJulianJES as of https://github.com/home-assistant/core/pull/105453 There is an open issue regarding this device at https://github.com/zigpy/zha-device-handlers/issues/2772
Proposed change
Additional information
Checklist
- [x] The changes are tested and work correctly
- [x]
pre-commitchecks pass / the code has been formatted using Black - [ ] Tests have been added to verify that the new code works
Hi, I have tryed your quirk. For me it is not working. With your Quirk I am not able to change values for the TVRZB. Your values were also not displayed. What makes me wonder is that for Clusters for Childmode and windowmode are not available in the cluster browser.
Since this is the first time, I am experimenting with ZHA quirks it could be the case that i have made something wrong.
this is the .json file from my TRVZB: zha-704d08d7027909b328ce78dead5adde6-SONOFF TRVZB-6826b3c1b9b1842e4077cf02615ed158.json.txt
Codecov Report
Attention: Patch coverage is 46.82540% with 67 lines in your changes missing coverage. Please review.
Project coverage is 86.93%. Comparing base (
cf06668) to head (c3c2cad). Report is 167 commits behind head on dev.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| zhaquirks/sonoff/trvzb.py | 46.82% | 67 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## dev #2831 +/- ##
==========================================
- Coverage 87.50% 86.93% -0.57%
==========================================
Files 292 293 +1
Lines 8952 9078 +126
==========================================
+ Hits 7833 7892 +59
- Misses 1119 1186 +67
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
🚨 Try these New Features:
- Flaky Tests Detection - Detect and resolve failed and flaky tests
Hi, I have tryed your quirk. For me it is not working. With your Quirk I am not able to change values for the TVRZB. Your values were also not displayed. What makes me wonder is that for Clusters for Childmode and windowmode are not available in the cluster browser.
There where no additional clusters defined in the initial commit and yes, reading/writing those attributes via the Manufacturer specific cluster is not currently possible (that's what https://github.com/home-assistant/core/pull/105453 is about).
@TheJulianJES I'd love to get some feedback on this as I still don't feel very confident in the code base. Happy to add tests if this goes into the right direction.
The local_temperature_calibration will come with https://github.com/home-assistant/core/pull/105765
Still on my list to look at this, but also check out: https://github.com/zigpy/zha-device-handlers/pull/2916 It seems to be the same issue you're facing.
The approach also isn't ideal IMO, but might be fine for now.
@TheJulianJES I'd love to get some feedback on this as I still don't feel very confident in the code base. Happy to add tests if this goes into the right direction.
The
local_temperature_calibrationwill come with home-assistant/core#105765
I really appreciate this feature, but calibration values from -2.5 to +2.5 are too small.
The Sonoff TRVZB supports values from -12.8 to +12,7 °C. (-128 to 127 are valid values for the zigbee-attribute 'local_temperature_calibration')
Unfortunately i have no experience with quirks for zha, but is it possible to extend the calibration range?
@TheJulianJES I'd love to get some feedback on this as I still don't feel very confident in the code base. Happy to add tests if this goes into the right direction. The
local_temperature_calibrationwill come with home-assistant/core#105765I really appreciate this feature, but calibration values from -2.5 to +2.5 are too small.
The Sonoff TRVZB supports values from -12.8 to +12,7 °C. (-128 to 127 are valid values for the zigbee-attribute 'local_temperature_calibration')
Unfortunately i have no experience with quirks for zha, but is it possible to extend the calibration range?
Yes, this is waaaay to small. For example:
But the actual temperature is:
This would require a value of -4.8
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. Thank you for your contributions.
Are there any plans to finish this?
Are there any plans to finish this?
I'm using the quirk as is since the initial MR. I can give it another look to see if removing the _is_manuf_specific override works with the changes to HA in a couple of days. Maybe it gets accepted then.
I'm also interested in seeing some of the functionality in this PR merged. Anything I can do to help?
In the meantime, I've opened https://github.com/zigpy/zha-device-handlers/pull/3358 as an alternative to this.
We've merged this v2 quirk PR now: https://github.com/zigpy/zha-device-handlers/pull/3358 @jayme-github Still, thanks for your PR and sorry for the long wait time.