DSMR Reader Add-on for Home Assistant

my dsmr entities have all device classes energy

Also the voltage, power, gas and cost sensors? Only my sensors with a unit of measurement of kWh have class energy which is correct

Only my khw sensors have the energy class… All others missing the class

I’ve been using the following sensors from DSMR reader in the HA energy settings:

Low tariff usage: sensor.dsmr_reading_electricity_delivered_1
High tariff usage: sensor.dsmr_reading_electricity_delivered_2

Low tariff return: sensor.dsmr_reading_electricity_returned_1
High tariff return: sensor.dsmr_reading_electricity_returned_2

You need to wait a night so the readings will be corrected.

2021-09-08: 0.5.1 Update to DSMR-reader v4.16.3

I upgraded to DSMR-reader v4.16.3 (I think) a week ago. I usually just look at the dashboard, and everything seemed OK.

Yesterday I went to look at the Live Graphs page, and saw that no historical data was available.

It seems that no historical data has been recorded for a week:

I see nothing in Github about this, so perhaps it is unique to my installation. Is it a problem with the Timescale DB? The log says it is running, but there are warning in it. Does this give some help about what I need to do? Thanks.

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 
-----------------------------------------------------------
 Add-on: TimescaleDB
 An open-source database built on PostgreSQL for analyzing time-series data with the power and convenience of SQL
-----------------------------------------------------------
 Add-on version: 1.1.6
 You are running the latest version of this add-on.
parse error: Expected string key before ':' at line 1, column 4
[16:38:08] ERROR: Unknown HTTP error occured
 System:   (aarch64 / raspberrypi4-64)
 Home Assistant Core: 2021.9.6
 Home Assistant Supervisor: 2021.09.0
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] init.sh: executing... 
[16:38:10] INFO: done
[16:38:10] INFO: Tuning resources..
Using postgresql.conf at this path:
/data/postgres/postgresql.conf
Writing backup to:
/tmp/timescaledb_tune.backup202109201638
Recommendations based on 512.00 MB of available memory and 4 CPUs for PostgreSQL 12
success: all settings tuned, no changes needed
Saving changes to: /data/postgres/postgresql.conf
[16:38:10] INFO: done
[16:38:10] INFO: Applying max connections..
[16:38:11] INFO: done
[cont-init.d] init.sh: exited 0.
[cont-init.d] user.sh: executing... 
[cont-init.d] user.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[16:38:11] INFO: Starting PostgreSQL..
[16:38:11] INFO: done
2021-09-20 14:38:11.677 UTC [408] LOG:  starting PostgreSQL 12.4 on aarch64-alpine-linux-musl, compiled by gcc (Alpine 9.3.0) 9.3.0, 64-bit
2021-09-20 14:38:11.677 UTC [408] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2021-09-20 14:38:11.678 UTC [408] LOG:  listening on IPv6 address "::", port 5432
2021-09-20 14:38:11.686 UTC [408] LOG:  listening on Unix socket "/run/postgresql/.s.PGSQL.5432"
2021-09-20 14:38:11.693 UTC [408] LOG:  listening on Unix socket "/tmp/.s.PGSQL.5432"
2021-09-20 14:38:11.742 UTC [414] LOG:  database system was shut down at 2021-09-20 14:38:00 UTC
2021-09-20 14:38:11.755 UTC [408] LOG:  database system is ready to accept connections
2021-09-20 14:38:11.761 UTC [420] LOG:  TimescaleDB background worker launcher connected to shared catalogs
[16:38:12] INFO: Enabling PgAgent Extension..
NOTICE:  extension "pgagent" already exists, skipping
CREATE EXTENSION
[16:38:12] INFO: Starting PgAgent..
[16:38:12] INFO: Create database if not exist: 'homeassistant'
[16:38:12] INFO: Create database if not exist: 'dsmrreader'
[16:38:12] INFO: done
[16:38:13] INFO: Enabling Timescale Extension for database: 'homeassistant'
NOTICE:  extension "timescaledb" already exists, skipping
CREATE EXTENSION
[16:38:13] INFO: done
[16:38:13] NOTICE: TimescaleDb is running!
2021-09-21 13:08:31.812 UTC [27179] LOG:  the "timescaledb" extension is not up-to-date
2021-09-21 13:08:31.812 UTC [27179] HINT:  The most up-to-date version is 2.4.1, the installed version is 1.7.4
2021-09-21 13:08:32.014 UTC [27178] LOG:  the "timescaledb" extension is not up-to-date
2021-09-21 13:08:32.014 UTC [27178] HINT:  The most up-to-date version is 2.4.1, the installed version is 1.7.4
2021-09-21 13:08:32.015 UTC [27180] LOG:  the "timescaledb" extension is not up-to-date
2021-09-21 13:08:32.015 UTC [27180] HINT:  The most up-to-date version is 2.4.1, the installed version is 1.7.4

