Skip to content
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

Work-around for meters that publish W instead of kW #7

Merged
merged 3 commits into from
Nov 29, 2021

Conversation

mmakaay
Copy link

@mmakaay mmakaay commented Sep 13, 2021

The issue

While specifications tell us that a smart meter ought to publish its values as floating point values in kW, there are meters out there that publish an integer value in W. This results in error messages like these:

Invalid unit
[E][dsmr:138]: 1-0:1.8.0(000441874*Wh)

The solution

This PR modifies the parser, to allow both a float and an integer, as long as the unit as published by the meter matches those types. So based on the example from above, meters can now publish either of:

  • 1-0:1.8.0(000441874*Wh)
  • `1-0:1.8.0(00044.1874*kWh)

Any other combination of data type and unit will still result in an Invalid unit, meaning that these two are not accepted by the parser:

  • 1-0:1.8.0(000441874*kWh)
  • 1-0:1.8.0(00044.1874*Wh)

The solution is backward compatible, and the change has been tested against a standard smart meter and an affected smart meter (a Sagemom smart meter from Austria).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants