Semantic model, how to apply persistence

Hello,

Coming from the old fashion way of defining items in files, I now want to move to the Symantic model. I’m struggling with the best way to apply persistence for the equipment.

I currently have items groups defined per device type, hue devices, mqtt devices, plugwise devices ext. Each group has specific persistence requirements and are so defined in the persistence file. These need to be kept in place for calculation purposes.

Now I want the graphs to work on the equipement. I was thinking to create a group for the graphing persistence purpose, but it seems I cant apply groups to equipment. It seems not logical to add each equipment (from what I understand is a group) to my persistence file. Whats the least afford/smart way to get the equipment graphs working?

Thanks!
Bastiaan

You are constrained by what persistence services can recognise and operate with. Items, including Groups. That’s all.

I don’t see why not.

Because it’s time consuming and easy to forget.

If I would at the most top level Semantec folder (group) to the persistence file, would that enable persistence on all childs?

With no file at all, you will persist all (suitable) Items.

Groups works the same as Groups always worked, naming with a * appended will persist all members. Except member Groups - they get the group treatment of persisting members.
In other words, it will cascade through a hierarchy of sub-group members, yes.

All you have to do is determine the Item name of your ‘top’ Group and find out if what you think are sub-Groups really are members. Semantics is just about tags.

I use a small trick to help manage this amongst other things.

[Do the following with the ‘Show non-semantic’ checkbox checked]

1). Create a main Settings group
2). Under this create sub groups for various settings (ie. one for Persistence).
3). Under this create Groups for the different Persistence settings you want to implement.
4). Add the items to the relevant settings group.

I’m in a slightly different position as I have the default RRD4J persistence, so all items can be ‘analyzed’. I then use the above to specify items for InfluxDB for which I use other tools (ie. Grafana) to produce dashboards.

The nice thing about this is I can now work predominantly from the ‘Model’.

1 Like

I basically do the same, just with one group instead of many by persistence setting (as I only need one).
Create one “persistence group”. i.e.:

And then use this in the config file and assign all items that should be persisted into it.

@Sunny, thats a very slick approuch. I’m definitely going to give this a try.

@chrismast, thats a simple but effective way to.

Thanks!

Such a simple idea! So, now there is no need to restart OH service to read the new persistence config ?

I have not actually checked if IH needs to be reloaded, as I normally make a lot of changes in one go and then reload anyway.

I did not have to restart OH while using persistence groups. Items appear right away (on value update) in my db.

You are right, it even shows on the logfile, i see that instantly on frontail.