DSMR Reader Add-on for Home Assistant

HI Sanderdw,
note that I moved away from the datalogger to the full setup in HA, and that works well for days now without issues… strange :slight_smile:

Hello.
I did a fresh installation of homeassistant en installed this addon DSMR reader.
Everything workes okay but no i want to import the data from a previous installation.

How can i restore my data from a previous installation of the DSMR reader?

Can somebody help me with it?

I just did a fresh installation of this add-on and it works nicely it seems, thanks for developing and maintaining this!

I have a question: can I also reach the ‘normal’ Web UI? What would be the default webserver port? Or does it only run within HA?

Also: would it be beneficial to setup the DSMR Reader Dropbox backup? Or is the database part of the complete HA backup? I am using the TimescaleDB Add-on.

Sorry for the noob questions.

Edit: by the way, can I just remove the homeassistant db that TimescaleDB creates by default? I don’t use that as of yet…

2022-10-03: DSMR Reader Add-on v1.8.0, DSMR-reader v5.8
Changelog here

The new release should fix the failing update check :slight_smile: .

Yes you can reach the direct UI by setting webserver to ‘Standard’ and under 'Network", show disabled ports, and put a port (ex 7777) there. After this you can go to http://yourha:7777 in your browser and you should see the DSMR Reader UI. But be aware that this disables Ingress support.

Regarding the backup question, all the data is in the DB you are using. So if you want backups of your data, either backup the database or use the Dropbox backup options.

Not sure if you can remove the homeassistant db. For specific questions arround TimescaleDB you can ask them here: https://community.home-assistant.io/t/home-assistant-add-on-postgresql-timescaledb/

1 Like

Hey @sanderdw ,

I did mentioned this a few days ago. I don’t know if it’s you can help me or I have to be at Dennis.

I do have this warning in the addon. And if I see at retention data rotation. It’s in the settings on “a month”. And if i see at “geplande processen” then I see “nu”. And if i see inside the “retention data rotation” I can change date and time. If I do that, the message is gone for a while. And when the time is paste, I get the message again.

How can i fix this?

Regards,
Marco

I noticed there is an update of DMSR Reader (5.9) is it safe to update the dsmr-reader myselve following the tutorial: Updating DSMR-reader — DSMR-reader v5 documentation

Or must I wait to when the hass addon is updated?

2022-12-03: DSMR Reader Add-on v1.9.0, DSMR-reader v5.9
Changelog here

1 Like

Problem “solved”.

Vacuum timescale db with pgadmin.
And the error was gone. Was a bit of scared to do this, because it’s a db for dsmr. But did made a backup. And also I remember that dsmr has also his own db. So al history data was save. Timescale did shrink from >500mb to 50mb :joy:

And thanks for the new update @sanderdw. Works great :ok_hand:t2:

1 Like

It may be coincidence, but I’ve just upgraded my HA OS to version 9.4, and now the DSMR Reader add-on (version 1.9.0) is no longer working. It crashes every time I restart it.

image

I’m also struggling to get it back working again. Didn’t had any clue why but upgrading to 9.4 could also be the problem here.

EDIT: Did a reinstall and it start working again but still have problems with and DSMRreader & Z2M. Got my Z2M in ttyUSB0 and my p1 usb dongle in ttyUSB1. I see in the dsmr reader logs while booting it fixes both? Maybe that’s the issue?

[ INFO ] Fixing /dev/ttyUSB* security…
chmod: changing permissions of ‘/dev/ttyUSB0’: Read-only file system
chmod: changing permissions of ‘/dev/ttyUSB1’: Read-only file system

6h later, it worked for a while but after some time my zigbee devices seem uncontrollable. The USB devices shift from ttyUSB0/ttyUSB1 with reboots. Till now the sollution was to change the settings in the apps. As my zigbee devices are important I’ve turned off DSMR reader add-on.

What is the setup you are using? P1 USB receiver directly in this machine?

Maybe try to do a full boot without the usb device attached and afterwards do a full reboot again with the reader attached again (try another usb port as well).

Thanks, that seemed to do the trick.

I’m using a P1 USB dongle plugged into my RPi4. The red LED was flashing every second even when DSMR reader had crashed.

  1. I unplugged the dongle and pulled the power on the RPi4.
  2. I reconnected power to the RPi4.
  3. I waited until HA and the DSMR Reader were fully started, and then reconnected the dongle.

