Support for reading Dutch Smart Meter (electricity/gas) (P1 port)

Can you connect to the DSMR device outside of HASS to receive telegrams (with eg, terminal or another client) and what settings do you use? Maybe the configured settings for DSMR5 (https://github.com/ndokter/dsmr_parser/blob/master/dsmr_parser/clients/settings.py#L14-L22) don’t work for your device.

Using wget I get the following results:

/ISK5\2M550E-1012

1-3:0.2.8(50)
0-0:1.0.0(170604203021S)
0-0:96.1.1(4530303433303036383737323231393137)
1-0:1.8.1(000050.781*kWh)
1-0:1.8.2(000052.404*kWh)
1-0:2.8.1(000000.000*kWh)
1-0:2.8.2(000000.000*kWh)
0-0:96.14.0(0001)
1-0:1.7.0(00.104*kW)
1-0:2.7.0(00.000*kW)
0-0:96.7.21(00007)
0-0:96.7.9(00003)
1-0:99.97.0(1)(0-0:96.7.19)(170327090020S)(0000000189*s)
1-0:32.32.0(00000)
1-0:32.36.0(00001)
0-0:96.13.0()
1-0:32.7.0(229.7*V)
0-0:96.13.0()
1-0:32.7.0(229.7*V)
1-0:31.7.0(000*A)
1-0:21.7.0(00.103*kW)
1-0:22.7.0(00.000*kW)
0-1:24.1.0(003)
0-1:96.1.0(4730303339303031373031373034313137)
0-1:24.2.1(170604203006S)(00028.717*m3)
!54109

However, in settings.py of the DSMR parser, v5 is not included. Does that makes sense?

How do you use wget to read the serial line? Or do you have some device in between? I don’t have a dsmr5 device to test and made the assumption that the DSMR4 settings would work as well but have no information to go off. That’s why I’m asking for testers. What serial settings work for you? And do they match with the DSMR4 settings in settings.py?

I know, just trying to help in identifying the cause of the errors. Glad I can help.

I have the ISKRA AM550 (DSMR5) and use P1 wifi gateway from http://www.esp8266thingies.nl/wp/. I use the protocol and controller as described here (Domoticz HTTP).

The settings I use are the following:

The one thing that might be different is the bytesize…?

Link is not working… “Error 404 - Pagina niet gevonden.”

http://www.esp8266thingies.nl/wp/

Hi there, are more people experiencing issues with the telegram parser since the update of HA?
I’m getting the following error in the log:

2017-06-11 10:34:40 ERROR (MainThread) [dsmr_parser.clients.protocol] failed to parse telegram
Traceback (most recent call last):
  File "/home/homeassistant/.homeassistant/deps/dsmr_parser/clients/protocol.py", line 103, in handle_telegram
    parsed_telegram = self.telegram_parser.parse(telegram)
  File "/home/homeassistant/.homeassistant/deps/dsmr_parser/parsers.py", line 57, in parse
    raise ParseError('Telegram specification does not match '
dsmr_parser.exceptions.ParseError: Telegram specification does not match telegram data

Config:

sensor dsmr:
  - platform: dsmr
#    port: /dev/ttyUSB0
    dsmr_version: 4

group:
  meter_readings:
    name: Meter readings
    entities:
      - sensor.power_consumption_low
      - sensor.power_consumption_normal
      - sensor.power_production_low
      - sensor.power_production_normal

Anyone experiencing the same of having an idea what’s the cause?

Yep! And you are most probably running Hass 46.0? If you update to 46.1 then the problems should be gone. I haven’t tried this myself as I am not home though…

Yes I am. Will update to 46.1 this evening and let you know if it helps.

Update: Unfortunately it’s still there:

Version:

pi@hassbian:/home/homeassistant/.homeassistant $ hass --version
0.46.1

If you are using a serial to tcp converter the serial settings should not matter. This is important information as that is a common cause for issues. I’m curious why it would not work in this case.

What version DSMR is your device?

it worked at my home for months but after upgrade to 46.1 it doesn’t work anymore…

What DSMR version?

Version 4, didn’t change anything

Just got home from a long day. I think I installed 0.10.
I used

sudo  pip3 install dsmr-parser==0.08

To install a previous version but that did not solve the issue.
It looks like it’s known and in hass 0.46.1 it should be fixed.

Can you try removing the contents of the deps/ folder and restarting HASS afterwards to reinstall dependencies? Nothing should be different between 0.45 and 0.46.1 for dsmr.py so my only guess is some remnants of 0.46 are left behind in cache somehow. Please let me know if that doesn’t work so we can investigate further.

I removed the deps folder and it was recreated during startup. HA did not start after restart but I did not have time to dive into it. My girlfriend needed some attention. I will definitely look into it later today.

Correction: HA did start. The removal did not have any effect. I tried it again with stopping the service, removing and then rebooting. I even installed parser 0.10 and after that 0.08. This did not help.

Installing parser will do nothing as HA manages its own dependences in the deps/ folder which override system installed packages. You can try to install it into the deps/ folder using the --target argument to pip, but HA may overwrite the package at any time when updating.

There are no changes to dsmr.py compared to 0.44 ($ git diff 0.44 0.46.1 homeassistant/components/sensor/dsmr.py).

What version of HA did you guys update from?

Can you try putting the dsmr.py file from an older version (https://github.com/home-assistant/home-assistant/commits/dev/homeassistant/components/sensor/dsmr.py) in the custom_components/sensor/ directory in you config and try which version works.

Otherwise we might have hit on an dependency like pyserial updating but that seems odd as I see no related changes (https://github.com/pyserial/pyserial-asyncio/compare/v0.3...v0.4)