DSMR Reader Add-on for Home Assistant

Hello, I have got a problem. No values show up in DSMR Reader but I got an error message in Timescale log. Do not know what to do? :slight_smile:

2021-05-21 14:23:41.245 UTC [756] ERROR: null value in column “electricity_delivered_1” violates not-null constraint
2021-05-21 14:23:41.245 UTC [756] DETAIL: Failing row contains (435, 2021-05-21 13:23:40+00, null, null, 0.000, 0.000, 0.229, 0.000, null, null, f, 0.017, 0.025, 0.186, 0.000, 0.000, 0.000, 232.9, 230.4, 232.8, 0, 0, 0).
2021-05-21 14:23:41.245 UTC [756] STATEMENT: INSERT INTO “dsmr_datalogger_dsmrreading” (“processed”, “timestamp”, “electricity_delivered_1”, “electricity_returned_1”, “electricity_delivered_2”, “electricity_returned_2”, “electricity_currently_delivered”, “electricity_currently_returned”, “phase_currently_delivered_l1”, “phase_currently_delivered_l2”, “phase_currently_delivered_l3”, “extra_device_timestamp”, “extra_device_delivered”, “phase_currently_returned_l1”, “phase_currently_returned_l2”, “phase_currently_returned_l3”, “phase_voltage_l1”, “phase_voltage_l2”, “phase_voltage_l3”, “phase_power_current_l1”, “phase_power_current_l2”, “phase_power_current_l3”) VALUES (false, ‘2021-05-21T13:23:40+00:00’::timestamptz, NULL, NULL, ‘0.000’, ‘0.000’, ‘0.229’, ‘0.000’, ‘0.017’, ‘0.025’, ‘0.186’, NULL, NULL, ‘0.000’, ‘0.000’, ‘0.000’, ‘232.9’, ‘230.4’, ‘232.8’, 0, 0, 0) RETURNING “dsmr_datalogger_dsmrreading”.“id”

Anybody else this problem? Unfortunately i can’t check this right now.

As this is a specific application error and therefore it’s quite likely not related to the addon packaging of DSMR i would suggest to search/post you issue here Issues · dsmrreader/dsmr-reader · GitHub.

Personally i have never seen this issue, maybe somebody else?

I turned on the Inspector in Edge, and got these messages from the DSMR pages:

DevTools failed to load SourceMap: Could not load content for http://192.168.178.148:7777/static/dsmr_frontend/js/moment-with-locales.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
export:1 
Download is disallowed. The frame initiating or instantiating the download is sandboxed, but the flag ‘allow-downloads’ is not set. See https://www.chromestatus.com/feature/5706745674465280 for more details.
Resource interpreted as Document but transferred with MIME type text/csv: "http://192.168.178.148:7777/export/csv".

Perhaps this helps?

Edit: Chrome appears to now block all downloads from a sandboxed environment:

https://www.chromestatus.com/feature/5706745674465280

So are you using DSMR Reader in an iframe? What happens if you go to http://192.168.178.148:7777 directly in your browser?

Indeed, that’s the issue. I simply have the DSMR as another page in my Home Assistant pages. It’s more convenient that way.

If I open DSMR in its own web page, then I can download the file. I’ll just have to remember that for future reference. Glad we’ve solved the mystery…

1 Like

I thought it might be the meter bud I do get an output using putty. Maybe it is just me that is not that clever. :slight_smile:

Good to see Dennis helped you out :+1:

What is the best method to install?
I couldn’t install the pgAdmin4 database.

Really depends on your set-up. But to get started easily you can check the addon instructions here, like mentioned in the start post.

HA is installed on A RPI 3b.

Point 2 is unclear for me.

Add the “dsmrreader” db as an exta database entry in the Configuration tab.

I don’t understand this point.
Were can I find the it and can I add it?

You can do that in the configuration tab of the timescaleDB addon.

Great add-on @sanderdw!

Unfortunately, I’m having an issue with it, hopefully someone can point me in the right direction.
After setting everything up according to instructions, I’m getting readable telegrams only ~3 times per hour.


According to the rejected telegrams sensor from the DSMR reader integration, about 15000 telegrams are being rejected per day.

The DSMR add-on logs also show that the datalogger and backend services restart quite often, even though I’m not touching anything.

