InfluxDB+Grafana persistence and graphing

influxd is the daemon (and already started… bind: address already in use)
if there is an influxd, there also should be an influx (which is the connection to the database command line)

Maybe you have to use

sudo influx

instead.

I would try this. I recently installed influxdb and got only the server and not the client on Ubuntu 18.04 server. Perhaps they have separated the server and the client in the latest package.

sudo apt-get install influxdb-client

finding the influx command was what hung me up trying to do this tutorial. Eventually I found info telling me to point my web browser at the web interface which can be found at
localhost:8083
after install
the web interface allows the creation of databases, users and permissions
hope it helps

Port 8083 for admin can work, but you need to enable it first in the influxdb.conf file in the admin section as the default is disabled. Also, it says that the interface is deprecated and will be removed in a future release.

Hope this is the correct location for my two questions …

I measure few temperatures, store the values every 5 minutes in an influxdb.
Now, the graph for 1 day (or less) view has “steps” because of less values.
But is there an option that Grafana interpolate (create a curve betwen the point) and the graph looks “smoother” ?
(Otherwise I have to save every minute the temperatues into the influxdb …)

And in Grafana under “Legend” I activate “Show” and “As table”:
But this will only show (the first) three temperature sensores I added (in the graph there are six shown, thats correct). See picture
When activating additionally “To the right”, than all six values are shown on the right part from the screen (but than the graph is to much shrinked). Is this a limitation, a Bug or a mistake on my side?

For the first question, select “connected” for the null value in the Display tab in Grafana. There’s a picture here.

1 Like

OK, for my second question I found out:
When moving over on the right part, a scroll line appear!
Without move-over there is NO hint that there are more lines!

But in my case it would bether to see all 6 lines directly, is there an option?

Hello All, i’m in need of a tiny bit of help…
I’m sure the issue will be obvious to someone, i can’t seem to put my finger on it.

I confess i ventured into installing InfluxDB and Grafana from the openhabian-config>optional components installation ( i thought: “it’s been 2 years ever since Thomas Dietrich wrote this tutorial, let’s be brave!” - btw the tutorial is definitely still relevant, so TY).
The automated setup process sets up most of the things for you, basically all there is left is to install the addon in paperui and schedule a persistence job.

I now have the follwoing situation:
Grafana says it has no issues in connecting to opehab_db from influx as datasource
image
Influx receives data from OH, as per the scheduled job, (with precision rfc3339)

…But when i go creating a graph in my first dashboard


i don’t get any result, except for a “no data points” written in the middle of the graph.

I’m sure i missed something silly (as usual for any first timer the amount of info can be overwhelming).
any pointers?
Thanks!!

EDIT: do i need to write SELECT * FROM … so influxdb CLI commands in the grafana query for it to work??
EDIT 2: i’ve tried logging into influx’s CLI with grafana’s credentials and reading the measurements, but got this error:


so i guess the automated process doesn’t do
image

EDIT for anybody who might face the same issue
if you install Grafana and InfluxDB from the automated procedure in the openhabian-config, you need to log into influx’s CLI as ‘admin’ with the ‘SuperSecretPassword123+’ you’ve set up during the process, and do the 2 GRANT commands above. otherwise it’s not going ot work XD

took me hours (-.-) XD

2 Likes

May i ask how did you achieve this?

I’m guyessing you’re feeding system stats to influxdb from somwhere…?

I’m not sure if I understand the question, but I basically just store values from Systeminfo Binding via influxdb persistance.

1 Like

XD that’s it!
didnt’ explore systeminfo yet, was checking nmon from time to time.
now with grafana makes a lot more sense.
ty!

Hi there!
How can i update Grafana? I’m on 5.1.4 - according to the grafana homepage there’s 6.0 available.
i’m trying to update because (maybe?) 6.0 solves my problem with scrollbars on habpanel :slight_smile:

cheers
Peter

Assuming you are using Debian or Ubuntu, the easiest method to upgrade Grafana is to use apt according to the instructions here: http://docs.grafana.org/installation/debian/

i’m on openhabian (raspberry),

