I’m using mapdb persistence as the default service to save all the states of my items, lights etc. However, I know that mapdb can not be used for charts.
I have the following in my sitemap:
But the rrd4j is not being used with mapdb set as default.
If I set rrd4j as default then the charts work fine, but I’m not storing any states of my lights, switches etc
Thanks in advance
You’re not telling your sitemap Chart widgets which persistence service to use.
So they use the default service.
If you would like Chart to use a non-default service, you must specify which one in the Chart widget.
Unrelated, do you really want restore on startup in your rrd4j config? What is mapdb for, if so?
Thanks for that, I was looking through the docs at persistence and it didn’t occur to me to look in there.
Is this the same for non-chart items?
For instance, I have this rule:
rule "Set daily max and min temperature"
when
Item Weather_Temperature changed or
Time cron "0 0 0 * * ?" or
System started
then
val max = Weather_Temperature.maximumSince(now.withTimeAtStartOfDay)
val min = Weather_Temperature.minimumSince(now.withTimeAtStartOfDay)
if (max !== null && min !== null) {
postUpdate(Weather_Temp_Max, max.state)
postUpdate(Weather_Temp_Min, min.state)
}
end
I also need to persist those values of Item Weather_Temperature for that rule to work properly I think
Yes, if you don’t want to use the default service in persistence functions in a rule, you have to tell it what you do want to use instead. It’s described in the persistence docs that you looked at.
You haven’t said exactly what you are dong with mapdb, but there’s no point in having more than one service doing restores on the same Item
Thanks @rossko57,
mapdb is basically just storing everything and restoring it on startup, so I have removed the restore on startup from the rrd4j.persist file.
I had read that part of the docs on persistence, however I’m unsure how to incorporate it into the rule I posted.
Would it be like this:
val max = Weather_Temperature.maximumSince(now.withTimeAtStartOfDay,"rrd4j")
val min = Weather_Temperature.minimumSince(now.withTimeAtStartOfDay,"rrd4j")