This is my HA setup:

System Health

version core-2021.9.6
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.9.6
os_name Linux
os_version 5.10.17-v8
arch aarch64
timezone Europe/Amsterdam
Home Assistant Community Store
GitHub API ok
Github API Calls Remaining 5000
Installed Version 1.15.2
Stage running
Available Repositories 942
Installed Repositories 11
Home Assistant Cloud
logged_in true
subscription_expiration 19 October 2021, 2:00
relayer_connected true
remote_enabled false
remote_connected false
alexa_enabled true
google_enabled true
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 6.3
update_channel stable
supervisor_version supervisor-2021.09.0
docker_version 20.10.7
disk_total 109.3 GB
disk_used 20.5 GB
healthy true
supported true
board rpi4-64
supervisor_api ok
version_api ok
installed_addons File editor (5.3.3), Samba share (9.5.1), InfluxDB (4.2.1), Terminal & SSH (9.1.3), Grafana (7.2.0), Z-Wave JS to MQTT (0.24.1), TimescaleDB (1.1.6), DSMR Reader (0.5.1)
Lovelace
dashboards 2
resources 8
views 4
mode storage

Actually, now that I’ve looked at the Dashboard again, I see that it too is stuck on a week-old reading - so the DSMR reader system is completely broken for me.

I notice this in the Supervisor log:

21-09-22 14:38:39 WARNING (MainThread) [supervisor.api.middleware.security] 77b2833f_timescaledb missing API permission for /host/info
21-09-22 14:38:39 ERROR (MainThread) [supervisor.api.middleware.security] Invalid token for access /host/info

Is this a clue?

I think the fastest way is to reinstall the add-ons and restore the database backup

It may have been a glitch that occurred the last time I rebooted the RPi4. Even though the P1 data was arriving at the USB port (I could see the red LED on the dongle flashing once per second), no data was getting into the add-on.

I rebooted the RPi again today, and this time data is getting through. I’ve just lost a week’s worth of data, it could have been worse…

1 Like

2021-10-04: 0.6.0 Update to DSMR-reader v4.18

I still only see 0.5.1 in Home Assistant, no update available to 0.6.0. Is there a way to force the 0.6.0 update?

Nevermind, the repository was disappeared from the add-on store. Readding it solved it.

1 Like

2021-10-27: 0.7.0 Update to DSMR-reader v4.19

1 Like

Sorry being a noob. But how to upgrade to a newer version of DSMR-reader? The RPi doesn’t let me SSH into Home Assistant or DSMR-reader. Can anyone help me. The “how to update” steps doesn’t help me out.

You just need to update the dsmr reader add-on in the supervisor dashboard

My dsmr-reader version is 0.7.0. I update dsmr-reader via the supervisor dashboard, every time a update is available. Above messages keep persist. These messages are visible in different browsers (no caching issue).

I just find out that i have to set the message as read :joy:

Thanks, helped me a lot!

I am getting 'PermissionError: [Errno 13] Permission denied: ‘/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A13LNT9A-if00-port0’ after updating Home Assistant OS to version 7.1.

I have tried to configure both the original device path (in my case: /dev/ttyUSB2) and the device path by ID, as listed in the log.

@sanderdw:

“Thanks” to the auto update function in HA, my dsmr addon updated to version 0.7.1. And i see at the change logs (don’t update). Now the plugin is “broken”

Is there a solution to downgrade to version 0.7.0 from ssh with commands? Like downgrade HA with: ‘ha update —version 2021.12’ for example?

See my post :wink:. It’s because you are probably are running dsmr reader version 0.7.1

1 Like