restoreOnStartup with Influxdb

Hi,

i’ve created a Item

Number Lueftung_Modus_OG        "Lüftungsmodus OG [MAP(lueftung.map):%s]"   <fan>       (LueftungenOG, Lueftungen)

and a Selection in my sitemap used for my rules:

Selection item=Lueftung_Modus_OG mappings=[0="Sommer", 1="Winter", 2="Immer an", 3="AUS"]

All works fine.

To save the last state i use InfluxDB with

Items {
  Lueftung_Modus_OG       : strategy = everyChange, restoreOnStartup
}

If i restarted Openhab, the state could not restore with this error in the log:

2018-01-07 19:38:55.164 [WARN ] [rm.AbstractFileTransformationService] - Could not transform '1.0' with the file 'lueftung.map' : Target value not found in map for '1.0'

My lueftung.map:

0 = Sommer
1 = Winter
2 = Immer an
3 = AUS

I don’t know, why 1.0 and not 1 is saved in InfluxDB.

Any hints?

Thanks,
Huaba

I suspect that InfluxDB doesn’t have the concept of intergers or the way OH saves data to InfluxDB it saves everything as floating point numbers.

This comment I found on an InfluxDB issue indicates that may be the case:

Because of this and a host of other issues, we’re considering ditching int64 as a user data type entirely and just making every number in the system (other than timestamps) a float64. There should be an explicit decision one way or the other with 0.9.3 in mid-August.

1 Like

Ok, thanks. I was not sure if i missed something. My intention was to use only one persistence (use InfluxDB with Grafana), so i’ve tried it with InfluxDB.

Now i’ve changed to MapDB an all works fine.

Thanks for help.
Huaba