sudo apt-get install grafana

is not working there :frowning:

You followed all of the instructions on the link to add the key? Or just tried the install? You need to follow all of the instructions:

APT Repository

Create a file /etc/apt/sources.list.d/grafana.list and add the following to it.

deb https://packages.grafana.com/oss/deb stable main

There is a separate repository if you want beta releases.

deb https://packages.grafana.com/oss/deb beta main

Use the above line even if you are on Ubuntu or another Debian version. Then add our gpg key. This allows you to install signed packages.

curl https://packages.grafana.com/gpg.key | sudo apt-key add -

Update your Apt repositories and install Grafana

sudo apt-get update
sudo apt-get install grafana

Hi,

does anyone have an idea why transparency doesn’t work, if a graph is used in HABpanel using an iframe? I don’t think that it is an issue of grafana since transparency works without problems, if the frame is opened directly. Is there any additional HABpanel or CSS setting necessary to make this work in HABpanel?

Screenshot:
grafana_transparency

relevant html snippet:

<div class="section">
  <div class="bigDash">
    <div class="top">
      <div class="icon on"><svg viewBox="0 0 48 48"><use xlink:href="/static/matrix-theme/material-icons.svg#thermometer"></use></svg></div>
      <div class="value">
        <div class="main">{{(itemValue('Thermostat_Temperatur').split(' ')[0] | number:0)}}</div>
        <div class="decimals">,{{(itemValue('Thermostat_Temperatur').split(' ')[0] | number:1).split(',')[1]}}</div>
        <div class="sub">&#176C</div>
      </div>
    </div>
    <div class="bottom">
      <div class="icon off"><svg viewBox="0 0 48 48"><use xlink:href="/static/matrix-theme/material-icons.svg#trending-neutral"></use></svg></div>
      <div class="value">{{itemValue('Thermostat_Setpoint')}}</div>
    </div>
    <div class="graph">
      <iframe src="https://<grafana-url>:3000/d-solo/000000003/habpanel?panelId=1&orgId=1&refresh=30s&tab=general&from=now-24h&to=now" width="90%" height="150" frameborder="0"></iframe>
      <div class="legend">Letzte 24h</div>
    </div>
  </div>
</div>

CSS: https://github.com/boehan/openhab-habpanel-theme-matrix/blob/master/matrix-theme.css

Any input greatly appriciated!
Hans

Hi,

I write here because after searching and searching I have not found a solution to my problem. I followed the whole tutorial and I was able to install influxdb and grafana perfectly, I even have several graphs working on my sitemap with influxdb. My problem comes with grafana. I could only enter when I installed it and after that I could not do it anymore. I have reinstalled it several times without success. It appears in my openhab web panel but when I click it it does not connect me. The truth is that I have searched and tried many things before writing here. In the log I do not see any error regarding grafana. I do not know what else to do. It may be silly and I do not see it but I have run out of ideas.
My setup is:

Hardware: Raspberry PI 3B
OS: openHABian v1.4.1
Java Runtime Environment: openjdk version “1.8.0_152”
OpenJDK Runtime Environment (Zulu Embedded 8.25.0.76-linux-aarch32hf) (build 1.8 .0_152-b76)
OpenJDK Client VM (Zulu Embedded 8.25.0.76-linux-aarch32hf) (build 25.152-b76, m ixed mode, Evaluation)

Grafana’s version is the last.


If anyone could advise me, I would appreciate it. Thank you so much for everything. Regards:)

Hi @frifru, see my response in the other thread.

Not sure if this was picked up in the very long thread but though it might be useful to point out that, to insert a grafana panel into a sitemap, what I found worked was:

  1. Open the panel you have set up in the grafana dashboard e.g.
    image
  2. Click on “share”:
  3. Click on “Direct link rendered image”.
  4. This should launch a new browser tab with the chart displayed again. Copy the url of the page.
  5. Insert a line into your sitemap as
Image refresh=60000 url="the url copied".

I think possibly you will need to edit the time frame in the url as described in the post.

Thank you so much for sharing this useful information.