openHAB3: How to define persistence

Currently i am sneaking into openHAB 3 and KUDOs to all the contributors. Many new conecpts and some well known old things.

I installed a persitence service and configured the parameters to connect to the appropriate database. The question is now: How should i define wich item values to persist. in opneHAB2 this task is file based. Is it in opneHAB3 still file based? and will that change in the future?

Thank for your feedback

For me it is the same question.
I can not find any information in the forum.
By now there does not seem to be a way in the new UI.

You need to define persistance like you do in OH 2. Basically you need to create a persist file in the appropriate folder.

The ui does not offer any editor on this

1 Like

Thanks,
and then I can put the group into each item in the UI?

Dows anyone know the standard persistence settings, when I havent set a persisence file?

Is it every change only?

Same issue: got the jdbc.persist file, but how can I add item1(created in UI) to groupA (groups.items file), so it inherits the persistence group strategy?

Thanks.

That is no so complicated. Typically you define a group that id referenced in your *.persist file. Than you have to create the goup in the ui.
I use a group called FG_TimeLine. Then you could edit the group and add members to it an all these items are persited.

Here is my Influx.persist, but it should be similar to a jdbc one

Strategies {
    
    everyMinute : "0 * * * * ?"
    everyHour   : "0 0 * * * ?"
    everyDay    : "0 0 0 * * ?"

    default = everyUpdate

}

Items {

    FG_TimelineData* : strategy = everyUpdate

}

I the ui there is the group. You will find it in items

With the chage Button at the bottom you could add items to the group

Thanks!

I would like to bring this topic up again - especially with an eye on the default persistence service rrd4j.

Based on the above and also some sentences over here: [wiki] Building Pages in the OH3 UI: documentation draft (3/3), the persistence service needs to be configured in a file within the persistence directory.
However I haven’t configured regarding for persistence and I can see some data when selecting the analyze button. Also I recognized the states of some items are restored after a reboot of openhab (this applies just to switch items, but not to text items.)

Now there are two questions coming up.

  1. Is there a default configuration for the default rrd4j persistence service?
  2. If so: Which items (datatypes of items) are stored per default?

I’m currently running OH3 M5.

I can’t answer definitively but I think based on what I’ve seen:

  1. yes, in fact there appears to be a default for all the persistence engines. It’s not clear what the default is but I suspect it’s at a minimum everyChange on all supported Items.

  2. Probably all number type Items, Switches, and Contacts.

1 Like

Hi,

When I created an influxdb persistence configuration I lost the default persistence so no longer get any data in the charts in the interface.

Has anyone else had this issue?

Is it just a matter of creating a configuration for RRD4 and adding items normally in the default to a group with the correct strategy.

Found Solution:

I needed to configure the system default persistence found in system services under persistence after adding a new persistence provider.

setting back to RRD4 made the charts work again but I suppose any persistence could power the charts. Can anyone confirm?

I can confirm that I have the same experience. Configuring the influx persistence removed the ‘default’ RRDJ4 value.
setting it back to default did the trick

hmn, the strange thing with me is I haven’t configured any items yet,
but some already are in the influx db, like they were created when the default was set to influx, but they keep sending data after setting it back to rrd4j too

Setting the default persistence does not change how the data get saved to the databases. The default is which database gets used when you don’t explicitly tell it which database to use in a query and it’s the database that gets used to generate charts in MainUI. But Items will be saved to all configured databases according to the defined persistence strategies.

1 Like