MySQL+Grafana, no chart for rarely changed items

I have missing lines in Grafana graphs for some items.

Seems like org.openhab.persistence.jdbc-1.8.3 is not working with timed strategies like

everyHour : “0 0 * * * ?”

One example is the rain sensor that updates every minute. It is often just 0 for days and in the MySQL, there is only one zero since the last rain stopped. When I show the rainfall for the last day the chart is empty ( no data ). I expect to see a line down at zero with data points every hour.

This is my config

Grafana* : strategy = everyHour, everyChange 

So even if the item is not changed I would like to get an hourly record in the database

Is there a fix for this in OH2 or maybe I should use infuxDB?

Then, the Item is not getting updated every minute but only when the binding sends new data.
If the state is not changed, then there is nothing new to persist for everyChange.
The everyHour should work in case the Item state is not NULL.

What is the current state of the Item?

You should post the entire .persist and the Item config.

by the way: storing an displaying a (zero) value for the Item state every hour can be misleading. The rain sensor is not really reporting anything during that time period, so you won’t be able to distinguish between a dead sensor and a working sensor situation.

It is a custom sensor (DIY), so it updates an MQTT topic every minute. Seem like everyUpdate works fine but then I would get too many zeroes in the database (every minute). It would be nice if everyHour is working and I get zero only once per hour in the DB if it is not raining.

This is the binding

{ mqtt="<[ohabssl:w_rain/rain_count_mm:state:REGEX((.*))]" }

The perisistance

Strategies {
everyMinute : “0 * * * * ?”
everyHour : “0 0 * * * ?”
every10Minutes : “0 0/10 * * * ?”

Items {
Text* : strategy = everyChange, restoreOnStartup
Grafana* : strategy = everyChange
Grafana_slow* : strategy = everyHour, everyUpdate

I manage to fix this by doing UNION. I attach a row at the end and at the start of the query results with current time and with the timestamp of the beginning of the chart. Values are the last and first known. Not perfect but close to it.