[SOLVED] Xiaomi Door/Windows Sensor no Status after restart

Hi,

i use a lot of Xiaomi Door/windows Sensor (old and new one). All working good but i have one Problem. When Openhab restart or the Items File is changed and reloaded the Status of the Door Sensors is unknown until i open the Windows/Door. is there any possibility to change that so that after a restart the right Status is shown?

Thanks
Karsten

Hi.

This is normal behavior. All of the states are only temporary and gone if you reload or restart the items engine or openHAB.

To keep the states between those, you have to “persist” those status. You can choose from different persistence services and all of your states will be saved there.

Have a read here: https://docs.openhab.org/addons/persistence.html

I recommend the MapDB persistence, which just saves the latest state. If you add restoreOnStartup to the strategies, all states will be restored on restarting openHAB or reloading items files.

Here is my mapdb.persist file:

    everyMinute : "0 * * * * ?"
    everyHour   : "0 0 * * * ?"
    everyDay    : "0 0 0 * * ?"
    every15min  : "0 0/15 * * * ?"

    default = every15min, everyUpdate, restoreOnStartup
}

Items {
    settings*, temps*, lux, lux*, people, people*, devices*, lights*, living_power_w, outside_pir, sleep_heated_bed_watts;
}

That was the right hint. some Time you see not the Things you stand directly infront :slight_smile: Thanks!