2021-07-20 03:19:37,137 INFO exited: dsmr_datalogger (exit status 0; expected)
2021-07-20 03:19:38,154 INFO spawned: 'dsmr_datalogger' with pid 2231
2021-07-20 03:19:39,160 INFO success: dsmr_datalogger entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-07-20 05:15:54,042 INFO exited: dsmr_datalogger (exit status 0; expected)
2021-07-20 05:15:55,058 INFO spawned: 'dsmr_datalogger' with pid 2233
2021-07-20 05:15:56,066 INFO success: dsmr_datalogger entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-07-20 07:35:52,530 INFO exited: dsmr_backend (exit status 0; expected)
2021-07-20 07:35:53,545 INFO spawned: 'dsmr_backend' with pid 2234
2021-07-20 07:35:54,551 INFO success: dsmr_backend entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-07-20 07:57:21,916 INFO exited: dsmr_backend (exit status 0; expected)
2021-07-20 07:57:22,930 INFO spawned: 'dsmr_backend' with pid 2235
2021-07-20 07:57:23,935 INFO success: dsmr_backend entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-07-20 08:12:13,779 INFO exited: dsmr_datalogger (exit status 0; expected)
2021-07-20 08:12:14,792 INFO spawned: 'dsmr_datalogger' with pid 2236
2021-07-20 08:12:15,796 INFO success: dsmr_datalogger entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-07-20 08:17:11,268 INFO exited: dsmr_datalogger (exit status 0; expected)
2021-07-20 08:17:12,282 INFO spawned: 'dsmr_datalogger' with pid 2237
2021-07-20 08:17:13,287 INFO success: dsmr_datalogger entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-07-20 09:11:16,835 INFO exited: dsmr_datalogger (exit status 0; expected)
2021-07-20 09:11:17,853 INFO spawned: 'dsmr_datalogger' with pid 2238
2021-07-20 09:11:18,857 INFO success: dsmr_datalogger entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-07-20 09:11:51,114 INFO exited: dsmr_datalogger (exit status 0; expected)
2021-07-20 09:11:52,130 INFO spawned: 'dsmr_datalogger' with pid 2239
2021-07-20 09:11:53,137 INFO success: dsmr_datalogger entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-07-20 09:19:55,327 INFO exited: dsmr_backend (exit status 0; expected)
2021-07-20 09:19:56,343 INFO spawned: 'dsmr_backend' with pid 2240
2021-07-20 09:19:57,349 INFO success: dsmr_backend entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-07-20 09:54:55,996 INFO exited: dsmr_backend (exit status 0; expected)
2021-07-20 09:54:57,010 INFO spawned: 'dsmr_backend' with pid 2241
2021-07-20 09:54:58,017 INFO success: dsmr_backend entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-07-20 10:12:14,686 INFO exited: dsmr_backend (exit status 0; expected)
2021-07-20 10:12:15,700 INFO spawned: 'dsmr_backend' with pid 2242
2021-07-20 10:12:16,705 INFO success: dsmr_backend entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-07-20 10:16:53,423 INFO exited: dsmr_datalogger (exit status 0; expected)
2021-07-20 10:16:54,438 INFO spawned: 'dsmr_datalogger' with pid 2243
2021-07-20 10:16:55,445 INFO success: dsmr_datalogger entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

I’ve tried attaching the P1 cable to a different USB port on the Raspberry Pi, nothing has changed.

Could that be a faulty cable, configuration or something else? Is there any way to enable any sort of debugging to pinpoint the issue? Many thanks in advance for support.

Hi Alex, yes this could be a lot of things and i don’t think it has to do with my specific Home Assistant implementation. Can you get an other cable to test? You can also search here: Issues · dsmrreader/dsmr-reader · GitHub or create an issue there mentioning your specific smart meter manufacturer.

Hi theres a new version from HA which has energy management options

I’m trying to set this up, but are having troubles
To add consumption:
i need to chose “verbruikte energy (kwh)”: which entity is that? is it sensor.dsmr_day_consumption_electric? (Without gas?)

Then it asks me to select the costs of energyI need to select which entity has total costs, but i cant select it
When i chose use entity with current price, i’m not sure which one to chose

At the bottom of the lists, it says “why isnt my entity shown”, if u click on it, it says i need to report it here…
so… :slight_smile:

Btw theres another new version of dsmr released (not to push anything, just letting you know)

According to this commit support should be added already. Note that this specific integration has nothing to do with this addon, so would be better to create an issue according to these instructions.

Anyone else problems with this? Can’t check it out myself, I’m on holiday.

To me it is also not clear how to set this up with different tariffs during the day. If I use total energy usage in KWh I see a diagram and sensor with negative values which I do not understand. It is not in line with the actual value of the daily total energy sensor that I selected in configuration.

I also miss gas usage as this is the most expensive energy component in my house.

It feels that this is just a very early release of Energy module and far from complete to make it usable for me. And to be honest I like the front-end that DSMR Reader already is offering.

I am using sensor.dsmr_day_consumption_electricity_returned_merged and sensor.dsmr_day_consumption_electricity_merged which works. However there are some differences which I cant explain.

I created a tempalte sensor which states the current price, depending the hour of the day, but that does not work.

For now the energy dashboard is only for elektricity so you cant add gas usage. I even noticed that there is no device class for volumes. A proper device class is needed to get the statistics and energy dashboard work.

Yeah i am using the same entities:
sensor.dsmr_day_consumption_electricity_returned_merged and sensor.dsmr_day_consumption_electricity_merged

For costs i am using
sensor.dsmr_day_consumption_electricity_cost_merged and

There are indeed some differences, I dunno why
I hope gas is coming too indeed.
Even water.

What do you mean with device class for volumes?

A sensor needs a device class to get the statistics work.