I have some items, which I read and in the rule I’m doing a recalculation and working with recalculated value stored in other item. So for me doesn’t make sane to store a data before recalculation. Is it possible somehow disable store a data before recalcultion or store only data for short time period like one day ?
Make a group called “persistence”, do all items you like to get stored into this group and make a persistence file … I asked that several times it’s not possible to exclude items in the persistence config…maybe a feature request but don’t know how the programming is behind…
but how to set a persistence only for this group isn’t clear for me
also I don’t know, if it’s possible make a item list more clear. Mean that now I can see a mixture of all. Groups, items… Is it possible see only groups and items when I will open a group ?
I read a Persistence guide and for me as noob is very hard to uderstand what and where define, to exclude some items from persistence.
I found, that I must edit a rrd4j.persist file. Create a strategy ? But what is strategy to disable a persistence ?
All the members of group gPersistRrd4j will be persisted when they change. The other items will not be persisted. The everyDay strategy is probably not needed here.
Yes, that is a quartz cron expression (with seconds). Look here if you want to generate or evaluate it.
If you want to use the strategy, then you have to add it in the Items section. I would also advise to use the restoreOnStartup strategy. The result of using the two extra strategies would be:
Filters are optional. All configurations for rrd4j must include an everyMinute strategy. You cannot use everyDay with rrd4j by itself and doing so with an everMinute strategy is pointless.
To disable persistence for a single Item is unfortunately not possible. You either configure it for all Items or you have to choose each Item you want to be persisted, excluding the Items you don’t want to persist.
@alda1’s suggestion to use Groups is one way to do this without editing the persistence config but now that persistence is possible through the UI, it makes some sense to not spread the persistence config all over your Items and instead centralize the config here.
Anyway to configure persistence to exclude an Item through the UI:
Remove the * Configuration if it exists
Define all the strategies you may want. everyChange, everyUpdate, restoreOnStartup and forecast are built in. rrd4j requires at least an everyMinute strategy too. The UI has a nice cron builder that can help with coming up with the expression if you are not familiar with cron.
If you do want to apply some filters, define the ones you want. Note that filters work on the states of Items, they do not work on the Items themselves. You can’t use a filter to exclude Items from persistence.
Add a Configuration. If you followed @alda1’s advice and are using Groups, select the persistence Group under “Select groups”. If not, select all the Items you want to persist according to this configuration under “Select Items”. You can do both if desired.
Select the strategies to save these Items under. Again, for rrd4j you must choose at least everyMinute.
Select the filters to apply to these Items.
Repeat for the other confiugurations you need.
The most universal way which will work for all persistence add-ons will be to go to Developer Tools → API Explorer → persistence → GET /persistence/items which will return a list of all the Items that are being saved by the specified persistence service. You can use GET /persistence/items/{itemname} to retrieve the actual values stored.
The persistence setting menu is a new setting entry coming with openHAB 4.2.0 and therefore not available for 4.1.0.
Persistence configuration via UI is available since openHAB 4.0, however it always was difficult to find, which luckily will change soon.
I lost track of when it was added. You’ll find the configs here in 4.2.
Yes, see the readme for the add-on. There is a default strategy which applies when there is no configuration. However, once you create a configuration, any configuration, that default becomes disabled.
Usually the default is “every Item everyChange and restoreOnStartup” with rrd4j adding “everyMinute” since that’s required for it to work.
No, because as far as I can tell you’ve not selected any Items. I don’t think the PR that adds the ability to select * for the Items has been merged yet so if you want every Item you need to click on the code tab and add it manually there.
But that’s not what was asked for in the original post. You want to exclude one or more Items from persistence. To do that you cannot use *. You have to select all the Items you want to persist, leaving out those you don’t want to persist.
And again, if you are using rrd4j, you must use everyMinute as a strategy. It will not work with everyDay or everyHour.
While this is true over all, each Item results in a separate file between 530k and 738k. A couple hundred files is nothing but if you have thousands that could add up.
Also, if not using zram and running on an SD card, each Item adds more than one write per minute which can be a concern.
When I will configure a persistence strategy, what will happen with old data ?
Will be deleted ? Because data of some items I don’t need and best for me is, when they are deleted from the database. Or how long data are stored ?