Excluding a certain items from being persisted into database

Say i have 1000 items and I want 900 of them to be persisted. What’s the right thing I should be putting into my persist configuration file? Do I have to list everyone of them? I’m using OH2.

Thanks

You can create a group (let’s say it’s called persistgroup) and then define every item you want to be persisted as a member of this group.

And in your .persist file you simple have to define only this group as a single “item” to be persisted. persistgroup* would be the right expression then.

Thanks Stefan, i will definitely give it a try.

Another related question is: What does “default” strategy mean in the persist configuration file? I was playing around with the configuration file last night, and noticed if I don’t list an item in my .persist file, it will not be persisted at all. Doesn’t this sound contradictory to the “default”?

From the docs:
http://docs.openhab.org/configuration/persistence.html

if no strategy is specified for an item entry below, the default list will be used

So if you just list an Item without specifying a strategy the default gets used.

To get the “default” behavior you are after you use *.

    • this line should apply to all items in the system.