-
Notifications
You must be signed in to change notification settings - Fork 37
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 a HexStringField parser. #12
base: master
Are you sure you want to change the base?
Conversation
ping? |
more ping |
bbd9de3
to
411d081
Compare
Hi @middelink , thanks for adding this parser! Would you mind changing
|
@glmnet , would you mind reviewing and merging this PR? |
equipement ids as hex strings.
@xabolcs I'm not 100% sure that would be advisable. Om my meter the value reads "0001" or "0002", which if interpreted as a hex string would become "\x00\x01" or "\x00\02", which is not a string normal humans handle well. If anything it would require a HexIntField function, converting hex numbers to a int. What are the values you are seeing? "3031" and "3032" ? |
🤔 Meh, my values (from Hungary) don't follow the standard too, as my meter shows
It just doesn't make much sense to differ only in encoding from the standard and send an integer as a four bytes string ( Sorry for the noise. 😕 |
@xabolcs no worries. Out of curiosity, what does your equipment_id string look like? 0-0:96.1.1 |
@middelink, its a Sanxing SX601/S12U16 (2022) from EON Hungary ... and it doesn't provide such element, just it's serial number (as the first line and in
|
yeah, thats why the hexstrings falls back to a normal string if the content is not "hexy" enough. |
Add a HexStringField parser which understands some DSMRs encode the equipement ids as hex strings.
For example my Dutch DSMR sends out
0-0:96.1.1(4530303639303030373138323035333231)
but in reality this should beE0069000718205321
(which matches the id on the front of the unit).