TimescaleDB Persistence Service not recognized as Persistence Add-On

Hi,

I’m on Openhab 5.2.1, running on docker. I currently try to switch to timescaleDB persistence and installed the respective persistence Add-On (TimescaleDB - Persistence Services | openHAB). The installation looks good from the logs, as far as I can tell (see attached file).
I tested the connectivity to the database from within the docker container and I can succesfully connect to the database with the configuration I’m also providing in the binding config.
Also the configuration file has been loaded successfully, so I would assume that I’m good to go.

However I’ve recognized 2 things:

  1. The Add-On is not shown in the settings under persistence
  2. It looks like the binding didn’t create the tables in the database and I also don’t see any logs regarding the connection or a failure of it to the database.

So now I wonder if there is something missing for the tables to be created and the items to be persisted to timescaledb and why I don’t see it in the persistence settings. Any ideas on what to check or what’s missing would be very welcome? Maybe from your side @ulbi ?

Didn’t have any luck searching the net or chatting with my AI friends yet :confused: .

thx,

Stone

TimescaleInstall Logs.txt (19.4 KB)

One quick way to tell what persistence add-ons are installed and active would be too go to any Item’s page in MainUI. There’s a table at the bottom now showing which persistence and which strategies apply to that item. Even if that persistence isn’t used for that Item, it appears in that table with ared icon.

If you don’t see it there, the add-on is likely broken or not installed.

Working backwards, you should see an entry under MainUI → Settings for TimescaleDB. The settings you see there should reflect the config you added to the config file. If it doesn’t, your config file wasn’t loaded. If it doesn’t appear at all there’s something wrong or broken with the add-on.

If all that checks out, the add-on is likely fine and the next thing to look at is timescaledb.persist. I’m assuming you use a config file. You can confirm that’s being loaded correctly from MainUI → Persistence. There should be an entry for TimescaleDB and it should reflect the contents of your config file.

Note, since OH 5.0 there is no longer a default strategy. You must define the strategies for each persistence add-on.

Headsup - I am not a java/karaf specialist and used chatgpt to get this running:

It appears that the PID is incorrectly created under persistence.timescaledb when it should be org.openhab.timescaledb

i needed to enter the following into the karaf console and then the bundle went active immediately and created the tables

config:edit org.openhab.timescaledb
config:property-set url jdbc:postgresql://192.168.1.200:5432/openhab
config:property-set user openhab
config:property-set password <your-password-here>
config:update

I would need a comment from addon maintainers to advise if this should be created as an issue but based on the above, I believe so.

(Note in the above you would need to set your host name/iop address, the username (if not openhab) and the password.)

EDIT: The symptom that showed that timescaledb addon was not running was the bundle on the karaf console was “waiting
450 │ Waiting │ 80 │ 5.2.1 │ openHAB Add-ons :: Bundles :: Persistence Service :: TimescaleDB

I’m not a maintainer but that seems like a clear cut issue to me.If the bundle won’t start without this fix it’s clearly a bug.

@rlkoshak @BrettLHolmes thanks for your replies and sry for the late reply from my side, I was a bit busy lately.

@BrettLHolmes, your solution worked fine for me also. I double checked the settings during the process. When configuring the AddOn via the UI, it created the same wrong configuration that you’ve describes and the Bundle was in the wait state.

Setting the required values as you suggested immediately activated it. Did you already open an Issue for that topic? That should definitely be done to find out if that’s actually the proper fix, or if there is something else broken.

No i forgot i will do this tomorrow thanks for the kitb

Brett

EDIT: Done: TimescalDb persistence service PID wrong on installation · Issue #21606 · openhab/openhab-addons · GitHub