Page 1 of 3

Grafana with InfluxDB for Domoticz

Posted: Tuesday 27 December 2016 20:17
by thorian
Easy to start and implement description of running all on single device: https://blog.jokielowie.com/en/2016/11/ ... e-wykresy/

Re: Grafana with InfluxDB for Domoticz

Posted: Sunday 01 January 2017 17:43
by remb0
Great work! works nice..
maybe somethin to place also in our wiki?

Re: Grafana with InfluxDB for Domoticz

Posted: Saturday 07 January 2017 17:07
by thorian
Let me know where - I'll re-write it for Wiki style.

Re: Grafana with InfluxDB for Domoticz

Posted: Wednesday 11 January 2017 14:36
by arraWX
The wiki entry https://www.domoticz.com/wiki/HttpLink explains how to integrate Domoticz with InfluxDB and Grafana. However, the information given there seems somewhat outdated.

thorian, your blog entry was very helpful to me when I recently suceeded to integrate domoticz with influxdb on my rpi 3. Thanks for sharing!

In order to install influxdb on rpi 3 I followed the instructions for Debian users given here https://docs.influxdata.com/influxdb/v1 ... tallation/ This procedure seems even more simple compared to the procedure outlined in thorian's blog entry.

Re: Grafana with InfluxDB for Domoticz

Posted: Wednesday 11 January 2017 15:09
by thorian
Grafana is developing fast, so the entry is getting outdated. Thanks for the easier way @arraWX.

Re: Grafana with InfluxDB for Domoticz

Posted: Sunday 15 January 2017 23:25
by thorian
remb0 wrote:Great work! works nice..
maybe somethin to place also in our wiki?
Checked into wiki, I think the best way would be to provide additional new entry with updated information and alternative data entry for grafana.

Re: Grafana with InfluxDB for Domoticz

Posted: Wednesday 29 March 2017 22:16
by Trigun
Hey Guys,
I just ran into this topic and seems promising. I was looking for something like this to create a dashboard for having a Live look at my power usage, tempeature etc.
i managed to install influx en grafana but as mentioned above the Wiki is a bit outdated. I am having trouble with setting up domoticz and being able to actually send data to influx. is there a chance someone can help me out?

thanks in advance!

Re: Grafana with InfluxDB for Domoticz

Posted: Thursday 30 March 2017 22:36
by sincze
I'm very happy with the possibilities of Influx and Grafana.

General overview
Grafana.JPG
Grafana.JPG (82.02 KiB) Viewed 20774 times
Monitor the CV
Grafana-OTGW.JPG
Grafana-OTGW.JPG (97.96 KiB) Viewed 20773 times
Monitoring Ziggo
Grafana-Ziggo.JPG
Grafana-Ziggo.JPG (43.85 KiB) Viewed 20773 times

Re: Grafana with InfluxDB for Domoticz

Posted: Sunday 02 April 2017 12:56
by Jeff
sincze wrote:I'm very happy with the possibilities of Influx and Grafana.

General overview
Grafana.JPG
Monitor the CV
Grafana-OTGW.JPG
Monitoring Ziggo
Grafana-Ziggo.JPG
Just out of curiosity, How did you manage to implement the Ziggo speedtest into grafana ?

Re: Grafana with InfluxDB for Domoticz

Posted: Sunday 02 April 2017 19:00
by sincze
Jeff wrote:
sincze wrote:I'm very happy with the possibilities of Influx and Grafana.

General overview
Grafana.JPG

Monitor the CV
Grafana-OTGW.JPG

Monitoring Ziggo
Grafana-Ziggo.JPG
Just out of curiosity, How did you manage to implement the Ziggo speedtest into grafana ?
I found the instructions somewhere here in the forum and thought it was a nice feature.
https://www.domoticz.com/wiki/Bash_-_Sp ... monitoring

And I just read the file that is creates.
After retrieving the data from the file it is just as any other value. Dump it into InfluxDB ;-) and access via Grafana.

Re: Grafana with InfluxDB for Domoticz

Posted: Wednesday 05 April 2017 21:13
by Trigun
Hi Jeff and sincze,

is there a chance you are able to help me out showing my P1 meter data in Grafana?
I already have everything up and running, within domoticz it works perfectly but I can't seem to get it to work in Grafana.
I am using Grafana in combination with Influx.

Thanks!

oh yeah, I also saw the wiki being outdated perhaps this might help.

Code: Select all

sudo apt-get update
sudo apt-get upgrade

Install INFLUXDB
	wget https://repos.influxdata.com/debian/pool/stable/i/influxdb/influxdb_1.2.1-1_armhf.deb
	sudo dpkg -i influxdb_1.2.1-1_armhf.deb
		
