[SOLVED] Restore a numeric item value on startup using rr4dj

Hi,

I recently ran in to a problem regarding the rr4dj persistence database. I updated openhabian to latest version 2.4 Snapshot. Before I used 2.3.

Now it looks like a numeric item is not restore correctly

I have the following configuration:

Items:

Number Alarm_Betriebsmodus

In runtime this item contains integers from 0 … 3

Persistence looks like that:

Items {
Alarm_Betriebsmodus : strategy = everyChange, restoreOnStartup
}

Up to v2.3 everything worked as expected. Let’s assume that the item value is 1. When the system starts again the item value is restored as 1.0.

What can I do to make persistence deliver the correct value 1 instead of 1.0?

Kind regards
Ingo

Use mapdb for restoreOnStartUp. That database is made for that.

1 Like

:+1: for Vincent’s recommendation
+rrd4j requires at least everyMinute persistence strategy to work properly (some debate this one :slight_smile:)

1 Like

Be the same underlying issue as this post, storing as a floating point.

I’m guessing it gives you some problem because 1 != 1.000000001 ?

1 Like

Hi,

switching to mapdb persistence solved this issue. This is perfectly suitable for my needs.

Thx @all for the great support.

1 Like