Page 3 of 3

Re: Grafana with InfluxDB for Domoticz

Posted: Friday 20 April 2018 23:01
by sincze
ropske wrote: Thursday 19 April 2018 22:37
sincze wrote: Saturday 08 April 2017 23:56 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);
}
hi mate,
long time no see :p
just wondering if you have an 'updated' version of your influx program in php?
I want to use it also, i was writing something myself, but why writing something on my own, when there is already something existing :p
Indeed indeed
You know how to reach me my friend ;-)
Actually the current setup as shown above has been working ever since. I'm totally happy with it. Something not working for you correctly?
I moved my influxdb to a spare machine and have grafana in a docker on a synology for representing the data. So the domoticz machine is not under a lot of stress..

Re: Grafana with InfluxDB for Domoticz

Posted: Sunday 22 April 2018 23:08
by Nautilus
dlefol wrote: Thursday 19 April 2018 21:55 My repy is a bit late so hopefully you found a solution already but on my system (similar setup with RPi3, influx and Monit), I started having issues with Monit restarting domoticz regularly and unresponsive web ui too. It always seemed to coincide with the automatic backup that domoticz was doing of the database (every hours). It got worst after installing influx and I guess it's related to influx producing a lot of read and/or write on the SD card at the same time and thus making the backup of the DB longer (only a guess I can be completely wrong).
I recently bought a PiDrive (hard drive for RPi) to replace my SD card and it improved quite a lot the situation (1 or 2 monit reboot in the past couple of month at most instead of once a week maybe before). I think this is due to the hard drive having faster access time than the SD card I was using before.
I ended up moving influxdb to another RPi that I already had for another purpose. So basically never got to the bottom of this but things went back to normal after the move...:)

Re: Grafana with InfluxDB for Domoticz

Posted: Monday 23 April 2018 9:31
by ropske
ok, thanks guys.
Will try to install the influx and grafana then :)

Re: Grafana with InfluxDB for Domoticz

Posted: Saturday 18 May 2019 12:48
by Derik
He...
Weet iemand waar je met ftp de data van Influxdb kunt vinden?
Heb een nieuwe setup..
En wil graag mijn oude db terug hebben...
aangezien ik weer op mijn Xu4 zit..

Re: Grafana with InfluxDB for Domoticz

Posted: Sunday 19 May 2019 14:03
by Prutsium
Use simple way of backup:
Backup: influxd backup -portable /media/Backup/influx/
Restore: influxd restore -portable /media/NAS2/NAS2-Backup/influx/

Thats all
(Correct paths to what you prefer its the location where the backup would be made to.)