How to setup persistence in OH 5.1.0

  • Platform information:
    • Hardware: Raspberry pi 5 / 8 GB
    • openHABian
    • openHAB version: 5.1.0
  • Issue of the topic: can’t find any helpful documentation of a default persistance setup.
  • Please post configurations:
    • Persistence Services: MapDB Service installed:
      Configuration:
configurations:
  - items:
      - "*"
    strategies:
      - everyChange
      - everyUpdate
      - everyMinute
    filters: []
aliases: {}
cronStrategies:
  - name: everyMinute
    cronExpression: 0 * * * * ?
thresholdFilters: []
timeFilters: []
equalsFilters: []
includeFilters: []
  • Rules code to test:
rule "Persistence Test"
when
    Time cron "0 */1 * * * ?"
then
    val past = Astro_Elevation.persistedState(now.minusMinutes(1))

    if (past !== null) {
        logInfo("TEST", "Persistierter Wert: {}", past)
    } else {
        logWarn("TEST", "Noch kein Persistenzwert vorhanden")
    }
end`

  • Log:
2025-12-30 16:26:00.806 [WARN ] [nce.extensions.PersistenceExtensions] - There is no default persistence service configured!
2025-12-30 16:26:00.807 [WARN ] [org.openhab.core.model.script.TEST  ] - Noch kein Persistenzwert vorhanden
2025-12-30 16:27:00.806 [WARN ] [nce.extensions.PersistenceExtensions] - There is no default persistence service configured!
2025-12-30 16:27:00.807 [WARN ] [org.openhab.core.model.script.TEST  ] - Noch kein Persistenzwert vorhanden

And yes, I re-started my openhab:

sudo systemctl restart openhab

and with a reboot.
I’m realy confused, because I couldn’t find a single article, how-to or any other documentation of getting persistence running…

MapDB persistence only stores a single value and is mainly used to restore values when starting OH.

Install rrd4j and define the same configuration as you provided. Make it the default persistence service. Your script should work from then on.

1 Like

Thx, it is working!