InfluxDB+Grafana persistence and graphing

Tags: #<Tag:0x00007f014cc76858> #<Tag:0x00007f014cc76650> #<Tag:0x00007f014cc764e8>

(Baki Med) #588

Hello @ThomDietrich
I’m sorry to get you back this old but am really clueless with grafana, I tried to install it through openhabian-config and with your method but am always stuck while:

Executing: /tmp/apt-key-gpghome.FapIGOf3st/ --keyserver --recv-keys 379CE192D401AB61

I don’t know what to do, I’m still new to OpenHAB and couldn’t find solution.
Added to that, I installed the persistence in PaperUI but it’s always showing blank black screen.

(Stefan Steiner) #589


I successfully was able to show a chart with grafana, influxdb and a webview how it was described in this tutorial.

Now I want to achieve changing the duration of the chart via three buttons.

Here I have a problem when changing the visibility for web views. Only renders the title bar.

Here is the sitemap

Switch item=TemperatureSensor_ChartPeriod icon="chart" mappings=[0="Stunde", 1="Tag", 2="Woche"]
                Webview url="/static/chartHour.html" visibility=[TemperatureSensor_ChartPeriod==0, TemperatureSensor_ChartPeriod=="NULL"] height=10
                Webview url="/static/chartDay.html" visibility=[TemperatureSensor_ChartPeriod==1] height=10
                Webview url="/static/chartWeek.html" visibility=[TemperatureSensor_ChartPeriod==2] height=10

In the html file I have an iframe with the grafana url inside.

The problem is that if I switch to another view. e.g. “Day” only the header of the chart is rendered.

I would appreciate any help.



(Kees Van Gelder) #590

@ThomDietrich Thanks for great tutorial. Not only did it helpme setup Influx and Grafana, but your Sinewave example taught me how to fill influxDB fromPython as well.

@rlkoshak thanks for some of your examples that taught me there is much more possible than I intitially thought,such as two different scales on the left and right Y axis


Thanks, I could have sworn it should be every15Min :"*/15 * * * * ?", But yours is correct. Darn, cant trust the various Cron generators

(Rich Koshak) #591

You can trust the Quartz Cron generator. That is the library used in OH and it different from “standard” Cron in that it goes down to the seconds. Most other crons only go down to the minute.

(Kees Van Gelder) #592

Ah good to know. Thanks


Sorry but I followed this fantastic thread to a tee, and as far as I can tell Influxdb is installed, as is Grafana, all the .cfg files are configured.

But none of my logs show anything useful at all… Even adding extra logging info to org.ops4j.pax.logging.cfg does nothing (the log file doesn’t even get created!). It’s as if openhab can’t see influx or can’t use it.

Not sure where to go from here. I’ve double checked everything I can think of from this thread and others. I don’t see anything out of place.

Any assistance would be appreciated!


# The database URL, e.g. or .
# Defaults to:
# url=

# The name of the database user, e.g. openhab.
# Defaults to: openhab
# user=openhab

# The password of the database user.

# The name of the database, e.g. openhab.
# Defaults to: openhab

# The retention policy to be used, needs to configured in InfluxDB
# Till v0.13: 'default', since v1.0: 'autogen'


Strategies {
    everyMinute : "0 * * * * ?"
    everyHour   : "0 0 * * * ?"
    everyDay    : "0 0 0 * * ?"

Items {
    gHeatAct*, gHeatSet*, gHeatValve*   : strategy = everyChange, everyHour
    Presence_Phone                      : strategy = everyChange

running SHOW MEASUREMENTS or SERIES doesn’t return anything in the influx cmd line either, so it seems like nothing is actually being written to the DB

(John Schmitz) #594

Do you actually have Items and Groups with the names you list in influxdb.persist? I think those were meant as examples. You need to customize for your specific items.


Damn, I see what you mean now… I’ll check that right now and report back.


EDIT: That’s exactly what it was! Thank you for the tip!

(Mark) #596

I have been researching how to setup InfluxDB and Grafana on my Openhab2 Raspberry Pi3b Stretch setup
and I came across this good read:

It wasn’t clear to me from this thread that I could install both InfluxDB and Grafana simply using the Openhab config menu

sudo openhabian-config

and select optional components.

Is there a reason this is not mentioned at the top of thread? Or to put it another way, what is best method to get InfluxDB and Grafana up and running on my Rpi3b Stretch?

I checked the link in this thread to RPi setup and it talks about Jessie. I assume for Stretch I just replace the words ‘Jessie’ with ‘Stretch’ for the correct install. Correct?

Thanks Mark.

(Rich Koshak) #597

openHABian is not the only way to install and manage an openHAB installation.

When this article was written, I don’t think openHABian supported installing InfluxDB and Grafana. I may be mistaken, but I’m not even sure there was an openHABian at that time.

The instructions are also generic enough such that should users want to host InfluxDB and Grafana on a VM or server separate from openHAB they can do it.

If you are using openHABian, use openhabian-config. If not, use the instructions above to install.

I’m pretty sure there is nothing else different between the two so that should work.

(Christoph Wempe) #598

This might be interesting for some of you. :grin:

(Daniel N.) #599

is there a way to outsource the infludb to a USB stick?
And if so, how can i do that?


(Rich Koshak) #600

Google is you friend.

Note that a USB drive is no better than an SD card. It too will wear out with enough writes.

(Elie Hanna) #601

Hey All,

A small help is needed please, a message in frontail logs keeps popping up from time to time:

2018-08-10 12:16:41.838 [ERROR] [org.influxdb.impl.BatchProcessor ] - Batch could not be sent. Data will be lost

java.lang.RuntimeException: {“error”:“timeout”}

at org.influxdb.impl.InfluxDBErrorHandler.handleError( [205:org.openhab.persistence.influxdb:1.12.0]

at retrofit.RestAdapter$RestHandler.invoke( [205:org.openhab.persistence.influxdb:1.12.0]

at org.influxdb.impl.$Proxy127.writePoints(Unknown Source) [205:org.openhab.persistence.influxdb:1.12.0]

at org.influxdb.impl.InfluxDBImpl.write( [205:org.openhab.persistence.influxdb:1.12.0]

at org.influxdb.impl.BatchProcessor.write( [205:org.openhab.persistence.influxdb:1.12.0]

at org.influxdb.impl.BatchProcessor$ [205:org.openhab.persistence.influxdb:1.12.0]

at java.util.concurrent.Executors$ [?:?]

at java.util.concurrent.FutureTask.runAndReset( [?:?]

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301( [?:?]

at java.util.concurrent.ScheduledThreadPoolExecutor$ [?:?]

at java.util.concurrent.ThreadPoolExecutor.runWorker( [?:?]

at java.util.concurrent.ThreadPoolExecutor$ [?:?]

at [?:?]

I’ve read the in this topic how to solve it and i added the "retentionPolicy=autogen"in the influxdb.cfg file the restarted the RPi but the problem still remain noting that all the functionality of Influx and Grafana are working properly.

Please advise !!

Thank you

(Elie Hanna) #602

Hey All,

Problem solved by changing the SD card, a small hint for anyone may face this issue to use a better SD card with faster through put.


(Kotik) #603


Which seems to be the best way of updating Grafana to the latest release (v5.2.2)?

I am using iframes to embed graphs and the Grafana version (v5.1.4) that is installed with Openhabian has a bug with iframes and a vertical scroll bar.

This is fixed in latest release.

Any suggestions are welcome.

P.S. I tried:
sudo apt-get update
sudo apt-get install grafana

and it reports that the latest version is already installed…

(Nakh Home) #605

I do not know why but the image is really tiny

                Frame label="Chromecast" icon="chromecast" {
                   Default item=Chromecast_LG_ReleaseDate            	   	
           Image refresh=60000 url=""
        Frame label="Sensors-A1" icon="temperature" {		 
            Default item=mqtttemperature icon="temperature"

(Kotik) #606

To answer my own question, Grafana now officially supports armv7 and they have the latest version available for it:)

I had to run:
sudo dpkg -i grafana_5.2.2_armhf.deb

and my Grafana updated to latest stable release that has the “iframe” scrolling issue fixed.

(Eric Geiger) #607

Hi Guys,

is there a possibility to build graphs out of openHAB for forecast data. I want to build a forecast graph for a power calculatioin for the next 5 days. In openHAB I have more than one Item. My problem is that I only can persist one Item which persist the past. But I want to show the forecast. And how can I put more than one Item in a line for graphing the forecast data?


(5mark) #608

Thanks for this great tutorial. Its really amazing what you can do with grafana and openhab
May I suggest to add the possibility of using grafana’s kiosk mode to add your graphs as webview / frame to a dashboard to the tutorial?

I think its by far the easiest way to display your graph in HABpanel.

just add &kiosk=1 to the url of your dashboard. this will hide all of grafana’s menu items.