Chart annoying refreshing

Hi there!
I have a problem with charts - the image refreshes periodicaly with peiod 1-10 s this period does not depend on
refresh parameter "refresh= ".
In the log i saw some errors

INFO | jvm 1 | 2015/12/13 17:30:17 | 2015-12-13 17:30:17.778 [ERROR] [OSGi ] - Could not bind a reference of component org.openhab.ui.chart. The reference is: Reference[name = ChartProvider, interface = org.openhab.ui.chart.ChartProvider, policy = dynamic, cardinality = 0…n, target = null, bind = addChartProvider, unbind = removeChartProvider]

and this:

INFO | jvm 1 | 2015/12/13 17:30:37 | 2015-12-13 17:30:37.789 [WARN ] [.o.c.p.e.PersistenceExtensions] - There is no queryable persistence service registered with the name ‘rrd4j’
INFO | jvm 1 | 2015/12/13 17:30:37 | 2015-12-13 17:30:37.805 [ERROR] [m.r.internal.engine.RuleEngine] - Error during the execution of startup rule ‘Update max and min temperatures’: cannot invoke method public abstract org.openhab.core.types.State org.openhab.core.persistence.HistoricItem.getState() on null

This is part of my sitemap file^

		 	Switch item=Weather_Chart_Period label="Chart Period" mappings=[0="Hour", 1="Day", 2="Week"]
			Chart item=Weather_Chart period=h  refresh=6000 visibility=[Weather_Chart_Period==0, Weather_Chart_Period=="Uninitialized"]  
			Chart item=Weather_Chart period=D refresh=30000 visibility=[Weather_Chart_Period==1]   
			Chart item=Weather_Chart period=W refresh=30000 visibility=[Weather_Chart_Period==2]      

		 	Chart item=bmp_baro period=4h service="rrd4j" refresh=60000 visibility=[Weather_Chart_Period==0, Weather_Chart_Period=="Uninitialized"]
		    Chart item=bmp_baro period=D refresh=30000 visibility=[Weather_Chart_Period==1]
			Chart item=bmp_baro period=W refresh=30000 visibility=[Weather_Chart_Period==2]

Do you have any .rrd files in /etc/rrd4j/?

Yes! i have few files with myitem.rrd The charts appears correctly but refreshes very often on IOS app. I suppouse that refreshed charts, but may be refreshed all page…

Where are you getting the data for the charts from? If you are getting very frequent updates of the data the chart refreshes to reflect the new values coming in. I haven’t looked much into it to find a work around, let us know if you do.

1 Like

I am using only rrd4j persistence. In openhab.cfg all rrd4 settings is default.
I suppouse that every minute not very often
However i try to change to everyhour strategy and the problem still appears. .
My file is:
Strategies {
everyMinute : “0 * * * * ?”
everyHour : “0 0 * * * ?”
everyDay : “0 0 0 * * ?”
default = everyChange
}

Items {

esp_temp,esp_humid,bmp_temp,bmp_baro : strategy = everyMinute, restoreOnStartup

}

I’m not sure this has to do with rrd4 (which, by the way, must be set to every minute in order to chart data) but with the source of the data. In my case I have Scientific Oregon thermometers that emit data every few seconds and (I think) whenever the corresponding Items get updated (every few seconds) the chart refreshes.

May be this is a bug? I will try with another persistence and research this situation.

I have this issue with charts on IOS as well. I just removed them from my sitemap so they would stop refreshing the entire page constantly. Would love to hear if there is a workaround here.

This work for me to-). But i want charts on my ios openhab. I just try to put it not on the main screen. Chart with data from the db4o persistence didn’t resolve the problem.

Hi,

I suspect I’ve got the same issue.
I’m receiving data over MQTT from some remote sensors. The data is in float form (XX.YY) and represents Temp, Humidity and Heat Index (a further topic also sends Barometric pressure [XXXX.YY]). The periodicity of traffic bursts is governed by a change in the ambient variable. ie. a delta in temp will trigger an MQTT publish.
Potentially, once scaled up this could mean many asynchronous updates over MQTT.
I’ve noticed from my tailed debug the update occurs when such an MQTT publish happens bearing out what frederic0 states.
So far the only way I’ve found to minimise the refresh impact is to bury the individual charts under some sub menus.

Would love to hear of a fix if one is out there
SQ

Yes, you are right! I do the same. Every time when broker recieve data the graphs refreshes. I extend time from mosquitto device and the problem has been resolved.

Am using energy monitor with MQTT, am receiving frequent updates because i need to, rrd4j set to every minute, i would love to have charts to refresh up on rrd4j updates only.

@Kai is this an issue? if yes is it listed in github ? Thanks :slight_smile:

Hi,

I also experience this problem on openHAB 1.8.3, I have a smart power /gas meter which sends data each second, but this makes it impossible to view the charts of my power usage.

Is the refresh on new data something which can be disabled via configuration? Or are there other workarounds?

As a final workaround I was thinking about transferring the (average of the) data once a minute (using a cron-rule) to the items which are used for the chart, this way a lose a lot or resultion but can view the charts. Is this something that could work

Does somebody have a better idea.

Exact same issue here, not even a hint on where to start.

What I did is instead of updating the chart directly I display the sensors reading separately and use additional rule to update the chart every 30 seconds. As a result the page refreshes every 30 sec only and the data is more accurate than if I to transfer averages.

if (nodeId == 7) {
   sendCommand(Weather_Temp_Node,payload); //Display current temperature
   value=payload; //To be sent to the chart

rule "Chart Update"
	when			
		Time cron "0/30 * * * * ?"
	then
		sendCommand(Temp2,value) //Update chart info
	end
}

This seems to be part of a rule, or a style I did know about.

Is the nodeId if embedded in some other rule?

Yes, you are right. This is the part of the other rule. I use this bit as an example.

I am also experiencing this on OpenHAB 2.0 and latest OpenHAB Android app. The chart seems to be refreshed whenever there is an update to the displayed item/group. This gets even more pervasive if you have multiple charts on one screen.
By examining network traffic in Chrome Developer Toolbar I also see the same refresh happens in BasicUI web interface.

Does anyone know if this is by design or is this a bug?
I wonder about the refresh attribute on the Chart element - it seems to be redundant here.

In terms of workarounds, using a rule as described by @Nikita is one option, but it requires more setup overhead.
Alternatively, I was looking into rendering an image chart through rrdchart.png as described here, but the image takes significantly longer to render (up to 800ms on my setup) than the default chart element. On top of that this requires me to embed my deployment host (http://host:port/rrdchart.png) into my configs - which I don’t like.
Any other ideas?