DSMR Reader Add-on for Home Assistant

By adding the following to the config.yaml (I’m currently on my mobile so copy-pasting from the file editor isn’t really working):

2 Likes

If you are accessing Home Assistant over HTTPS using SSL, you cannot access HTTP sites through an iframe panel.

My HA is over HTTPS… :frowning: so can’t add the url.

Great. I think this would be the only thing needed…

Awesome tool! Working great with a Rasperry Pi Zero W as the ser2net bridge! Patiently waiting for what kind of graphs I can get out of this. :star_struck:

1 Like

i use duckdns the you cannot use this :frowning:

Hi Remco & @poudenes. I just released 0.1.1 which includes an helper to initialize the addon configuration when you are on the command line.

When on the CLI, step into the addon:

docker exec -it addon_0c7296aa_dsmr_reader bash

Execute the following script to initialize the settings from the addon configuration:

. /app/bash.sh

Check the settings by:

env

Now you can run your required commands.

1 Like

Installed it on a NUC running Hass OS. However, the datalogger does not seem to see my P1 cable on /dev/ttyUSB1. Getting:

Geen gegevens gevonden. Zorg ervoor dat het dsmr_datalogger-proces draait of dat je gegevens aanlevert via die API. Daarnaast hoort het dsmr_backend-proces eveneens te draaien.

