ndokter / dsmr_parser

Library to parse Dutch Smart Meter Requirements (DSMR) telegrams.
MIT License
112 stars 63 forks source link

Added E.ON HUNGARY specification #134

Closed balazs92117 closed 1 year ago

balazs92117 commented 1 year ago

I have added new specification for E.ON service provider of Hungary.

Unfortunately the #80 issue is still exists, so I modified the clients/socket_.py Until the service provider does not send a "normal" message instead of ? signs, we can't further test the issue.

balazs92117 commented 1 year ago

@ndokter Can you take a look at this pls?

ndokter commented 1 year ago

I would add a test like https://github.com/balazs92117/dsmr_parser/blob/eff0a5e1fc7065af902084e356fe6208fb563482/test/test_parse_v5.py maybe called test_parse_v5_hungary.py

Where we can validate that a complete eon/hungary telegram parsees into all expected values

balazs92117 commented 1 year ago

@ndokter I added tests for the new parser. I called it test_parse_v5_eon_hungary.py as we have multiple service providers, not just "E.ON"

ndokter commented 1 year ago

Thanks for your work, i will make a new build soon

Edit: oh the tests broke, will look later

balazs92117 commented 1 year ago

Thank you! :)

ndokter commented 1 year ago

Hi im sorry i've had to revert the change for now. I noticed after merging that tests are breaking due to the belgium keys conflicting. After looking at it i think this is a more general issue that needs to be solved.

Maybe these need to be renamed to a more general key or something else needs to be thought of for dsmr_parser.obis_name_mapping.EN. Something like a translation per dsmr specification in here dsmr_parser.telegram_specifications

Or instead of that translation dict, use something more extensive than these key/values:

obis.P1_MESSAGE_HEADER: CosemParser(ValueParser(str)),

Maybe the translation value could be added there as well (using a new object). So in this case we could add 'P1_MESSAGE_HEADER' there. Could be an object or another nested dict:

{
    'obis_reference': P1_MESSAGE_HEADER,
    'value_parser': CosemParser(ValueParser(str)),
    'value_name': 'P1_MESSAGE_HEADER'
}

Do you know what i mean? What do you think?