-
Notifications
You must be signed in to change notification settings - Fork 887
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
base: dev
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #4396 +/- ##
=======================================
Coverage 92.12% 92.13%
=======================================
Files 358 359 +1
Lines 11917 11930 +13
=======================================
+ Hits 10979 10992 +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 = 0x0204 I 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 |
|
||
|
||
( | ||
# TODO: check which manufacturer name is used by the device |
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 just bought this device and can confirm that manufacturer name is "frient A/S", model name is "EMIZB-132", endpoint is 2.
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.
Thanks! I'll update the PR to only include that for now.
@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 -f But nothing shows up for now, do I need to do anything else? |
Proposed change
This fixes the Metering divisor for the Frient EMI Norwegian HAN to a value of
1000
and ignores all attribute updates for that attribute, as the device apparently sends attribute reports with a value of512
randomly.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:
/config
directory.The "Samba share" addon or VSCode addon can be used for this.
zha_custom_quirks
folder in Home Assistant's/config
directory. So, in the folder where HA'sconfiguration.yaml
is..py
file.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-commit
checks pass / the code has been formatted using Black