home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
70.46k stars 29.39k forks source link

DSMR 5.1 parsing errors #42202

Closed Ghannes closed 3 years ago

Ghannes commented 3 years ago

The problem

DSMR integration does not work with DSMR 5.1

Environment

Smartmeter: Sagemcom t210, running DSMR 5.1

Home Assistant Core release with the issue: HA 0.116.2 Integration causing this issue: dsmr Link to integration documentation on our website: https://www.home-assistant.io/integrations/dsmr/

Problem-relevant configuration.yaml

sensor:
  - platform: dsmr
    port: /dev/ttyUSB1
    dsmr_version: 5

logging: 020-10-22 11:56:35 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback SerialTransport._read_ready() Traceback (most recent call last): File "/usr/local/lib/python3.8/asyncio/events.py", line 81, in _run self._context.run(self._callback, *self._args) File "/usr/local/lib/python3.8/site-packages/serial_asyncio/init.py", line 106, in _read_ready self._protocol.data_received(data) File "/usr/local/lib/python3.8/site-packages/dsmr_parser/clients/protocol.py", line 87, in data_received data = data.decode('ascii') UnicodeDecodeError: 'ascii' codec can't decode byte 0x83 in position 0: ordinal not in range(128)

probot-home-assistant[bot] commented 3 years ago

dsmr documentation dsmr source (message by IssueLinks)

RobBie1221 commented 3 years ago

Is that a thing, DSMR5.1? Is that printed on your meter? Is it for Dutch or Belgian meter?

The specification from "netbeheerdernederland" goes up to 5.0.2: https://www.netbeheernederland.nl/dossiers/slimme-meter-15/documenten

Ghannes commented 3 years ago

Hi Rob, good question. sagemcom.com tells me that it actually is. It's dutch meter, installed last February if i'm not mistaken. What else do you need?

Thanks, Hans

RobBie1221 commented 3 years ago

Maybe a bit obvious, but are you sure the port is correct? It's not able to parse data, which points to an issue with the serial configuration (baudrate, bytesize, stopbits).

According to this: http://domoticx.com/p1-poort-slimme-meter-hardware/ The settings for DSMR5.0 comply with T210-D (115200/8/1), so at least it should be able to parse data, which it can't.

I would say, either port is wrong, settings for serial connection are wrong or your cable is not working. For the last one, what are you using?

Ghannes commented 3 years ago

Thanks, the portnumber was set wrong and now i'm getting values.