[SOLVED] Persistence NULL values with restoreOnStartup

I still have a number of proxy items that stay set to NULL on reboot.

I have restoreOnStartup on my persistance configs.

Couple of things Im wondering…
I have 3 persistance bindings - all with restoreOnStartup - could this be conflicting?
I have a script that checks on system start for a switch state of NULL and then if so restore the value from persistance from 1 hour ago, this dosnt seem to work either and thought if the above was working I wouldnt need anyway?

What OH-Version and what persictence?
Does the persistence store datas?
Post your persist-file (and item) please.

OH 2.3 stable

Influx db

Strategies {
	everyHour 	: "0 0 * * * ?"
	everyDay 	: "0 0 0 * * ?"
	default = everyChange
}

Items {
	 * : strategy = everyChange, everyDay, restoreOnStartup
	}

jdbc db

Strategies {
	everyHour 	: "0 0 * * * ?"
	everyDay 	: "0 0 0 * * ?"
	default = everyChange
}

Items {
	 * : strategy = everyChange, everyDay, restoreOnStartup
	}

mapdb

Influx db

Strategies {
    default = everyChange
}

Items {
    * : strategy = everyChange, restoreOnStartup
}

What ist you default persictence service?

I have 3 persistence services and I only use restore on startup with Mapdb as it stored only the last value anyway. It is useful for this and thing like lastUpdate

1 Like

Really smart

Mapdb can store all the data types?

Yes all item types

https://docs.openhab.org/addons/persistence/mapdb/readme.html

1 Like

jdbc is my default

I would change to only one persistence-service for restoreOnStartup and only for the items you realy need retoreOnStartup.
For that I think mapdb is the best choise.

thanks for this post!

till now, my persistence was enabled for all the switches and chromecast volume and TV volume… not really necessary

Please could you share you persistence file and may i ask why a third one?

mapdb.persist

// mapdb persistence

Strategies {
	default = everyChange
}
Items {
	Persist* : strategy = everyChange, restoreOnStartup
}

I have influxdb to use with grafana to get nice graphs in HABpanel and accurate history
I have rrd4j to make graphs in the sitemaps
and mapdb to restore on start up

Could I abuse of your kindness and share the influx DB persistence

Here you go:

I only persist some items in influxdb. I have a group called Persist for that purpose.

Strategies {
    //everyMinute   : "0 * * * * ?"
    everyHalfHour : "0 0,30 * * * ?"
    //everyHour     : "0 0 * * * ?"
    //everyDay      : "0 0 0 * * ?"
}

Items {
    Persist*   : strategy = everyChange, everyHalfHour
}

The every half hour is needed if you want to graph items that only update once in a while

1 Like

?
You can’t you use Grafana on a sitemap? I must be missunderstanding your statement!
Additionally, the history in rrd4j is “accurate” as well! InfluxDB can compress older data, as well as rrd4j, if you opt to keep all values both databases will keep them as long as desired ( rrd4j not unlimited).

Yes I can, I prefer the native graphs in sitemaps somehow. Old time user, habits are hard to change!!

I don’t want to. I only persist some items through influxdb and I’m a geek so I want to be able to drill down old accurate data in the future.