InfluxDB+Grafana persistence and graphing

Hi @controlc,
Now I am more confused. I run openHAB on a Raspberry and always log in by ssh over mac Terminal. In that Terminal session I am able to run the script in openhab2-conf/scripts with ./scriptname…

How can the mac trigger an issue here?

@Woogi: Please reread the written one - I think there is already been said. I suggest to download, configure and execute the script on your mac - not to execute the script on your raspberry via ssh from your mac terminal. Did this works?

Hi @controlc,

this did not work :frowning: Executed locally on my PC. still the same result.

### timestamps
item: Klima_hum_wz
10y:  2009-11-04T11:40:19:+0100
1y:   2018-10-07T11:40:19:+0200
1m:   2019-10-06T11:40:19:+0200
1w:   2019-10-28T11:41:19:+0100
1d:   2019-11-03T11:41:19:+0100
8h:   2019-11-04T03:41:19:+0100
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   338  100   338    0     0   3313      0 --:--:-- --:--:-- --:--:--  3313
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   338  100   338    0     0   7681      0 --:--:-- --:--:-- --:--:--  7681
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   338  100   338    0     0   7511      0 --:--:-- --:--:-- --:--:--  7511
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   338  100   338    0     0   6035      0 --:--:-- --:--:-- --:--:--  6145
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   338  100   338    0     0   5728      0 --:--:-- --:--:-- --:--:--  5728
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   338  100   338    0     0   6897      0 --:--:-- --:--:-- --:--:--  6897

### found values: 
Warning: Couldn't read data from file "Klima_hum_wz-*", this makes an empty 
Warning: POST.
HTTP/1.1 204 No Content
Content-Type: application/json
Request-Id: 7f804524-feef-11e9-9791-b827eb33e913
X-Influxdb-Build: OSS
X-Influxdb-Version: 1.7.9
X-Request-Id: 7f804524-feef-11e9-9791-b827eb33e913
Date: Mon, 04 Nov 2019 10:40:20 GMT

Sleep for 5 seconds to let InfluxDB process the data...

### delete temporary files

Hello,
I have problem with list of items in Grafana.
I se only few of my items, but I have set persistance for all items.
I use charts normally in openhab.

Now I want to use Grafana but I cant see many of my items on measurement list??
Can someone help?

This could be related to your influxdb.persist file.
If you store items only on change and lets say a lamp is not switch on/off since then, it will not get stored.
Please post your influxdb.persist file so we can further assist you.

Hey guys,

how do you handle the big data loads. My pi is getting fuller and fuller and i dont have a solution for that. i thought about saving the data on my synology nas… but i have no clou how to do that. So how are you guys doing it?

@Woogi: I couldn´t say more: The script seams to work properly in parts - the first lines with 10 years and so on shows that the date part is working. After then better ask via issue at github.

I don’t use a raspberry PI, I have a Pentium Gold VMWare Server running OpenHab in an own Instance and a different Instance I have the TIG stack (that G stands for Grafana). If your setup grows, you might want to consider growing your infrastructure :slight_smile:

But Openhab itself does not need a lot of ressources, on my 10W TDP 4 Core CPU it uses 0.01% in average :smiley: You could opt into having a different hardware for Grafana and the Influx-DB (TIG-Stack). All you need to do is change the IP address of the influx-db target in the settings of openhab

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


Items {
*: strategy = everyMinute, restoreOnStartup
}

Weird thing is that I have many items in few separate files.
And for example I see only 2 items from one file:

Group:Switch:OR(ON, OFF) ile_wlaczonych_zraszacze "Zraszacze [%d włączonych]" <sprinkler>

Switch nawadnianie_obwod1 "Strefa I - tył" <sprinkler> (ile_wlaczonych_zraszacze) { channel="mqtt:topic:833d391a:zraszacz1" , expire="30m,command=OFF" }
Switch nawadnianie_obwod2 "Strefa II - garaż" <sprinkler> (ile_wlaczonych_zraszacze) { channel="mqtt:topic:833d391a:zraszacz2" , expire="30m,command=OFF" }
Switch nawadnianie_obwod3 "Strefa III - przed domem" <sprinkler> (ile_wlaczonych_zraszacze) { channel="mqtt:topic:833d391a:zraszacz3" , expire="30m,command=OFF" }
Switch nawadnianie_obwod4 "Strefa IV - warzywa" <sprinkler> (ile_wlaczonych_zraszacze) { channel="mqtt:topic:833d391a:zraszacz4" , expire="30m,command=OFF" }

Switch SprinklerCycle "Włącz cykl 4x30min" <recznie> 
Switch SprinklerSystemSchedule "Automat co 2 dni" <automat> 

From this file I see only SprinklerCycle and SprinklerSchedule in Grafana list.

But I have normal chart maded by nawadnianie_obwod items in sitemap.

Isn’t there a space missing? Shouldn’t it be…

* : strategy = everyMinute, restoreOnStartup

but as I said before. InfluxDB is working normal.
I can make chart in sitemap, and it shows diagrams. But in grafana I cant see that items.
Like grafana has problems with reading list of items?

wird thing is when I change Items in persist file to only one item - I still see old items, and cant see the Item from persist file.

Above, there was a link to a good tool with which you can see what is stored in the database.

1 Like

Thnak You. This thing helped me a lot!

As far I know now, Grafana has limit of how many measurement is showing in drop down list.

So I managed to write code for query myself.
SELECT mean("value") FROM "pietro_czujnik_temp" WHERE $timeFilter GROUP BY time($__interval) fill(null)

Can someone help me?

Why all my charts are rendered like this (look at the gap at the left). I had this issue previously on a different hardware and setup when testing but I thought it is just a bug, but still…
This is only a 24 hour timespan and I have data way back. The openHAB default chart shows these correctly…

This is probably a limitation with InfluxDB.

see: https://github.com/influxdata/influxdb/issues/6878

The values are grouped by a specific time range.
But the previous values are not being considered and therefore the first part of the graph does not have values.

I have this too and did not find a solution yet.

Thanks!

However I didn’t mentioned but I use it with MySQL.
I can’t really understand what is wrong.
Grafana selects the right timespan, I can see it on the X axis that for example the previous 24h is set (until now) and it has this gap (which width varies as time goes by…). But when I select for example last 7 days, the whole is filled with the data (so the data is there…).

You can try to use the query inspector to see what data is being returned. Grafana displays what it gets. I’m not sure what queries MySQL allows. But you can see the query and the data it returns with the inspector. Maybe that will help? Upper right corner when editing a series.

I will try thanks!

I have installed through openhabian, but grafana does not let me login.
Neither with admin:admin nor the password I have used during the openhabian installation process.

I assume setting the password through opanhabian went wrong (was the same thing with influx).

EDIT: I needed to re install grafana manually.
After that it did work.