How to persist an item

  • Platform information:
    • Hardware: Pi 4 B
    • OS: OpenHABian
    • Java Runtime Environment:
    • openHAB version: 3.0
  • Issue of the topic:

I am trying to model presence. I created an Item that is a switch. My expectation is that its state should persist through reboots but it does not. I turn it on, reboot, and after startup, it is off. From what I have read so far, I thought this would be how you model a global variable. Not sure what I am doing wrong. I would have assumed all items are always persisted.

Please note that I am using the openHABian 3.0 image


You are not. I think 1.6.2 is the latest openHABian.
You are running openHAB 3.on openHABian Many of us run openHAB without openHABian.

Ok, thanks…my mistake…1.6.2 :slight_smile:

What am I doing wrong in that an Item that I created not linked to a thing does not save its state between reboots?

I actually have not worked with persistence, sorry.

I just know the version thing is a sore point with some developers here.

1 Like

Read about mapdb persistence. It stores the last value and can be setup to restore onstartup.