InfluxDB+Grafana persistence and graphing

Tags: #<Tag:0x00007fd312019220> #<Tag:0x00007fd3120190b8> #<Tag:0x00007fd312018f78>

(Elias Hackradt) #387

Fresh Setup.

The openHAB version with my 389 Items is not on a Pi.
I am clueless.

(Angelos) #388

check something in the console…

config:list "("

and compare the output to your /etc/openhab2/services/influxdb.cfg

check also: /var/lib/openhab2/config/org/openhab/influxdb.config

(Elias Hackradt) #389
openhab> config:list "("
Pid:            org.openhab.influxdb
BundleLocation: null
   db = openhab_db
   password = SneekyLittleHobbits
   retentionPolicy = autogen = org.openhab.influxdb
   url =
   user = openhab



(Angelos) #390

looks good…

I don’t know what else to suggest…

Here is my TRACE log from my influxdb persistence service (working fine):

29-Aug-2017 18:03:41.880 [TRACE] [tence.influxdb.internal.InfluxDBPersistenceService] - Tried to get item from item class class org.openhab.core.library.items.NumberItem, state is 64.8
29-Aug-2017 18:03:41.881 [TRACE] [tence.influxdb.internal.InfluxDBPersistenceService] - found fractional part
29-Aug-2017 18:03:41.881 [DEBUG] [tence.influxdb.internal.InfluxDBPersistenceService] - got DecimalType value 64.8
29-Aug-2017 18:03:41.882 [TRACE] [tence.influxdb.internal.InfluxDBPersistenceService] - storing mP6_01_01_P in influxdb value 64.8, mP6_01_01_P (Type=NumberItem, State=64.8)
29-Aug-2017 18:03:41.884 [TRACE] [tence.influxdb.internal.InfluxDBPersistenceService] - Tried to get item from item class class org.openhab.core.library.items.NumberItem, state is 234
29-Aug-2017 18:03:41.884 [TRACE] [tence.influxdb.internal.InfluxDBPersistenceService] - found no fractional part
29-Aug-2017 18:03:41.885 [DEBUG] [tence.influxdb.internal.InfluxDBPersistenceService] - got DecimalType value 234
29-Aug-2017 18:03:41.886 [TRACE] [tence.influxdb.internal.InfluxDBPersistenceService] - storing mP6_01_01_V in influxdb value 234, mP6_01_01_V (Type=NumberItem, State=234)
29-Aug-2017 18:03:41.887 [TRACE] [tence.influxdb.internal.InfluxDBPersistenceService] - Tried to get item from item class class org.openhab.core.library.items.NumberItem, state is 8.3
29-Aug-2017 18:03:41.887 [TRACE] [tence.influxdb.internal.InfluxDBPersistenceService] - found fractional part
29-Aug-2017 18:03:41.888 [DEBUG] [tence.influxdb.internal.InfluxDBPersistenceService] - got DecimalType value 8.3
29-Aug-2017 18:03:41.897 [TRACE] [tence.influxdb.internal.InfluxDBPersistenceService] - storing mP6_01_02_P in influxdb value 8.3, mP6_01_02_P (Type=NumberItem, State=8.3)
...(aloooot of entries)...

( ) #391

Hey guys, I’m also unsure what’s going on here. As it seems like the connection is established without issues, I’d suspect the persist file to be faulty, leading to no persistence. Try to recreate the file. Here is mine.

(Angelos) #392

we hijacked your thread! :stuck_out_tongue:

seems so (but Elias fixed it)…

(Rich Koshak) #393

Posting this here as I think most of the people watching this thread might be interested and may miss my main posting.

(Ham Wong) #394

HI, when use openhab cloud to access basic_ui, I aware grafana is not showing,
is there anyway that I can make it show? limit from to local setting or cloud end setting?

(Robert) #395

your local grafana server (ip address) is probably not available from the Internet.

(Eduard) #396

for Grafana, you can not specify a local address, for example or http: // localhost: 3000, you need to specify the external address of the server with the free port 3000 port.

(Eduard) #397

not work Android app, works only ‘Webview’ Element

(Rich Koshak) #398

I’ve found the opposite. Image works just fine and Webview doesn’t work in the Android app.

Sample of my current setup:

                                Switch item=aChart_Period label="" mappings=[0="Hour", 1="Day", 2="Week", 3="Month"]
                                Image label="Temperatures" refresh=60000 visibility=[aChart_Period==0] url=""
                                Image label="Temperatures" refresh=60000 visibility=[aChart_Period==1] url=""
                                Image label="Temperatures" refresh=60000 visibility=[aChart_Period==2] url=""
                                Image label="Temperatures" refresh=60000 visibility=[aChart_Period==3] url=""

Note that is my local DNS path to Grafana and not accessible on the internet. It isn’t terribly fast but it works just fine through

(Ham Wong) #399

Thanks for your reply
do you mean change in grafana.ini domain = xxx? and it have to be a public domain and can’t be private ip?
so I also need to change basic UI URL from private to public?
like DDNS?

(Eduard) #400

I do not understand. Your examples do not work for me. Only Webview works.


Android app ver:

Webview works:

your examples:

your examples (I tried different versions of altered experiments. nothing succeeded):

Image label="SpeedTest" refresh=60000 url=""
Image label="SpeedTest" refresh=60000 url=""
Image label="SpeedTest" refresh=60000 url="http://edgi-server:3000/render/dashboard-solo/db/openhab?orgId=1&from=now-1w&to=now&panelId=1&theme=light&$
Image label="SpeedTest" refresh=60000 url="http://edgi-server:3000/render/dashboard-solo/db/openhab?orgId=1&from=now-1M&to=now&panelId=1&theme=light&$

Webview work:

Webview url=""


(Rich Koshak) #401

I don’t know what to tell you.

I’ve tried webviews and I’ve never been able to get any webview to work in the Android App when I’m connected remotely through

The only way I’ve ever been able to get charts in the Android app when connected remotely through is to have Grafan prerender the graphs and put them on my sitemap using the Image tag.

When you go into Grafana and click on “Share” for one of your charts, there is a little link at the bottom that says “Direct link rendered image”. That is the URL you need to put on your sitemap with the Image element.

This code is actively working for my right now running an oldish OH 2.2 Snapshot (around built 1000, just before the log4j2 change) and the latest Android app from the Play Store.

(Ham Wong) #402

HI Rich,

How are you, do you mind advise how to set local DNS and not accessible on the inetrnet?
does local DNS path should set as (

Thanks in advance.

(Rich Koshak) #403

It’s a feature I can set up in my router. If your router doesn’t d support it you will have to look it up on Google.

(Tommy Sharp) #404

Is anyone able to help me decipher why my grafana chart is showing the incorrect amount on the chart for total memory? I must have set something up wrong? It seems to be showing as the total of both total memory and used memory…

( ) #405

And that is exactly what you’ve configured I suspect :slight_smile: It’s pretty clear because of these little bumps. Go to “Display” and disable “Stack” :wink:

(Josar) #406

@hamwong have a look here