-
Notifications
You must be signed in to change notification settings - Fork 899
Fix Frient EMI Norwegian HAN divisor #4396
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #4396 +/- ##
=======================================
Coverage 92.23% 92.24%
=======================================
Files 368 369 +1
Lines 12075 12088 +13
=======================================
+ Hits 11137 11150 +13
Misses 938 938 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I was just going to submit a PR for this device, but you beat me to it :) There is a zigbee spec doc for this device which explains issues with
So manufacture specific attibute 0x0302 conflicts with the standard However, ideally, it would be possible to write to this attribute to be able to change meter type using enum type like this: class InterfaceMode(t.enum16):
"""Interface Mode."""
NorwegianHAN = 0x0200
NorwegianHANExtraLoad = 0x0201
NorwegianHANAidon = 0x0202
NorwegianHANKaifa = 0x0203
AutoDetect = 0x0204I have no idea if this is something zigpy can handle (fixed attribute read with value 1000, but still possible to write). If not, at least getting fixed |
|
@uvNikita Thanks for the comment! Can you provide both a diagnostics file for the device (ideally without the quirk, but shouldn't really matter) and a debug log of the "invalid divisor" attribute report? Would be great to have the actual messages the device sends in the tests. |
|
Here is signature and diagnostics files, let me know if you need something else: As for the invalid divisor message, how can I get it? I enabled debug logging in zha integration and grepping my home assistant logs with: $ sudo journalctl -u home-assistant --since today --grep 0x0302 -fBut nothing shows up for now, do I need to do anything else? |
|
It looks like solution proposed here should also work for this device (?) |
|
Yeah, I'll take another look at this device if the linked solution is generally ok. We may be able to ignore all "manufacturer specific" requests (e.g. attribute reports) on the Then we might not need to ignore specific attribute reports, like divisor, per ID on the |
|
Can you send me all debug logs (via Discord or email)? Otherwise, try grepping logs for the nwk id. |
ed49bc4 to
9d015c0
Compare
|
I'll merge these changes for now. We can also use We may also need to forward attribute updates from the normal |

Proposed change
This fixes the Metering divisor for the Frient EMI Norwegian HAN to a value of
1000and ignores all attribute updates for that attribute, as the device apparently sends attribute reports with a value of512randomly.TODO:
Additional information
See Z2M issue for reference:
Testing
This is an experimental and untested quirk. We need device diagnostics to make sure this fixes the issue.
If you want to test this as a custom quirk, you can do the following:
/configdirectory.The "Samba share" addon or VSCode addon can be used for this.
zha_custom_quirksfolder in Home Assistant's/configdirectory. So, in the folder where HA'sconfiguration.yamlis..pyfile.zha_custom_quirks.configuration.yaml:(Make sure you only have one
zha:entry in yourconfiguration.yaml. If you modified other ZHA YAML settings, you may need to merge your modifications with the one above.)If you search the web, you should also be able to find some more info on installing custom quirks.
Device diagnostics
We ideally need these before merging:
Checklist
pre-commitchecks pass / the code has been formatted using Black