-- start the service
	sudo service influxd start

-- run the CLI
	influx

install GRAFANA	(only for raspberry pi 2 and pi 3)

sudo apt-get install adduser libfontconfig
curl -L https://github.com/fg2it/grafana-on-raspberry/releases/download/v4.0.1/grafana_4.0.1-1480722482_armhf.deb -o /tmp/grafana_4.0.1-1480722482_armhf.deb
sudo dpkg -i /tmp/grafana_4.0.1-1480722482_armhf.deb
sudo apt-get update
sudo apt-get install grafana

to start Grafana:
	sudo /bin/systemctl start grafana-server
create database and setup domoticz

Re: Grafana with InfluxDB for Domoticz

Posted: Saturday 08 April 2017 23:18
by grubstake
The InfluxDB data push on Domoticz is broken, dates do not load correctly in InfluxDB, putting them out of range and resulting in empty charts in Grafana even though it has a connection with the database.

Don't waste your time trying to get this to work until the data push is fixed.

Re: Grafana with InfluxDB for Domoticz

Posted: Saturday 08 April 2017 23:29
by Trigun
grubstake wrote:The InfluxDB data push on Domoticz is broken, dates do not load correctly in InfluxDB, putting them out of range and resulting in empty charts in Grafana even though it has a connection with the database.

Don't waste your time trying to get this to work until the data push is fixed.
Hi, I checken the outcome in domoticz and grafana with influx seem to work fine. I believe it's a matter of configuration. How do you know it's broken?


Sent from my iPhone using Tapatalk

Re: Grafana with InfluxDB for Domoticz

Posted: Saturday 08 April 2017 23:30
by sincze
It should still be possible with httplink right?

Re: Grafana with InfluxDB for Domoticz

Posted: Saturday 08 April 2017 23:39
by Trigun
In the latest domoticz version the influx data push option is not there anymore. I am running on 3.5877. I used the option with httplink and it works indeed


Sent from my iPhone using Tapatalk

Re: Grafana with InfluxDB for Domoticz

Posted: Saturday 08 April 2017 23:44
by sincze
in the beta 3.7266 inflixdb is available.
However currently I am not using it.
Last time I used it it was still working. So currrently can not confirm nor deny the functionality.

Re: Grafana with InfluxDB for Domoticz

Posted: Saturday 08 April 2017 23:48
by Trigun
@ Sincze, are you also using a seperate query to generate info from influx to Grafana ? Still no luck with the power graphs from the smart meter. Grtz


Sent from my iPhone using Tapatalk

Re: Grafana with InfluxDB for Domoticz

Posted: Saturday 08 April 2017 23:56
by sincze
I use Pass2PHP ;-0

Code: Select all

<?php

        $input = ($s['Electra']);
        $meter = explode(";",$input);
        
        influxdb("Electra_Usage",$meter[4]);
        influxdb("Electra_Return",$meter[5]);
And dump the data straight into influxdb.

If you would use Pass2Php the function could looks like:

Code: Select all

function influxdb($device,$value)
{
// FAMOUS STRING REPLACEMENT UTILITY
    if (strpos($device, " ") !== false) { $device=str_replace(" ","_",$device); }
// ENDOF FAMOUS STRING REPLACEMENT UTILITY
   $postdata = ("device_$device value=$value ".system('date +%s%N'));
//   lg('InluxDB Data: '.$postdata);

    $opts = array('http' =>
        array(
            'method'  => 'POST',
            'header'  => 'Content-Type:application/octet-stream',
            'content' => $postdata
        )
    );

    $context  = stream_context_create($opts);
    $result = file_get_contents('http://192.*.*.*:8086/write?db=domoticz', false, $context);
}

Re: Grafana with InfluxDB for Domoticz

Posted: Sunday 09 April 2017 0:13
by Trigun
This might actually be solution. Would like to try it but am not really familiar with using these scripts in domoticz. Can you let me know how to set this up? would like to try it and compare it with the httplink output.


Sent from my iPhone using Tapatalk

Re: Grafana with InfluxDB for Domoticz

Posted: Sunday 09 April 2017 0:21
by sincze
No worries. we started a thread here: https://www.domoticz.com/forum/viewtopic.php?t=12343

Requires some patience however... no more "script ... over 10 seconds... " messages in your domoticz log. This really speeds up domoticz bigtime. Especially if you have complicated scripts (example: show ip camera on all devices that are switched on in your home when doorbell is pressed and send images via telegram to the mobile phones of the family members)..