How to .persist things in OH2

Hi,
first of OH2 :clap:

I just changed my persistence to have more control over which items are persisted.

Strategies {
everyMinute : "0 * * * * ?"
everyDay    : "0 0 0 * * ?"
default = everyChange
}

Items {
    pCha* : strategy = everyChange, everyDay, restoreOnStartup	 //Group pCha for items with persistence every Change
    pMin* : strategy = everyMinute, restoreOnStartup	//Group pMin for items every minute
//Group pNed for items which shouldnt be persisted
}

Now I discovered, that Im not able or more correct I dont know how to use the persistence rules on things!

For example the systembinding generates things like "systeminfo_…cpu_load"
I use this for creating my item “Numer CPULoad (Group) {channel=…}” --> doesnt need to be persited
But now the “thing” will be persited and I dont know how to change that.

Hello,
sorry but your problem or question didn’t become clear to me…

I can define which items are persisted (.persit + .items)
But I cannot/know not how to define how the things are handled (PaperUI)

Maybe another example
Item:
Number Sun_Elevation "Sun Elevation [%.2f]" <sun> (Weather, pNed) {channel="astro:sun:local:position#elevation"}

Item is in Group “pNed” --> will not be persisted
BUT there is a thing “astro_sun_local_position_elevation” which will be persisted.

Maybe I can change default persistence to “no” in the .persist file but I havnt found a description anywhere if this is possible.
Or should I name my items the same way the things are named?

One aspect upfront, “astro_sun_local_position_elevation” is not a thing, it’s an item in your system automatically linked when you imported the astro thing through PaperUI.

Answering your actual question: Only items and/or groups mentioned in your persist file will get persisted. Thereby, looking at your file above, the groups Ned will not be persisted to begin with.

However maybe I understood you or your setup wrong. This might be helpful: Default Persistence Service

ok missunderstanding on my part - maybe I got the autogenerated items into my database when i was playing with the .persist-file

To sum up:
Only items or groups defined in the .persist file will get persisted.
The default strategy is only used for items defined with default

Is there any possibility to prevent the generation of the autogenerated items?
thx a lot

Splendid.

Yes there is, in the newer builds. Since around four weeks (I think including beta 4) autogeneration of items can be disabled through PaperUI settings.

This one:

thx for the quick answer