I have mapdb set up to persist item values between restarts.
But, I’d like to get some charts going.
If I install influx, does that replace mapdb? Can I continue using mapdb to persist values?
When I go to PaperUI to Extensions and select Persistance, it lists InfluxDB (V1.0) 1.14.0.SNAPSHOT. Is this the latest version? (A lot of the other Extensions (like bindings) seem to have 2.5 snapshot)
Also, when I look at:
It shows:
Chart [item=<itemname>]...
Does itemname refer to an item I’ve got defined in an .items file?
MapDB is just for the restart, it saves only the last state of an item and can therefore be used for all your items ( which you should do with other databases).
IMHO all persistence services are OpenHab1 services. So, yes that one should be good.
Yes the “item=…” is expecting an itemname, either defined by your items file or one automatically created by PaperUI.
That warning sounds to me as if it is coming from the rule-file " ruleChart".
but, I don’t understand: ( which you should do with other databases)
Use other db’s for all data, instead of mapdb?
Or use others to persist data for history?
Confused.
So, this is something VSC is missing and may not be an error to OH?
MapDB COULD be used for all items, and the following bracket is missing the NOT, one should not persist all items in a database that stores over a large timeframe, because that is wasting storage-space.
You should only store those items which you have a real interest in.
Regarding VSC, do you have such a rule file? Then post it’s contents. But VSC is giving a warning, not an error!
Throws a warning in the OH events log when I save the file, so VSC must know something.
How does a site map chart know which db to select the data from? (Now that I have both mapdb and influxdb, and the default (in PaperUI) is set to mapdb)
When you have two databases for persistence, you need to make a choice as to which is the default service. In your case you have set it to mapdb, which means that your chart (without any further info) will still try to use mapDB, which of course does not work, as mapDB stores only exactly one value per item. You have two choices that depend on your comfort level:
switch to influxDB as default service
tell your chart explicitly where to pull data from (also described in the docs)
Sorry never seen this type of error and the only thing that comes to mind is paring it back to basics:
make sure that nothing else in your sitemap is wrong…maybe make a new sitemap, just with this chart
delete all other entries (refresh, icon, etc) just to make sure that you do not get something weird from somewhere else
you are running a snapshot, maybe it is not as stable as desired; go back to 2.5M1; I have a few charts like yours in my sitemap and it runs there without issues.
No and yes. You can have as many persistence add-ons installed as you want. I use InfluxDB for charting and MapDB for restoreOnStartup.
Yes. All of the Persistence add-ons are 1.x version add-ons. If it’s listed in PaperUI, it is the latest version of that add-on for that version of OH.
Or defined through PaperUI.
It has other uses too. For example, if you have an Item that you only ever need the lastUpdate time, MapDB is a good choice.
It doesn’t always make sense to restore all Items on startup. Sometimes it is better to allow an Item to remain NULL rather than to populate it with stale and possibly incorrect data. Other times it is better to recalculate the value during the System started Rule rather than restore some old and possibly incorrect value.
It all depends on personal preference and your use case. RRD4J is a great database to choose for numeric data where it is OH that the precision of the values stored can degrade a bit as the data gets older. But in exchange for the data becoming less precise as it ages you get a database that never grows larger no matter how much data you store in it.
InfluxDB, MariaDB, MongoDB, etc are great choices for exposing historic data to external tools or for charting. Which one to choose is largely a matter of preference and compatibility with other tools you want to use with the data (e.g. Grafana).
No, it’s still valid except for one thing. Grafana doesn’t really support generation of static images any longer. Everything else is valid.
Hmmm. I wonder if it is expecting a Group instead of a single Item. Most of the time we have more than one Item we want on the same chart and to do that we use a Group containing all the Items you want to chart. Maybe support for charting a single Item is broken?
VSC uses OH itself to check the code so you should see the same error in both places. It’s the same parsing code that is creating the error.
I get a frame with no image. But, if I take that url and drop it in a browser it is fine. (The tutorial mentions there could be a permissions issue, but, shouldn’t I see that if I drop it into the browser by hand?)
Interestingly, the Chart now works in the sitemap, but the Image from grafana (when un-commented out) still shows a broken image. But, the same url works fine in a frame in HABPanel.