InfluxDB+Grafana persistence and graphing

In this variant, the time for displaying the graphs is significantly slowed down in the paperUI. This is normal?

I didn’t have that experience. Both scenario’s seem to have the same loading time (approx 1 second here). However, I must admit that I am still using my local network’s IP address (192.168…), so it does not go via the firewall. I still need to decide what to do about allowing WAN-access to my graphs. I haven’t figured out yet if accessing graphs over the internet is worth having another potential entry point for people with bad intentions (but that is another discussion).

Thanks @Dries, I’ve added the warning to the initial article. Maybe @pahansen wants to also add this information to his original tutorial?

Thanks @Dries the post is amended, including a small hint on how scroll bars can be hidden if they are getting in the way.

1 Like

I have two problems.
1.I can’t connect like openhab user. I must be connect like admin.
2. When I add link to my sitemap so display like on picture.

Here is how to graph minute consumption from counter, and convert kW to W (using math in Grafana)

2 Likes

Hi, Grafana version 4.3 is able to use mysql data.
I am running on raspberry Pi 2 and mysql server on localhost.

2 Likes

InfluxDB+Grafana+Raspi3+Openhabian are working great and installation with the tutorial was easy.
But I don’t understand how to display Switch-States in charts:


How do I have to configure the metrics to interpret ON/OFF as 1/0?

If you want to achieve something similar to the graph below, change the “select” and “group by” options and choose staircase in Display->Mode options

2 Likes

Hi @ThomDietrich
many thanks for tour guide.
I have running grafanda with influxdb into a docker container and thanks to your guide all working file.
Now I would like to add graph to OpenHab2 using this: https://github.com/wborn/smarthome-grafana

I have not experience with this kind of objects and I cannot understand where install code.
Can you help me?

Many Thanks

marco

Follow the Example. You will notice several folders that map to your openHAB conf folder (/etc/openhab2 for apt-get install).

You will notice an html folder which contains the HTML files, some css files, and js files. Make sure you have these files in your conf/html folder.

Use the html files as templates for how to create your own webviews and the sitemap in the sitemap folder as a template for how to add the webviews to your sitemap.

The “smarts” are in the .js and .css files.

2 Likes

hi @rlkoshak
so I don’t have to configure nothing external to penhab, like another web server? Is just enought to copy example on my conf folder?

Great, Thanks

That is all it takes. The javascript and css execute in the browser, not the server, so the built in openHAB server is more than adequate.

1 Like

Hi @rlkoshak,
I give it a quick try today and I get it work internally on my network.
It do not work externally, because OpenHab sitemap try to connect to private address. I hope OpenHab work as a proxy for webview request, but seems not.

I have grafana on an internet address, with a public name, but if called from external, grafana will ask for credential.
Is there a way to pass credential or a token inside a webview request?

Marco

You can provide the username and password as part of the URL, but then your username and password are being passed in the clear.

Beyond that I don’t know how to solve this problem.

Hi @rlkoshak
I do not found docs on how pass username and password into the URL for Grafana.
Do you have some hints?

Thanks

It is a generic HTTP feature called BasicAuth

http://user:password@url

But again, if you are going to do this you may as well not have a password as it will be passed in the clear.

Hi @rlkoshak
I make it work using a Reverse Proxy authentication for OpenHab.
Grafana is published under a folder of OH root using a reverse proxy.
I activate Grafana Reverse Proxy auth, and when I login to OH, also grafana is authenticated, and i can see graph from Browser, but not from OH Android app.
Opening the URL of the chart from chrome mobile from my phone it work. Do OH app support webview?

Thanks

Marco

As far as I have seen back when I used webviews, the Android app only supports webviews when on the LAN. It does not support them when connected through a reverse proxy/myopenhab.org.

hi @rlkoshak
thanks for help.
I’ll make some more testing.

Marco