When using the “standard” HA dsmr integration ( https://www.home-assistant.io/integrations/dsmr/) the /dev/ttyUSB1 is found correctly and data is passed to HA.
`
Startup log of the add-on reports:

[ INFO ] Removing existing PID files...

[ INFO ] Creating log directory...

[ 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

[ INFO ] Verifying if the DSMR web credential variables have been set...

[ INFO ] Verifying database connectivity to host: 77b2833f-timescaledb with port: 5432...

[ INFO ] Database connectivity successfully verified!

[ INFO ] Running post configuration...
Operations to perform:
  Apply all migrations: admin, auth, contenttypes, dsmr_api, dsmr_backend, dsmr_backup, dsmr_consumption, dsmr_datalogger, dsmr_frontend, dsmr_influxdb, dsmr_mindergas, dsmr_mqtt, dsmr_notification, dsmr_pvoutput, dsmr_stats, dsmr_weather, sessions
Running migrations:
  No migrations to apply.
561 static files copied to '/var/www/dsmrreader/static'.
Updating password of superuser "admin"

[ INFO ] Checking for NGINX SSL configuration...

[ INFO ] ENABLE_NGINX_SSL is disabled, nothing to see here. Continuing...

[ INFO ] Checking for HTTP AUTHENTICATION configuration...

[ INFO ] ENABLE_HTTP_AUTH is disabled, nothing to see here. Continuing...

[ INFO ] Configuring DSMR in standlone datalogger mode....

[ INFO ] Starting supervisord...

[ INFO ] Logfiles can be found at: /var/log/supervisor/*.log and /tmp/supervisord.log
/usr/lib/python2.7/dist-packages/supervisor/options.py:461: UserWarning: Supervisord is running as root and it is searching for its configuration file in default locations (including its current working directory); you probably want to specify a "-c" argument specifying an absolute path to a configuration file for improved security.
  'Supervisord is running as root and it is searching '
2021-02-26 10:30:05,807 INFO Included extra file "/etc/supervisor/conf.d/supervisord.conf" during parsing
2021-02-26 10:30:05,807 INFO Set uid to user 0 succeeded
2021-02-26 10:30:05,814 INFO RPC interface 'supervisor' initialized
2021-02-26 10:30:05,814 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2021-02-26 10:30:05,814 INFO supervisord started with pid 29
2021-02-26 10:30:06,816 INFO spawned: 'nginx' with pid 32
2021-02-26 10:30:06,817 INFO spawned: 'dsmr_webinterface' with pid 33
2021-02-26 10:30:06,818 INFO spawned: 'dsmr_datalogger' with pid 34
2021-02-26 10:30:06,820 INFO spawned: 'dsmr_backend' with pid 35
2021-02-26 10:30:08,406 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-02-26 10:30:08,406 INFO success: dsmr_datalogger entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-02-26 10:30:08,406 INFO success: dsmr_backend entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-02-26 10:30:10,408 INFO success: dsmr_webinterface entered RUNNING state, process has stayed up for > than 3 seconds (startsecs)

Any idea where to look for a solution?

Problem solved. removed all old references (in config.yaml and on the integrations page) to the “standard” dsmr integration, rebooted the Nuc. Now it works. Nice app!!

1 Like

Thanks for the update.
Tried it. The export is running. But don’t see them back in the influxdb.

Thats outside the DSMR… the export command is working now !!

Works! thanks you very much for the help and hard work!!

Thanks for making the plugin @sanderdw
I’m running it now from monday. Friday i did update to the last version, and now i get a backup error.

The error he is showing in the message window (openweb ui): Backup creation failed, please check the dsmr_backend logfile.

I also can’t find a log file. Only can see that my last backup was on Friday 02:00.

I’ll hope someone can help to fix this

Below the log it self


INFO ] Removing existing PID files...

[ INFO ] Creating log directory...

[ INFO ] Fixing /dev/ttyUSB* security...
chmod: changing permissions of '/dev/ttyUSB0': Read-only file system

[ INFO ] Verifying if the DSMR web credential variables have been set...

[ INFO ] Verifying database connectivity to host: 77b2833f-timescaledb with port: 5432...

[ INFO ] Database connectivity successfully verified!

[ INFO ] Running post configuration...
Operations to perform:
  Apply all migrations: admin, auth, contenttypes, dsmr_api, dsmr_backend, dsmr_backup, dsmr_consumption, dsmr_datalogger, dsmr_frontend, dsmr_influxdb, dsmr_mindergas, dsmr_mqtt, dsmr_notification, dsmr_pvoutput, dsmr_stats, dsmr_weather, sessions
Running migrations:
  No migrations to apply.
561 static files copied to '/var/www/dsmrreader/static'.
Updating password of superuser "admin"

[ INFO ] Checking for NGINX SSL configuration...

[ INFO ] ENABLE_NGINX_SSL is disabled, nothing to see here. Continuing...

[ INFO ] Checking for HTTP AUTHENTICATION configuration...

[ INFO ] ENABLE_HTTP_AUTH is disabled, nothing to see here. Continuing...

[ INFO ] Configuring DSMR in standlone datalogger mode....

[ INFO ] Starting supervisord...

[ INFO ] Logfiles can be found at: /var/log/supervisor/*.log and /tmp/supervisord.log
/usr/lib/python2.7/dist-packages/supervisor/options.py:461: UserWarning: Supervisord is running as root and it is searching for its configuration file in default locations (including its current working directory); you probably want to specify a "-c" argument specifying an absolute path to a configuration file for improved security.
  'Supervisord is running as root and it is searching '
2021-02-27 18:21:47,483 INFO Included extra file "/etc/supervisor/conf.d/supervisord.conf" during parsing
2021-02-27 18:21:47,483 INFO Set uid to user 0 succeeded
2021-02-27 18:21:47,528 INFO RPC interface 'supervisor' initialized
2021-02-27 18:21:47,528 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2021-02-27 18:21:47,529 INFO supervisord started with pid 29
2021-02-27 18:21:48,536 INFO spawned: 'nginx' with pid 32
2021-02-27 18:21:48,545 INFO spawned: 'dsmr_webinterface' with pid 33
2021-02-27 18:21:48,552 INFO spawned: 'dsmr_datalogger' with pid 34
2021-02-27 18:21:48,558 INFO spawned: 'dsmr_backend' with pid 35
2021-02-27 18:21:50,507 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-02-27 18:21:50,508 INFO success: dsmr_datalogger entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

It’s related to this issue. There is a fix on the way, so expect an update in the coming days.

Thanks for the update @sanderdw
And thanks for the quick fix/push.

And off course @ xirixiz for the fix

@Alfagek, just released DSMR Reader 0.1.2. Can you check if it’s fixed now?

1 Like

making a backup is still Working again!!.
the debug looks different then yesterday but still warnings but I see backup files now :):

0826754b-dsmr-reader:/dsmr# tail -f /var/log/supervisor/dsmr_backend*
pg_dump: You might not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints.
pg_dump: Consider using a full dump instead of a --data-only dump to avoid this problem.
pg_dump: warning: there are circular foreign-key constraints on this table:
pg_dump:   hypertable
pg_dump: You might not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints.
pg_dump: Consider using a full dump instead of a --data-only dump to avoid this problem.
pg_dump: warning: there are circular foreign-key constraints on this table:
pg_dump:   chunk
pg_dump: You might not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints.
pg_dump: Consider using a full dump instead of a --data-only dump to avoid this problem.

@sanderdw it works!

Thanks again :+1:t2:

Check out my recently released Metabase addon for Home Assistant, nice to create some dashboards on top of your DSMR data: Metabase Add-on for Home Assistant

Thanks for this addon!

I installed it yesterday following the instructions you provided.
I’m getting this daily message: Backup creation failed, please check the dsmr_backend logfile

Looking in /backup/dsmrreader i do find yesterdays and todays backup sql-files but they are 0kb.

Running HA core on a rpi 4B. I’ve tried to get some logs but i could’nt find out how.

Doe you have any pointers for me please?

The addon logbook says:


[ INFO ] Removing existing PID files...

[ INFO ] Creating log directory...

[ INFO ] Fixing /dev/ttyUSB* security...
chmod: changing permissions of '/dev/ttyUSB0': Read-only file system

[ INFO ] Verifying if the DSMR web credential variables have been set...

[ INFO ] Verifying database connectivity to host: 77b2833f-timescaledb with port: 5432...

[ INFO ] Database connectivity successfully verified!

[ INFO ] Running post configuration...
Operations to perform:
  Apply all migrations: admin, auth, contenttypes, dsmr_api, dsmr_backend, dsmr_backup, dsmr_consumption, dsmr_datalogger, dsmr_frontend, dsmr_influxdb, dsmr_mindergas, dsmr_mqtt, dsmr_notification, dsmr_pvoutput, dsmr_stats, dsmr_weather, sessions
Running migrations:
  No migrations to apply.
561 static files copied to '/var/www/dsmrreader/static'.
Updating password of superuser "admin"

[ INFO ] Checking for NGINX SSL configuration...

[ INFO ] ENABLE_NGINX_SSL is disabled, nothing to see here. Continuing...

[ INFO ] Checking for HTTP AUTHENTICATION configuration...

[ INFO ] ENABLE_HTTP_AUTH is disabled, nothing to see here. Continuing...

[ INFO ] Configuring DSMR in standlone datalogger mode....

[ INFO ] Starting supervisord...

[ INFO ] Logfiles can be found at: /var/log/supervisor/*.log and /tmp/supervisord.log
/usr/lib/python2.7/dist-packages/supervisor/options.py:461: UserWarning: Supervisord is running as root and it is searching for its configuration file in default locations (including its current working directory); you probably want to specify a "-c" argument specifying an absolute path to a configuration file for improved security.
  'Supervisord is running as root and it is searching '
2021-03-06 23:39:38,759 INFO Included extra file "/etc/supervisor/conf.d/supervisord.conf" during parsing
2021-03-06 23:39:38,760 INFO Set uid to user 0 succeeded
2021-03-06 23:39:38,789 INFO RPC interface 'supervisor' initialized
2021-03-06 23:39:38,790 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2021-03-06 23:39:38,791 INFO supervisord started with pid 29
2021-03-06 23:39:39,799 INFO spawned: 'nginx' with pid 32
2021-03-06 23:39:39,814 INFO spawned: 'dsmr_webinterface' with pid 33
2021-03-06 23:39:39,823 INFO spawned: 'dsmr_datalogger' with pid 34
2021-03-06 23:39:39,830 INFO spawned: 'dsmr_backend' with pid 35
2021-03-06 23:39:41,557 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-03-06 23:39:41,557 INFO success: dsmr_datalogger entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-03-06 23:39:41,558 INFO success: dsmr_backend entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-03-06 23:39:42,929 INFO success: dsmr_webinterface entered RUNNING state, process has stayed up for > than 3 seconds (startsecs)
2021-03-06 23:41:43,003 INFO exited: dsmr_datalogger (exit status 0; expected)
2021-03-06 23:41:44,013 INFO spawned: 'dsmr_datalogger' with pid 45
2021-03-06 23:41:45,018 INFO success: dsmr_datalogger entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

Hi Harry, can you update the addon and try again?

1 Like

Thanks. Will do when i see the update available and let you know.

Edit: update done. Problem solved :smiley: Thanks!