Persisted Item states are not restored on startup

Hello

I am running OH 3 in a Unix VM so openhabian runs natively.
Unfortunately the item states are not persisted after restart although configured.
The item states are in influx i can read them via influx ui …
any ideas where to look at?


Strategies {
  everyMinute     : "0 * * * * ?"
  every5Minutes   : "0 */5 * * * ?"
  every10Minutes  : "0 */10 * * * ?"
  every15Minutes  : "0 */10 * * * ?"
  every30Minutes  : "0 */30 * * * ?"
  everyHour       : "0 0 * * * ?"
  everyDay        : "0 0 0 * * ?"
  default= everyChange
}
Items {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    gSensoren*,
    gHaus_Lueftung*

: strategy = everyChange, every15Minutes, restoreOnStartup

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    gKontakte*,
    gAuswertungWP*,
    gKG_Garage_Tor*,
    gKNX_Restore*,
    gLichtSperre*,
    Ladesaeule*
                                          : strategy = everyChange, restoreOnStartup

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
}

# The database URL, e.g. http://127.0.0.1:8086 or https://127.0.0.1:8084 .
# Defaults to: http://127.0.0.1:8086
version=V2

url=http://192.168.1.80:8086

# The name of the database user, e.g. openhab.
# Defaults to: openhab
user=Jonas

# The password of the database user.
#password=<myverysecretpassword>

token=mytoken

# The name of the database, e.g. openhab.
# Defaults to: openhab
# organization
db=openhab

# Retention policy
#bucket
retentionPolicy=openhab

It is all Items or only some Items?

Put the InfluxDB binding into debug logging and see if openHAB actually successfully connects before the Items are loaded. If it’s not connected then it can’t restore the Item’s states and it if takes too long to connect restoring can overwrite the latest state received from the bindings.

I’d recommend using MapDB for restoreOnStartup. It’s perfectly acceptable to have multiple persistence engines going at the same time and MapDB is the best at handling restoreOnStartup. It’s embedded so it is available as soon as OH starts, there’s no chance that it will not be available when the Items are loaded.

1 Like

I guess it’s working - even with the influx v2 version.
I think it was my bad (the time the items should be persisted was set to only a week and i think the item has not changed in that period).

looking good: