DSMR stops updating sensors

I’m using a ‘Slimme Meter Uitlezer’ device to read the information of the P1 port and make it available via terminal (telnet). In homeassistant I’ve added a DSMR sensor:

  - platform: dsmr
    port: 8088
    dsmr_version: 5

All works well, but after a while (1 of 2 days) the sensors stop updating. Restarting HA solves it, but after a while the problem is there again.

I’m guessing that the connection to the ‘Uitlezer’ is lost and the max reconnect threshold has been reached, but the component doesn’t seem to have any logging option available, so I’m a little in the dark about what’s going on.

Anyone got any idea?

I have the same problem with DSMR stopping reading data. A restart used to solve the problem, but lately it reads only the data once after starting and then stops reading any data. Once in a while it will restart fine and reads data for several days without problem. I think it is also due to a connection drop out, but I have no log helping to pin point the problem. It would be nice to be able to force a reconnection without a full restart… I however have no clue where to look so cannot help much here :frowning:

I’m having the same problem.
Worked fine before.
I was a bit lazy to go and find a solution, but the issue got worse.
It used to work for several days before HA needed a restart, but now it stops working after 10 minutes or so.
Nothing is visible in logging.
I have stared at the code several times, but haven’t found anything weird yet.
I also used a telnet/netcat client next to HA.
That connection is fine, until HA restarts and blocks the connection to the P1 reader. Then it breaks as well. (I need to do some more tests to see if the connection is really dropped.)

Nonetheless the reconnect should work in HA and reset the connection, which is obviously not working.

Maybe I’ll try to get some more debug logging into the component.
I haven’t done any component development yet (except for one bugfix), so maybe a deep dive into the component development documentation is worth a shot :slight_smile:

EDIT: By the way, I am not using a default P1 reader available online.
I made my own ESP8266 relay module that reads the bytes from the P1 port of the meter and sends the bytes to a tcp client that connects to the ESP server, but that should work the same as Ser2net.

It made me eventually quit the HA dsmr plugin and go for the slightly less elegant way of creating manual sensors:


It works great, but I would assume that using the plugin would have been easier.

I recently found that the problem with my P1 reader was not a problem with HA whatsoever.
The P1 port only provides about 250mA, so my ESP kept failing due to a lack of current.
It does use a capacitor to smooth out short peaks and drops in current, but the capacitor cannot fully charge if the ESP boots immediately.
I disconnected the ESP to make sure the capacitor is fully charged before booting the ESP.
After that, it has been working flawlessly.

I’m still seeing this problem. I’ve got a battery powered esp32 currently hooked up to a phonecharger. Due to the code being a bit raw and the wifi not being the greatest the connection drops. I can see this when connecting with telnet from command line.

However, no matter what setting is set the dsmr integration never reconnects after losing it once. I can simulate this by turning the ESP on and off. The connection will simply never get back again until I restart home assistant.

Maybe something is wrong with implementation of reconnect_interval?

Maarten, I have the same issue, also posted it at github.
Its not been resolved. I did manage to put together a dirty workaround.

Have a look at the official Github page for this issue:

Since today I noticed my entities are not updating real time anymore. it use to work very well for the last period… (1s) but now it seems to update ~30secs and sometimes even stop… I expect it to be like this somewhere around ~0.118.x update…

have also asked here:

Ok in integrations I found:

This was set to 30…

I changed to 1 and now it is working again… it must have changed somewhere…