DSMR Reader Add-on for Home Assistant

Released:
2021-02-17: 0.0.4 Extended configuration options & Added arm32v6

1 Like

Did you already find where the problem is when you want use

./manage.py dsmr_influxdb_export_all_readings --to-influx-database dsmrreader-export

This is also not work in your latest release

That’s because when you run docker exec -it addon_0826754b_dsmr_reader bash you are starting a new session which is not initialized by Home Assistant and therefore your bypassing the config settings in the addon configuration.

So what you can do is set al the environment variables by hand.
You can check them by using the env command and for each entry you need to alter you can perform an update.
Example to update the database host:
export DJANGO_DATABASE_HOST=77b2833f-timescaledb
etc

Note: This is a little bit out of scope for this addon. You can also temporarily run the docker image https://github.com/xirixiz/dsmr-reader-docker on your own laptop, perform your migrations, and continue with the addon afterwards.

I have the same problem. I understand the solution of sanderdw but don’t want a downtime. So still looking for a way to achieve this :slight_smile:

It seems that the script not use the information given in Add-on Configuration.
It doesn’t use my info:

DJANGO_DATABASE_NAME: dsmr
DJANGO_DATABASE_USER: postgres
DJANGO_DATABASE_PASSWORD: homeassistant
DJANGO_DATABASE_HOST: 77b2833f-timescaledb
DJANGO_DATABASE_PORT: '5432'

This is my dB to store data from DSMR to dB.
So my idea is when script is using this information to grab data and then export it to the influxDB …

Ok Remco and @poudenes , i have some ideas to implement this. But until then you need to do manually.
Just to check, only ./manage.py dsmr_influxdb_export_all_readings --to-influx-database dsmrreader-export is needed? Or are there more commands you need?

This line is given on the official page and GitHub to use to export data from DSMR to InfluxDB
I don’t use other…

Installation of this add-on was a breeze and it worked right off the bat. That’s a final goodbye to the DSMR ‘Slimme meter’ integration! :slight_smile:

By using panel_iframe is was able to put it in the sidebar as well, for a more integrated look&feel:

3 Likes

how did you do it? Because the link is not a HTTPS link…
I can only add panels when the link is secure.

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)