I can not configure Restoring mqtt Item States on Restart

I set MapDB to be a preferred persistence
then In the openHAB-conf \ persistence folder
then I created a file named mapdb.persist
then I entered this entry:

Items {

  • : strategy = everyChange, restoreOnStartup

}

then I rebooted the system for testing but still shows it to me:
צילום מסך 2020-09-15 013922

note, the rest of the items are OK and this only happens in mqtt items.
Thanks in advance

What version are you running?
You might find out what actual state your Items have.

There was certainly a problem with v2.4, restore, and MQTT

You mean the openhab version?
If so then 2.5.8

You mean the openhab version?

Okay, I thought MQTT odd behaviour has been fixed sometime in 2.5. But the best check is finding out what state your Items are actually in. And what is stored in your mapdb. REST API is a useful tool for that sort of thing.

To explain -if your Items are NULL state, restore did not work. If they are UNDEF state, the binding did that. Then we know where to look next.

thanks for your reply
i check, after reboot of openhab the items back to NULL state.
REST API is very complicated for me and I could not figure it out from the moment I installed openhab.

If you install the misleadingly named “REST API Docs”, it gives you an interactive tool. A list of API commands you can complete a form, poke “try it out”, and see the response.

Okay, let’s see if there is any persisted data.
Use REST API to enquire about persistence for one of your Items and “mapdb”.

i not sure if i do it right:
Request URL:
http://192.168.1.62:8080/rest/persistence/items?serviceId=mqtt_topic_0a0553b7_SONOFF1
this is what he Wrote to me:

{“error”:{“message”:“Persistence service not found: mqtt_topic_0a0553b7_SONOFF1”,“http-code”:400}}

http://192.168.1.62:8080/rest/persistence/items/mqtt_topic_0a0553b7_SONOFF1?serviceId=mapdb
then:

{“name”:“mqtt_topic_0a0553b7_SONOFF1”,“datapoints”:“1”,“data”:[{“time”:1600208474303,“state”:“OFF”}]}

Okay, looks like good data stored.

I suspect this is nothing to do with MQTT Items - are your other Items likely to get normal updates, and so you do not notice restore failure?

You might create a new test Item, change it with REST API or whatever, see that it has persisted, then see if that restores.

Are you using openhabian?

yes

Maybe I should write a rule?

It’s your system, you may do as you wish.

If you want help finding and fixing the problem, we can do that.

Obviously I want help finding a solution

Okay, maybe you could proceed with this -

The reason for exploring is that openhabian installation have been known to restore the wrong thing, and I’m trying to find out if that is happening to you. It’s about zram.
Or depending what else appears to get restored, you might take a close look and see if it ever restores anything different to the last time.

I gave up and installed openhab on Windows 10, the issue was resolved.
Thank you for trying to help