Logic check: Does using multiple wildcard exclusions in .persist file work as intended?

Hi everyone,

I am currently refining my persistence configuration and I’m a bit unsure about how openHAB handles multiple lines with wildcards and exclusions (!).

Here is a snippet of my current persistence.persist file:

Strategies {
   everyMinute		: "0 * * * * ?"
   everyFiveMinutes	: "0 */5 * * * ?"
   everyThirtyMinutes	: "0 */30 * * * ?"
   everyHour    	: "0 0 * * * ?"
   everySixHours	: "0 0 */6 * * ?"
   everyTwelveHours	: "0 0 */12 * * ?"
   everyDay     	: "0 0 0 * * ?"
}

Items {
*, !Group_House_NotPersistedEveryChange*: strategy = everyChange, restoreOnStartup
*, !Group_House_NotPersistedEveryMinute*: strategy = everyMinute, restoreOnStartup
*, !Group_House_NotPersistedEveryFiveMinute*: strategy = everyFiveMinutes, restoreOnStartup
*, !Group_House_NotPersistedEveryThirtyMinute*: strategy = everyThirtyMinutes, restoreOnStartup
*, !Group_House_NotPersistedEveryHour*: strategy = everyHour, restoreOnStartup
*, !Group_House_NotPersistedEverySixHour*: strategy = everySixHours, restoreOnStartup
*, !Group_House_NotPersistedEveryTwelveHour*: strategy = everyTwelveHours, restoreOnStartup
*, !Group_House_NotPersistedEveryDay*: strategy = everyDay, restoreOnStartup
 }

My Question: If an Item is a member of ALL these “NotPersisted” groups (e.g., Group_House_NotPersistedEveryChange AND Group_House_NotPersistedEveryMinute, etc.), will it actually be excluded from persistence entirely?

My understanding is that the lines are additive. So, if an Item is excluded in the first line but not in the second, it will still be persisted by the second line’s strategy. Is this correct?

If so, is there a way to create a “Global Blacklist” without using a whitelist approach (Group-based persistence), or am I better off switching to a positive “Opt-In” strategy for all my Items?

Looking forward to your insights!

This is correct.

You could create another blacklist group you repeat on every line. You can have multiple group exclusions on one line.

This I didn’t get…can you explain?

If you want an item to be persisted every 5 minutes, with this setup you would need to add it to all the other exclusion groups. May I ask why you don’t go the other way around and have e.g.,

Group_House_PersistedEveryFiveMinute*: strategy = everyFiveMinutes, restoreOnStartup

and add Items to that group as needed? That’s how I manage persistence at least, so I don’t persist a lot of unnecessary Items.

Edit: It will also be very cumbersome if you want to add a new strategy, then you will need to remember to add all of your items to an additional group.

Like this:

*, !Group_House_NotPersisted*, !Group_House_NotPersistedEveryMinute*: strategy = everyMinute, restoreOnStartup

You should be able to combine 2 exclusion groups on one line.