Seems the “analyzer” can only fetch data from the default persistence service, this makes some challenges for me as I like to use influxDB for the specific items I need metrics for, the rest uses mapDB since its more or less a waste of resources.
Are there any tricks, configuration or ways to get the analyzer to use a specific persistence service?
Comment, in the absence of user created xx.persist files (i.e. default after installation) each newly installed service will use a default strategy to select Items for persist. This generally amounts to “everything you can”.
Note default strategy generally includes restore-on-startup as well.
Further comment, most OH3 installs will by default have installed rrd4j, assigned that as system default service (for analyze) and be using its default persist-and-restore strategy.
Oh really? Any idea if that’s hidden in the docs somewhere? So basically, for every new persistence service installed, irrespective of whether you set it to default or not, it will store everything it can until you manually create a persist file?
So I changed default persistene in the UI to influxdb and Influxdb has its own persistence file with no default strategy. Also, mapdb is installed with a default: everyUpdate strategy in its persistence file. ’
I did an update on an item that had no persistence defined (no group) and it was NOT added to the influxdb.
So my conclusion so far is that the default persistence defined by UI is superseded by any strategy defined in the files (ie. influxdb.persist or mapdb.persist). I guess this solves it for me
Not really, as @hafniumzinc says -
“System default service” is just a pointer to which service to use for ‘analyze’ charts. It has no influence on what servicesare installed or what they persist, its just a pointer.
Each individual service will persist stuff by default, unless you define a xxx.persist file.
That strategy is to store every supported Item on every change and every minute with restoreOnStartup.
There are two things here.
If you install OH 3.x from scratch, rrd4j is installed by default. No .persist file exists so it uses the default strategy (see above).
If you’ve upgraded from OH 2.x or are using addons.cfg to manage your add-ons, rrd4j is not installed by default.
All persistence add-ons will save Items based on their persistence strategy. In the absence of a .persist file, the default strategy implemented by that add-on is used.
Which persistence add-on is configure as the default in MainUI has no bearing on this. That only indicates what persistence add-on to use for queries in the absence of an argument specifying which to use.
I am pretty sure I addressed this in the Getting Started Docs. The default strategy for each add-on is (at least for the ones I spot checked) documented in that add-on’s docs. I believe this was also included in the 3.0 announcements. The Persistence documentation page states:
openHAB ships with rrdj4 as the default persistence database and comes with a default persistence strategy of everyChange, everyMinute, and restoreOnStartup for every supported Item. The good thing about rrd4j is that the database never grows beyond a given size, so you never have to clean it up. However, the way it achieves this (replacing ten readings with the average of the ten readings as the data gets older) makes the database not work for all Item types. If you need to restoreOnStartup unsupported Item types, MapDB might be a better choice for you.
This “default strategy” would be good to know. I’ve looked at the JDBC docs page, and nothing is mentioned there, for example.
OK - I looked in the Persistence docs within Configuration, not Getting Started. I view the Getting Started as “Welcome to OH3, here’s how to get started”.
I can’t find that in the Persistence documentation. I can see that there are two pages called Persistence in the docs. Because I only care about configuring persistence, I looked in the Configuration section.
Appreciate your response on this. It’s certainly clearer for me, except for what the “default strategy” actually is for each service.
Please file an issue. It should be documented there and for each persistence add-on. It is for rrd4j and mapdb (though MapDB seems to be missing at the moment???). It should be for all of the persistence add-ons.
Given how much has changed, everyone should look through the Getting Started. So so many threads from experienced 2.x users would not have been needed if everyone would give even just a cursory look through Getting Started.
It also helps to tie together a lot of these new features in OH. “Why did they do that?!” is often answered when you see it explained end to end. For example, why does OH 3 come with rrd4j with a save everything strategy by default? So beginners are not surprised when their charts don’t work because they neglected to go configure something from scratch.