InfluxDB+Grafana persistence and graphing

I just realized after having ran “reinstall” for grafana, that it seems I’m still with version 5.1.4… I’m on a standard openhabian install, I’m not sure why the apt-get update & upgrade did not upgrade grafana?
Also, when I look at the reporsitory file for grafana, this is what I see… Not sure it is normal?

> [12:14:38] openhabian@openHABianPi:~$ more /etc/apt/sources.list.d/gra*
> deb https://dl.bintray.com/fg2it/deb jessie main
> [12:15:10] openhabian@openHABianPi:~$

Ok, I followed this info and ran apt-get upgrade, it installed grafana 6.2 and all seems ok, I have again access to my Grafana dashboards… Not exactly sure of why and how I got there, but all seems ok now.

Hi. Why do not I see all the sources in Grafana? There is only part of Items.
My Influxdb.persist:

Strategies
{
everyMinute : "0 * * * * ?"
everyHour : "0 0 * * * ?"
everyDay : "0 0 0 * * ?"
default = everyChange
}

Items {
* : strategy = everyChange 
}

In order to see an item in Grafana, make sure the item has updated. Then it should be available.

How to check?

If you got a sitemap, look to see if the items has updated.
Otherweise you could use the API Docs.

I do not know why but the addition of new items and another reboot helped. Earlier reboots did not help.

Well I silently read (and learned) tons of stuff here in the openhab community forums.

Now I am at a point where I need help (and actually feel pretty dumb):
I followed @pahansen Tutorial on 'webview element" for implementing my grafana output rather than letting my RPi render images (which takes very long and sometimes they do not refresh in the app).

I have the chartshour, -day and week.html as well as the charts.css in my conf/html folder.
I added the suggested part in my sitemap-file and changed filepaths from relative to absolute.
The logs give me the following output after updating my sitemap:

[ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item for widget org.eclipse.smarthome.model.sitemap.Text
[ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'Charts' for widget org.eclipse.smarthome.model.sitemap.Text
[ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'Charts' for widget org.eclipse.smarthome.model.sitemap.Text
[ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'Charts' for widget org.eclipse.smarthome.model.sitemap.Text
[ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item for widget org.eclipse.smarthome.model.sitemap.Text
[WARN ] [basic.internal.render.SwitchRenderer] - Cannot determine item type of 'weatherChartPeriod'
org.eclipse.smarthome.core.items.ItemNotFoundException: Item 'weatherChartPeriod' could not be found in the item registry

{loads of java error, removed for better readability}

[ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'weatherChartPeriod' for widget org.eclipse.smarthome.model.sitemap.Switch
[ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item for widget org.eclipse.smarthome.model.sitemap.Switch
[ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'weatherChartPeriod' for widget org.eclipse.smarthome.model.sitemap.Switch
[ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'weatherChartPeriod' for widget org.eclipse.smarthome.model.sitemap.Switch
[ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'weatherChartPeriod' for widget org.eclipse.smarthome.model.sitemap.Switch
[ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve visibility item weatherChartPeriod for widget org.eclipse.smarthome.model.sitemap.Webview
[ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve visibility item weatherChartPeriod for widget org.eclipse.smarthome.model.sitemap.Webview
[ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve visibility item weatherChartPeriod for widget org.eclipse.smarthome.model.sitemap.Webview

and this is the result in basic ui:

In the OH App at least the switch at the top shows “Hour Day Week” and inside the frames it gives error

net::ERR_BLOCKED_BY_RESPONSE

What am I missing? Thanks for your help and have a nice weekend!

Ok, so the net::ERR_BLOCKED_BY_RESPONSE could be solved with uncommenting “allow_embedding=true” in grafana.ini and restarting grafana-server (sudo systemctl restart grafana-server)

Somehow I still can’t get the switch to work (I don’t need it but I am curious about what the heck I am missing)

It is a icon that is missing in OH2. You can either add a icon=“none” to your sitemap-item or download the respective icon:

wget "https://raw.githubusercontent.com/elementary/icons/master/status/128/dialog-information.svg" -O /etc/openhab2/icons/classic/webview.svg
1 Like

You’ve named an Item in your sitemap that doesn’t exist in openHAB. Item names are case sensitive.

Are there any workarounds or issues which standout that could be integrated or fixed within the openHABian project?
Anyone mind summerise it for me?

Thank you - thats it!:slightly_smiling_face:

Item names are case sensitive

Damn, classical typo :smiley:
Thanks for pointing out

What’s the fastest way with curl to see if items are recording the values?

Querying the database directly with curl -G 'http://localhost:8086/query?pretty=true' --data-urlencode "db=mydb" --data-urlencode "q=SELECT * FROM \"cpu_load_short\"

otherwise using the cli is even faster. If you don’t see any response or the there are not the values that you expect, then you know that it’s not being recorded

1 Like

Hi, is there a practical way to use persistence to write to the influxdb at 23:59:59 ?

At the moment I’m using this:

Strategies {
    everyDay : "0 59 23 1/1 * ? *"
}

How can I wait another 59 seconds ?

"59 59 23 1/1 * ? *"

The first field is the second of the minute.

1 Like

Would be great if this new info could be added to the tutorial.Would save some frustrating hours especially for first time grafana users wondering why charts are not showing.Other than that the tutorial is perfect.

# set to true if you want to allow browsers to render Grafana in a <frame>, <iframe>, <embed> or <object>. default is false.
allow_embedding = true
1 Like

Would be better to trigger @ThomDietrich as he wrote the tutorial :wink: