DSMR Reader Add-on for Home Assistant

I do have 1 more question reagrding this subject:
In order to solve this problem, I read another post that said to add these 2 init-command to TimescaleDB:

grep -v "null" /data/postgres/pg_hba.conf > /tmp/pg_hba_clean.conf && mv /tmp/pg_hba_clean.conf /data/postgres/pg_hba.conf
echo "host all all ::/0 scram-sha-256" >> /data/postgres/pg_hba.conf

Which I did, but this did not solve it. I do have 2 separate HA-installations and I applied your solution (477) to both of them and both worked fine after that. Now I noticed that in 1 of the installations (installation 1), I still had those 2 init-commands and not in the other installation (installation 2). So I decided to remove those init-commands from TimescaleDB in installation 1. I restarted TimescaleDB and then I got the problem back. But, adding the 2 init-commands does not solve it. For now, the only way on installation 1 is to set 'trust' in the pg_hba.conf file

Adrie de Regt

I find it also very akeward that there are some different problems. Some people can update, some need to use the command in timescale, and people who need my edit.

And if you try again with my ssh sollution on your instance 1. Because it could be possible that the command line did changed something in the file.

Alfagek

I find it also very akeward that there are some different problems. Some people can update, some need to use the command in timescale, and people who need my edit.

And if you try again with my ssh sollution on your instance 1. Because it could be possible that the command line did changed something in the file.

Been looking into this tonight. I added this line to the pg_hba.conf file:
host all all 127.0.0.1/32 trust
along with the line you suggested:
host all all ::/0 trust

Then I followed your procedure and then changing back to scram-sha-256 and now it is working
Might have to do with ipv4 vs ipv6?

Adrie de Regt

the line you did add, is the internal ip adres to communnicate with postgress.

and indeed the ::0 is for IP6.

But the most importend thing is that the rules are back to "scram" for safety.

So let's back to ontopic, because this upper stuff is "timescale" related.

Can anyone help me pls, updated to last version of dsmrreader 2.0 and its not starting:
error:
django.db.utils.OperationalError: connection to server at "77b2833f-timescaledb" (fd0c:ac1e:2100::9), port 5432 failed: FATAL: no pg_hba.conf entry for host "fd0c:ac1e:2100::e", user "postgres", database "dsmrreader", no encryption

[ FAIL ] init-dsmr-and-db | Database migration failed
s6-rc: warning: unable to start service init-dsmr-and-db: command exited 1

Tried rebooting dsmrreader and timescale addon but no luck
I tried the method described above, with the 3 steps but at step 1 it already doesnt go good, cause i dont see no line like 4. Temporarily change the method from scram-sha-256 to trust .

Nobody? Still stuck here

Okay it took me ages but in the end, I ran the following command as an option in TimescaleDB:

init_commands:
  - sed -i 's/scram-sha-256/md5/g' /data/postgres/pg_hba.conf

That fixed it for me, I also tried the suggested options, so it could be a mix and match.

2026-05-26: DSMR Reader Add-on v2.1.0, DSMR-reader v6.1.0
Changelog here

Awesome work @sanderdw. Working great

1 Like

I am running HASSOS. When I connect with SSH and type the docker command as in step 1 above ( 'docker exec -it addon_77b2833f_timescaledb bash') then I get "-bash: docker: command not found".
Any suggestions?

You need to use the "Advanced SSH & Web Terminal" app. Not using the normal SSH function.
And it sounds that you are using normal SSH.