HomeMatic overwrites persisted restoreOnStartup value with 0 on system restart

I have two persistence services active.

mapdb with:

 * : strategy = everyChange, restoreOnStartup

influxdb with:

gPersist* : strategy = everyChange, every5Mins

What I am seeing is that when I restart the OH, 0 (zero) values are stored in influxdb for some data points. At first, I thought that it might be a race condition between the persistence service and the bindings, but after analyzing the data points and the log it seems only to be the case with some data points of the homematic binding.

here are the log entries of one data point and the channel of this data point:

2024-04-20 18:29:05.453 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'WSTemperature' changed from NULL to 7.10
2024-04-20 18:29:58.729 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'homematic:HmIP-SWO-PR:3014F711A0001F58A992FB22:00185BE9922B53' changed from INITIALIZING to ONLINE
2024-04-20 18:29:58.984 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'WSTemperature' changed from 7.10 to 0
2024-04-20 18:30:11.153 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'WSTemperature' changed from 0 to 7.10
2024-04-20 18:32:44.054 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'WSTemperature' changed from 7.10 to 7.20

18:29:05.453 - mapdb restores the value
18:29:58.729 - the channel goes online
18:29:58.984 - binding updates the value back to 0, probably not by receiving any value from the sensor, just defaults to 0
18:30:11.153 - probably the values received by the sensor updated
18:32:44.054 - probably yet another sensor update.

In this case, the values come from the weather station temperature sensor, the same situation is also for other devices like window sensors which at first report a “CLOSED” state before getting value from the actual value from the sensor. So if the window is open you would get a sequence :

"NULL->OPEN->CLOSED->OPEN"

I do not have a solution for this, especially for my values which persist in influxdb and where I use grafana to visualize stuff like temperatures.
There I see these 0 hicks in the graph, which is ugly.
Any idea how to solve this?

I’d say this is a big in the Homeatic binding. It shouldn’t be overriding restoreOnStartup values with a default value. If it doesn’t have a “real” reading from the sensor, it should not update the Item at all.

I probably left out information, or was unprecise:
I am not only restarting OH but also Homematic at the same time. So it might also be a bug of Homematic (Raspberrymatic).
I need to record a log trace and analyze the communication between OH and HM.