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

For some reason the processing of the data stopped today, it worked again once I restarted home-assistant. Any ideas why that would be?

Connection loss is not handled atm, which I think is what you are hitting here. I am not sure, but I think it is not implicitly handled by the asyncio protocol/transport. For serial this is less of an issue, but for tcp disconnects can happen more often. I am already looking into implementing this. Iā€™ll let you know when you can test it.

Just to be sure, can you please check the logs to see if there are any disconnect errors.

Iā€™am a bit indisposed at the moment, it might take me a few days before I can look further into this.
I can say that no more disconnects have occurred since the first one.
When I have time I will give more feedback/ check the logs.

At my side, the new TCP connection is working like a charm (aside from some ā€˜No line class found forā€™ warnings like @SuperCyril mentioned). Iā€™m using ser2net as a proxy to my USB (to serial) connected Smartmeter (Landis+Gyr ZCF110 (DSMR 4.2)).

@aequitas, in your commit, I saw that you explicitly enabled DEBUG logging for the dsmr_parser. I guess thisā€™ll be reverted back to ERROR in the final release? It pollutes the logfiles quite a bit now :cold_sweat:

Good to hear its working as expected. Logging will be set to error again in the release indeed. I am working on fixing reconnects, after that I will put it up for merge with HA.

@SuperCyril @AlexMekkering @ThinkPad @fversteegen

TCP & reconnect support, now also included V4 CRC checking:

If you could be so kind to test if this works for you.

Working at my end! Just a, stupid, question; I currently still use DSMR.py through custom_components shouldnā€™t I remove this and go to the official release?

Iā€™m having some trouble with failing CRCs now at my end. I think V4 CRC calculation is incorrect and have issued https://github.com/ndokter/dsmr_parser/pull/13 which fixes it. Other than that, it works as expected (with adapted CRC calculation).

EDIT: Iā€™ve issued https://github.com/ndokter/dsmr_parser/pull/15 now instead.

Is it possible to create a sensor that displays the total power consumption ?

like sensor.power_consumption_low + sensor.power_consumption_normal

Sorry for the late response. I think it should be easily doable with a template sensor: https://home-assistant.io/components/sensor.template/

Just to let you all (and especially @aequitas) know: this is now running flawlessly for several weeks at my end :slight_smile: not a single issue or bad reading.

Hi all,

I have a question, it has not nothing to do with the component but more with the hardware:

I created my own RJ11 to USB cable (from this), and if I connect it to my Windows laptop and open a connection with putty, I can see the data fine.

But if I connect it to my raspberry pi and open a screen session, I only see a blank screen and the cursor moves around as if lines are displayed only they are empty linesā€¦

Iā€™ve tried a lot of settings, but canā€™t get it workingā€¦ Anyone knows what the problem might be?

Thanks in advance!

This question is indeed a bit off topic for this thread, but ok. My best bet is that your cable is set to the wrong baudrate. You can check this by issuing
sudo tty -F /dev/ttyACM0 9600
Which is for 9600 baud. Usually it is either 9600 57600 or 115200. Of course: change ā€œ/dev/ttuACM0ā€ to the right port name.

I have this P1 wifi gateway: http://www.esp8266thingies.nl/wp/ will this work with this component ?

thanks, tried that already (as all other settings, databytes, stopbits, parity, etcā€¦) but no joyā€¦ I will get another usb to serial converter, what kind of converters are you using?

Just encountered the same problem with /dev/ttyAMA0 access rights for modbus module on RaspberryPi, your solution worked perfectly, thank you.

@aequitas thank you very much for all your work - it is really nice to see realtime updates of my power usage - since I have a DSMR5 meter it is even updated every second ;-).

Is it possible to upgrade your DSMR sensor to use the latest (>= 0.8) dsmr_parser?

Currently you use 0.6 and that has no support yet for DSMR5. I have received the ISKRA AM550 (DSMR5) and I was only able to get my setup working after I disabled the validate_telegram_checksum in parsers.py from the dsmr_parser. I expect that after upgrading to 0.8 that issue should be solved since it was addressed in version 0.8.

BTW @piotr I have manually built the P1 wifi gateway (I had an ESP12E laying around) from http://www.esp8266thingies.nl/wp/ and it works smoothly with @aequitas plugin.

I added it as a task, I probably can get to it in the next few days. https://github.com/home-assistant/home-assistant/issues/6218

Iā€™m not sure if the question is allowed, if not please remove. :confused:

Is there anyone in the Netherlands who can help me with a wireless hardware solution that works with this code?
My HASS PC is to far away from the P1 port so USB is not an option.
Maybe an easy manual or a address to buy one, thanks in advance :innocent:

For the creators of the code, awesome work, thanks. :wink:

I use this (see link below) but still did not have a chance to test. I think there are people also using this, pls check the whole threat.