InfluxDB+Grafana persistence and graphing

@Woogi, what OS version is installed on your system - stretch ?
See this post and following.

1 Like

Hi Wolfgang,

thx for your reply.

I am running

##   Release = Raspbian GNU/Linux 9 (stretch)
##    Kernel = Linux 4.14.79-v7+
##  Platform = Raspberry Pi 3 Model B Rev 1.2

I’m pretty sure you have to upgrade to buster.

Hello,

I am new in grafana. I need small help.
I can insert values into influxDB, and draw graphics in realtime.
how to implement this requirement.

Example, not a real life.
I have temperature sensor, which I can read any time, and insert value into influx db.
but then I have another temperature which come with date. And I want to insert is with date an draw accurate graphic. because when I insert second sensor into influxDB, my graph is not accurate, as data I receive is little bit from the past.

Is it possible with openhab?

Ed

Follow the tutorial in the original post.

openHAB does not support this directly. You will have to insert the value yourself into the database or by interacting with the openHAB REST API.

1 Like

Hello,

that’s was my assumption. where I can find example in original post?

maybe it’s a good feature to implement. in persistence file add not just a value, but date:value ???

Ed

The first post in this thread is a complete example for how to set up InfluxDB and Grafana.

1 Like

hello.

I setup it. it’s works. but my problem is time synchronization. where I can find this exaple?

Ed

This is a bit special and openHAB does not support this. It’s more a SQL job, I think. So maybe another forum is a better (i.e. there are more people to help with this problem)

I’m using a simple bash script to import daily measurements from my photovoltaic system, but I do it to store in MariaDB and I don’t use this measurements in openHAB or Grafana


I don’t think anyone has posted an example of this because it’s usually handled outside of openHAB. As Udo indicates, you’d write a script that inserts the data into InfluxDB instead of relying on openHAB to do it.

To clarify a bit, the openHAB persistence services are not intended for general purpose database access, and do not allow arbitrary timestamping.
For openHAB, persistence is about recording (and later reading) Item states only, a snapshot of the state “now”, if you will.

You can send directly to InfluxDB using the sendHttpPostRequest and bypass the persistence. Then you can send anything you want including the timestamp. Example here of a different retention policy.

hi,
i installed via openhabian and changed /etc/grafana/grafana.ini according to the first post.
i can open the graph from a “not logged in” browser, but habpanel (frame with url = http://ip-address:3000/d-solo/3L-5BqzRk/openhab-dashboard?tab=query&orgId=1&from=now-48h&to=now&panelId=2) doesn’t show the graph:

ip-address refused the connection

as i can see the graph in another browser where i’m not logged in i think the error is with the habpanel frame, right?

edit: oh, and another thing:

To render a panel image, you must install the Grafana Image Renderer plugin. Please contact your Grafana administrator to install the plugin.

iirc the image renderer was installed on a previous openhabian setup, wasn’t it?

1 Like

Grafana deprecated that plugin quite some time ago. Now there is a separate service. See Grafana Image Renderer for a way to install and use the new separate service using Docker.

ok, i didn’t know this. thanks for the link!
i tried the simple approach, but

Error: ✗ plugin is not supported on your architecture and OS.

i have not tried the manual installation but at the moment i don’t necessarily need the image renderer.

apparently this i needed in grafana.ini so habpanel can embed graphs:
allow_embedding = true

maybe @ThomDietrich could add it in the first post?

1 Like

I did this and it looked ok installing influxdb 1.6.4-1
Unfortunately running influx does not work.
There is no such file neither in /usr/bin nor somewhere else.

Platform information:
    Hardware: RPi 4 8 GB and 32 GB micro SD + zwave: Aeotec Z-Stick Gen5 (ZW090) - UZB
    OS: Raspian which comes with openhabian 1.6a
    Java Runtime Environment: Zulu 8 (standard openhabian)
    openHAB version: 2.5.9-1 (standard openhabian)

Someone with the same issue?

EDIT: Never mind.
Found the solution in this thread:

sudo apt-get install influxdb-client

:blush:

1 Like

Hej folks,

I have recently started to set up my openHAB and get my first experiences. Even if it is certainly a question for beginners, but I hope it is properly placed here.
I would like to show the current voltage value and the current power in a Grafana diagram. For this purpose I have installed the packages for InfluxDB and Grafana via the openhabian-config. Furthermore I installed the package for the InfluxDB-client and the binding. Everything as described in the tutorial. But I have problems to implement the Influx database in Grafana. Can you tell me exactly what I have to enter in the mask? Unfortunately the picture of the tutorial is a bit old. The mask has changed since then.

Thanks for your help. I am grateful for any support.

You should enter the the credentials for the user “grafana-user” there. You created this user with openhabian-config. The user has only read access to the database.
My config looks like this. I think normally the name of the database is “openhab”:

The first time I also had some problems to connect to the database. You should try a different browser, which worked for me.

Did you already set up the persistence in openhab?

Total newbie to Grafana (installed it yesterday) so I’m trying to take my baby steps in utilizing it. As I understand it, it’s pretty straight forward to create a graph for measurements like current/instant power load(W or kW) or temperature (C or F), but what about an ever increasing value for power consumption (kWh)? Let’s say, I take a daily measurement, is it possible to create a bar chart for daily, weekly or similar power consumption - even if I don’t have the calculated daily consumption as in the example below?

You dont have to calculate anything. Grafana will do it for you
 All you have to do, is to define which periode you want to see. (ie day, week, month, year etc).