Graphs missing data

Hi,
I have a slightly odd problem. I have an item that saves the temperature of my living room into mysql every minute.

In my sitemap I then have that displayed in three graphs; daily, weekly and monthly. For some reason, the day and week graphs don’t display all the data. It’s most obvious in the daily graph and only slightly obvious in the weekly one.

At first I thought the thermometer was locking up but I’ve checked the numbers in Mysql and that’s not the case.

Furthermore, it’s always the same part of the graphs that’s missing - The first 11ish hours or so.

Can anyong think of a reason why it’s not displaying all the data?

I’ve attached a screenshot.

Number  CarnegieTemp    <temperature>   (PersistenceGroup,Graphed)       {mqtt="<[localhost:ourhouse/carnegie/temperature:state:default]"}

Items {
PersistenceGroup* : strategy = everyMinute, everyChange, restoreOnStartup
Graphed* : strategy = everyMinute, restoreOnStartup
}

As I copied that, I realised those two persistence groups are doing pretty much the same thing. Could having both be causing the issue?

	Text label="Temperature" icon="temperature-max" {
	Text item=CarnegieTemp icon="temperature-max" label="Current [%.1f°C]"
	Text label="Past" icon="temperature-max"{
		Text item=CarnegieTemp icon="temperature-max" label="Current [%.1f°C]"
		Chart item=CarnegieTemp period=D refresh=60000
		Chart item=CarnegieTemp period=W refresh=60000
		Chart item=CarnegieTemp period=M refresh=60000
	}
}

That looks to me as if the different requests would be getting data from different databases ( or like different archives as in rrd4j). That is because the timeframe from the day chart with constant value does not show up on the weekly chart.
What is your default persistence service? (I have no clue for this behaviour, just checking around!)

As a random line of enquiry, what timezone is the datestamping in in MySQL?
It shouldn’t really matter when OH persistence is doing both the storing and retrieving, but it feels likes something crossing a date change boundary.
There may not be many other users using the combination of simple Chart widget with MySQL.

Thanks. You’re right. The logs have my local timezone, which is GMT +10, but mysql is storing them in GMT.

Mysql had the correct time set but for some reason in the mysql url within Openhab I had “serverTimezone=UTC”. I updated that to serverTimezone=Australia/Melbourne and the timestamps in mysql are now correct.

2 Likes

Good catch, nasty little trap.