HABPanel Charts average data points over time

Hello,

I have successfully installed influxdb w/ grafana and able to load data onto my HABPanel. I wanted to compare the default chart in HABPanel to a frame containing grafana data. Both are pulling from influxdb and using the same values.
I’m able to modify how the data is presented in grafana… but my data from the HABPanel chart is not averaged over time, and shows as spikes every minute. How do I change this behavior?

Also is there anyway to use a transform MAP on the data before it’s put into the sensor logs? for some reason my power management system shows .5 amps as 50 amps via snmp

This is currently working although my items must use a string value or else it will not work.

mark@mega-server:/etc/openhab2/items$ cat mark.items | grep current

Number strip_1_current	"Current [JS(current.js):%s]"	{snmp="<[10.10.121.6:public:.1.3.6.1.4.1.4779.1.3.5.5.1.6.2.1:60]"}

mark@mega-server:/etc/openhab2/transform$ cat current.js

(function(i) {
	x = i / 10
	Number(x)
	return x
})(input)

Since the snmp binding doesn’t appear to support transformations you would have to use a proxy Item and a Rule to do the same math as you do in the JavaScript.

I don’t know anything about HABPanel charts but suspect it does not support the same degree of flexibility as one gets with Grafana.

Hello,

That is exactly what I did, for a long time I couldn’t get my simple rule to work, then I realized I had the dummy item configured as a String. Thank you for the help. The graph is now correct as well, I just had to adjust the strategy to correct the default habpanel.

Thanks for the help! :wink:

mark@mega-server:/etc/openhab2/rules$ cat current.rules
rule "Fixed Current Data update strip1"
when Item strip_1_current received update
then
   var x = strip_1_current.state as Number / 10
   dummy_1_current.sendCommand(x)
end