It now seems to be reading in the data and DSMR reader is running correctly.

Hi,

I installed the timescaledb addon and configured it, from the log it seems that it is working.
I also installed this plugin and configured it (configured the correct USB device …/dev/ttyUSB1 in my case) and I could see that it is connecting to the database and things seems working … but I do not get any data and I get the following error:

2022-12-20 22:15:28,451 DEBUG    dsmr_datalogger_api_client read_telegram                    58 | [2022-12-20 22:15:28.450897] Read 0 Byte(s)
2022-12-20 22:15:28,456 ERROR    mixins       run_once                        107 | dsmr_datalogger.management.commands.dsmr_datalogger: [!] Exception raised. Traceback (most recent call last):
  File "/app/dsmr_backend/mixins.py", line 96, in run_once
    self.run(data=self.data, **options)
  File "/app/dsmr_datalogger/management/commands/dsmr_datalogger.py", line 29, in run
    telegram = next(self.telegram_generator)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/dsmr_datalogger/scripts/dsmr_datalogger_api_client.py", line 51, in read_telegram
    raise RuntimeError(
RuntimeError: It took too long to detect a telegram. Check connection params. Bytes currently in buffer: 0

Any idea?
Could the meter be locked on the P1 interface?
I have an E360 Landis+Gyr meter and I bought the USB-P1 cable special for this meter.

Just started with Home Assistant primarily because I wanted to get more insights in my energy usage. I was very happy to find the DSMR-reader and set out to make it work. My HA knowledge on a scale from 1 – 10 is about 2. So it took some trail and error time to get it to work.

For the noobs like me I have some tips for the installation and configuration:

  1. Install HA Addon … : The only thing I added from the standard installation was the ‘dsmrreader’ database in the configuration.

image

  1. Configure the HA…. : I left the Webserver configuration as it was and only added the host data.

  1. Go to Datalogger …… : The standard settings worked for me

After a restart of HA, the P1 data was showing up in DSMR-reader.

Now I wanted to install the Home Assistant integration to get the data in HA and use it in the new Energy dashboard.

I already had the MQTT broker installed. Configured the MQTT setting in HA. Used the same settings in the MQTT broker. Used the same settings again in the ‘DSMR-reader MQTT broker/verbinding’. Restarted HA and everything worked like a charm.

image

Hope this helps somebody.

@sanderw, top werk! Heel erg bedankt.

Thanks for the compliments and instructions :slight_smile:

@sanderdw during our family’s christmas dinner the 3 gourmetsets draw too many and the fuses blew a couple of times…:slight_smile: Now the telegrams seems to be stuck , cannot be delivered.

RuntimeError: It took too long to detect a telegram. Check connection params. Bytes currently in buffer: 12

Is there a way to reset the reader or database, so i have up to date stats??

Was Home Assistant rebooted because of the fuse blow? Most likely the USB port has changed then so try to configure this again. See DSMR Reader Add-on for Home Assistant - #326 by gcoupe as an example.

Yeah, checked that already. Configured the usb adapter by ID, so that didn’t 2022-12-27 09:35:08,515 ERROR mixins run_once 107 | dsmr_datalogger.management.commands.dsmr_datalogger: [!] Exception raised. Traceback (most recent call last):
File “/app/dsmr_backend/mixins.py”, line 96, in run_once
self.run(data=self.data, **options)
File “/app/dsmr_datalogger/management/commands/dsmr_datalogger.py”, line 29, in run
telegram = next(self.telegram_generator)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/app/dsmr_datalogger/scripts/dsmr_datalogger_api_client.py”, line 51, in read_telegram
raise RuntimeError(
RuntimeError: It took too long to detect a telegram. Check connection params. Bytes currently in buffer: 12
Starting DSMR Reader - datalogger…
127.0.0.1 - - [27/Dec/2022:09:35:15 +0100] “GET /about HTTP/1.1” 200 15871 “-” “curl/7.83.1” “-”
Current logging level set to “ERROR”. More information can be found here: Troubleshooting: Enable DEBUG logging — DSMR-reader v5 documentation’’’