Hello, I am woundering is it possible to set everything to how it’s benn after raspberry pi reboot ?
Any help is appreciated.
You will have to provide a lot more details about what you are looking for.
At first, look what you are asking for doesn’t make a whole lot of sense.
Are you thinking about persistence (OH remembering item state after a reboot?) ? If so and you only want it to remember last state, check out mapdb persistence.
Look like what I need, could you link me to a detailed guide of the usage of it? E.G I want to have my item “templinked” to contain it’s value after a reboot.
I want to savo the value of an item for E.G “templinked” value was “1” before reboot, and after the reboot I want it to go back to that value
Then you need Persistence with the restoreOnStartup strategy. As Alpoy mentioned, MapDB is a great choice for this.
Quick question can I have more than one persistences E.G mapdb and rrdj4
Absolutely yes. See Design Pattern: Group Based Persistence for one way to do it.
@rlkoshak made a great article about persistence. (Whoops, beat me to it)
In summary:
- Install mapdb persistance addon.
- Add a group called
gRestoreOnStartup
(or whatever you want to call it) - Update
mapdb.persist
with the contents:Strategies { default = everyChange } Items { // persist items belonging to the group on every change and restore them from the db at startup gRestoreOnStartup* : strategy = everyChange, restoreOnStartup }
- Add
templinked
to the groupgRestoreOnStarup
The MAPdb addon doesnt seem to install properly because neither it creates a config file or a .persist file.
You should be the one to create it then ;).
I have done that, but still neither it saves the data from templinked and neither it shows up in the default persist. under paperui, I have to enter it manually and it doesnt create a config file of its own.
2017-09-26 16:23:52.837 [ERROR] [core.karaf.internal.FeatureInstaller] - Failed installing ‘openhab-persistence-mapdb’: Permission denied
Looks like openHAB doesn’t own the folders anymore. Assuming you installed openHAB automatically (i.e. through apt or openhabian):
sudo chown -R openhab:openhab /etc/openhab
sudo chown -R openhab:openhab /var/lib/openhab2
2017-09-28 18:26:49.275 [ERROR] [core.karaf.internal.FeatureInstaller] - Failed installing ‘openhab-persistence-mapdb’: Error restarting bundles
I’d follow the instructions in this post for that: [Solved] Bindings not updating? - #2 by wborn
Didn’t help