DSMR Reader Add-on for Home Assistant

Trying to get this to work, ending up with this?

Solved by changing host.

Is it possible to import. csv historical data?

You van check the docs about import and export of data: https://dsmr-reader.readthedocs.io

2022-03-02: DSMR Reader Add-on v1.1.0, check changelog before upgrading
Changelog here

I’m running DSMR reader a long time and now i’m getting some errors in the supervisor log.

22-03-10 12:40:41 WARNING (MainThread) [supervisor.addons.options] Option 'DATALOGGER_MODE' does not exist in the schema for DSMR Reader (0826754b_dsmr_reader)
22-03-10 12:40:41 WARNING (MainThread) [supervisor.addons.options] Option 'DATALOGGER_SERIAL_PORT' does not exist in the schema for DSMR Reader (0826754b_dsmr_reader)
22-03-10 12:40:41 WARNING (MainThread) [supervisor.addons.options] Option 'DATALOGGER_INPUT_METHOD' does not exist in the schema for DSMR Reader (0826754b_dsmr_reader)
22-03-10 12:40:41 WARNING (MainThread) [supervisor.addons.options] Option 'DATALOGGER_SERIAL_BAUDRATE' does not exist in the schema for DSMR Reader (0826754b_dsmr_reader)
22-03-10 12:40:41 WARNING (MainThread) [supervisor.addons.options] Option 'DATALOGGER_NETWORK_HOST' does not exist in the schema for DSMR Reader (0826754b_dsmr_reader)
22-03-10 12:40:41 WARNING (MainThread) [supervisor.addons.options] Option 'DATALOGGER_NETWORK_PORT' does not exist in the schema for DSMR Reader (0826754b_dsmr_reader)
22-03-10 12:40:41 WARNING (MainThread) [supervisor.addons.options] Option 'DATALOGGER_SLEEP' does not exist in the schema for DSMR Reader (0826754b_dsmr_reader)

After upgrading do you mean? After the update go to the addon “Configuration” tab and next to “Options” choose “Reset to defaults” (Not the one below “Network”) and apply your settings again.

1 Like

Thanks, i have to rtfm better :wink:

Hi all,

Not being a true expert, I did manage to get this add-on to work on HassOS running on a small NUC. It has been working perfectly for weeks.

As of 2:30 am last night I get errors and the add-on has 90+ CPU usage.

To my knowledge, I didn’t change anything. Restarting HA, restarting the NUC, nothing helps.

I do see the TimescaleDB is at version 2.0.0 and I can’t recall seeing that before, but I’m not sure. This TimescaleDB add-on (and DSMR as well) was set to auto-update, so maybe something happened there.

Does anyone have any idea how to solve this?

From the add-on log :

django.db.utils.OperationalError: FATAL: password authentication failed for user "postgres"

From the DSMR web page (7777) :

Server Error

Sorry, something unexpected happened.

Exception:

OperationalError: FATAL: password authentication failed for user “postgres”

Traceback:

Yes i think TimescaleDB recently updated to 2.0.0 (nothing in the changelog though). I didn’t test with that version yet.

My advice would be to reconfigure that addon and make sure the user/password combination is set up correctly again.

Thx, and indeed, I see in the TimescaleDB add-on log:

2022-03-31 06:36:06.821 UTC [1357] DETAIL: User “postgres” has no password assigned.

It is just I have no idea how to set a password.

I do see in the TimescaleDB readme:

Securiy Notice!

The default username is postgres with password homeassistant. Make sure you change this immediately after activating the add-on:

ALTER USER user_name WITH PASSWORD 'strongpassword';

I cannot recall ever using this, so I must have been on the default password, which now is lost apparently.

Where and how do I need to issues this ALTER USER command?

Sorry for asking, but as I mentioned, I was happy I go this working but I’m no true expert :slight_smile:

I ended up reinstalling TimescaleDB add-on and reconfigure DSMR reader add-on, seems to work again, just lost all my data :slight_smile:

Here the same error. I’ve restored the old 1.1.6 Add-On. Now everything is fine again.
It seems the password for the postgres user is lost or changed with installing the 2.0.0. Add-On!
I’ve created a issue.

1 Like

Thanks to a very easy procedure on github (found with the link above), it’s working again.

Don’t forget to disable auto-update for this add-on :slight_smile:

dhover commented 9 minutes ago

Restoring to 1.1.6 is enough.
Restore is done as follows:
Configuration, Add-ons, Backups & Supervisor, Tab Backups, Click the backup “addon_77b2833f_timescaledb_1.1.6” to restore and press the RESTORE button. Wait a short of time.

I deleted everything. Installed the latest TimescaleDB(2.0.0) and the DSMR reader addon.

Now having the issue that I cannot make a backup anymore.

Log shows:

pg_dump: error: server version: 14.2; pg_dump version: 13.6
pg_dump: error: aborting because of server version mismatch
2022-03-31 16:25:28,395 ERROR    schedule     execute_scheduled_processes      37 | (AttributeError) dsmr_backup.services.backup.run errored: 'NoneType' object has no attribute 'read'
127.0.0.1 - - [31/Mar/2022:16:25:28 +0200] "GET /about HTTP/1.1" 200 15456 "-" "curl/7.79.1" "-"
2022-03-31 16:25:28,522 CRITICAL backup       on_backup_failed                205 |  - Unexpected exit code (1) for backup: b'pg_dump: error: server version: 14.2; pg_dump version: 13.6\npg_dump: error: aborting because of server version mismatch\n'
2022-03-31 16:25:28,533 ERROR    schedule     execute_scheduled_processes      37 | (OSError) dsmr_backup.services.email.run errored: b'pg_dump: error: server version: 14.2; pg_dump version: 13.6\npg_dump: error: aborting because of server version mismatch\n'

Restoring the Timescaledb backup didn’t work for me, it gave other errors. And the DSMR reader wouldn’t start anymore

I think you shouldn’t use version 2.0.0 of the Timescaledb AddOn because something is wrong and also the DSMR Reader AddOn is not tested with version 2.0.0 of the Timescaledb AddOn.

I tried to go back to 1.1.6. But it looks like there is something corrupted. If I go back, the timescale addon crashes and because of that the dsmrreader won’t start. Even tried restoring days back…same issue with the timescaledb addon, it keeps crashing.

I didn’t try restoring the 1.1.6 backup but I stopped DSMR, deinstalled TimescaleDB, installed TimescaleDB v2.0.0, started DSMR again, lost (of course) all my data and had to reconfigure DSMR. All is working now, but also had these backup errors in DSMR, so disabled backup. It seems stable right now, hope DSMR will be fixed to allow backups…

1 Like

Indeed, runs stable. Also hoping the backup will be fixed in the future

Yes, backup for postgres 14 servers (such as TimescaleDB v2.0.0) will be fixed in the next release.

I’m back on TimescaleDB 1.1.6 now as I wrote earlier.
What are the safe steps for upgrading to Timescale 2.x.x ?

1° wait until Timescale 2.0.1 is out (normally I never install a .0 but I forgot to uncheck autoupdate)
2° wait until the DSMR Reader Add-on is updated
make changes before updating, but what changes do I have to make ?

For support regarding upgrading TimescaleDB and the databases you can go to that addon specific thread: Home Assistant Add-on: PostgreSQL + TimescaleDB - #95 by edouardkleinhans

So if you have problems upgrading would suggest to stay at the old TimescaleDB version for now.

The next update for this addon will only make sure Postgres 14 versions are supported.

Edit:
2022-04-02: DSMR Reader Add-on v1.1.1, Support for PostgreSQL 14
Changelog here

1 Like