DSMR broken

hi all,

since the new 2020.12.0 (or the OS 5.8) update I am now getting these errors on the DSMR integration. It was working perfectly fine before, but now it stopped working

Logger: dsmr_parser.clients.protocol
Source: /usr/local/lib/python3.8/site-packages/dsmr_parser/clients/protocol.py:112
First occurred: 10:56:35 AM (394 occurrences)
Last logged: 11:03:39 AM
failed to parse telegram

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/dsmr_parser/clients/protocol.py", line 108, in handle_telegram
    parsed_telegram = self.telegram_parser.parse(telegram)
  File "/usr/local/lib/python3.8/site-packages/dsmr_parser/parsers.py", line 59, in parse
    telegram[signature] = parser.parse(match.group(0))
  File "/usr/local/lib/python3.8/site-packages/dsmr_parser/parsers.py", line 249, in parse
    return ProfileGenericObject(self._parse(line))
  File "/usr/local/lib/python3.8/site-packages/dsmr_parser/parsers.py", line 148, in _parse
    raise ParseError("Invalid '%s' line for '%s'", line, self)
dsmr_parser.exceptions.ParseError: ("Invalid '%s' line for '%s'", '99.97.0()\r\n', <dsmr_parser.parsers.ProfileGenericParser object at 0x7f13411fe2e0>)

My config is unchanged since a while now:


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

I triple checked the port, and that is all fine.

Anyone else having this issue?

1 Like

Wow, this issue actually brought my HA to it’s knees… So many errors…

1 Like

Having the same issue. Is in 2020.12.0, as I don’t have yet OS 5.8.

1 Like

Alright, I wasnt sure.
I went into the docker image and removed the 99.97.0 OBIS entries and now it is working again at least…

Filed an issue (as I couldn’t find an existing one):

Excellent, I opened an issue for the parser as I suspect that needs to be updated:

You already seem to have a better grasp of the underlying issue as have. Maybe it is useful for the HA devs to add your bug report upstream to the HA issue so they know to look into that direction.

I will do that :wink:

1 Like

Just so you know, what I removed is the following from the file telegram_specifications.py on line 64 and 110:

        obis.POWER_EVENT_FAILURE_LOG:
            ProfileGenericParser(BUFFER_TYPES,
                                 PG_HEAD_PARSERS,
                                 PG_UNIDENTIFIED_BUFFERTYPE_PARSERS),

You can find this file here:
/usr/local/lib/python-3.8/site-packages/dsmr-parser/

For that you need access to the docker image, which in my case is running on ESXi. I open the console and enter ‘root’ as user and next ‘login’ to get a shell.

Run the command docker exec -it homeassistant /bin/bash to open a shell and you can find the path :slight_smile:

Yes, I am facing the same issue indeed.
/edit: downgraded HA to 0.118.5 and it works again.

Same problem here

Same here…

Logger: dsmr_parser.clients.protocol
Source: /usr/local/lib/python3.8/site-packages/dsmr_parser/clients/protocol.py:112
First occurred: 16:57:38 (30 occurrences)
Last logged: 16:58:06
failed to parse telegram

Traceback (most recent call last):
File “/usr/local/lib/python3.8/site-packages/dsmr_parser/clients/protocol.py”, line 108, in handle_telegram
parsed_telegram = self.telegram_parser.parse(telegram)
File “/usr/local/lib/python3.8/site-packages/dsmr_parser/parsers.py”, line 59, in parse
telegram[signature] = parser.parse(match.group(0))
File “/usr/local/lib/python3.8/site-packages/dsmr_parser/parsers.py”, line 249, in parse
return ProfileGenericObject(self._parse(line))
File “/usr/local/lib/python3.8/site-packages/dsmr_parser/parsers.py”, line 148, in _parse
raise ParseError(“Invalid ‘%s’ line for ‘%s’”, line, self)
dsmr_parser.exceptions.ParseError: (“Invalid ‘%s’ line for ‘%s’”, ‘99.97.0()\r\n’, <dsmr_parser.parsers.ProfileGenericParser object at 0xb0e19850>

1 Like

Im having the same problem,
could you please share the solution?

I have been doing some more research around this intermittent stopping of readings. I found out it stops arou d the whole hours every now and then so today 13.01, 14.01, 15.01 and 19.01. I have an automation to detect “no more difference” in readings and then reload the integration and alerting me.

Is this something somone can work with? What would be the right place to share my data to solve this?