Page 2 of 3
Re: Grafana with InfluxDB for Domoticz
Posted: Sunday 09 April 2017 0:43
by Trigun
Ok; sounds great! I am a php noob though but I'll definitely check it out! For now I only need the function to send data to the influx db. So I can use it in grafana.
Sent from my iPhone using Tapatalk
Re: Grafana with InfluxDB for Domoticz
Posted: Wednesday 12 April 2017 0:04
by grubstake
by Trigun » Saturday 08 April 2017 23:29
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?
I am running Domoticz version
3.6708 2017/02/14. The Influx data push code was significantly changed in this version and the timestamps data is not correctly loaded. There is no adjustable configuration for the timestamp in this version.
All my sensor data are loading into InfluxDB with no problem using the Influx data push. Unfortunately, without usable timestamps
I also spent many hours trying to configure HTTP push. Unfortunately, the problem is exactly opposite...the timestamps work perfectly, but I have been unable to get the data elements required to work.
In this thread I detailed my issues.
https://www.domoticz.com/forum/viewtopi ... 28&t=16108
I am not surprised if earlier versions of InfluxDB push and HTTP push are working differently.
Has ANYONE using Domoticz 3.6.08 + been successful using Influx Data Push? I would be happy to be proven wrong, but I've spent nearly two days trying to resolve this problem.
Please include your Domoticz
version number, at the top left of your screen below the Domoticz logo, if you reply with any information.
Re: Grafana with InfluxDB for Domoticz
Posted: Sunday 30 April 2017 0:37
by Trigun
Hi grubstake, allthough i am sending my data to the influx db via php now, I did use the http push within domoticz 3.587 for quite a while without any issues. Perhaps it's a version issue? I did see that in the featurelist for the new version the http push has been re-developed. I suggest try to run the last stable version 3.587 see how that works out.
Sent from my iPhone using Tapatalk
Re: Grafana with InfluxDB for Domoticz
Posted: Wednesday 21 June 2017 13:22
by kijdhfcjdks
Hi, I have InfluxDB and Grafana working on a Raspberry Pi 3. Thought I'd dump the complete instructions as it may save someone some time.
Domoticz: 3.5877
Influxdb: 1.2.4
Grafana: 4.1.2
Install InfluxDB
Code: Select all
sudo apt-get update
sudo apt-get upgrade
wget https://dl.influxdata.com/influxdb/releases/influxdb_1.2.4_armhf.deb
sudo dpkg -i influxdb_1.2.4_armhf.deb
sudo nano /etc/influxdb/influxdb.conf
Uncomment and set these options:
Code: Select all
[admin]
# Determines whether the admin service is enabled.
enabled = true
# The default bind address used by the admin service.
bind-address = ":8083"
[http]
# Determines whether HTTP endpoint is enabled.
enabled = true
# The bind address used by the HTTP service.
bind-address = ":8086"
Start InfluxDB with:
Go to: http://[IP]:8083/
CREATE DATABASE "domoticz"
Setup the user (domoticz/domoticz) in InfluxDB Connection Settings:

- influxsettings.png (43.33 KiB) Viewed 10771 times
In Domoticz go to: Setup => Settings => Data Push => HTTP Link
Use the following URL:
Code: Select all
http:// [IP]:8086/write?db=domoticz&u=domoticz&p=domoticz&precision=ms
Setup the sensors like in this screenshot (device_+"Target Variable" will be the table name in InfluxDB:

- domoticz-httplink.png (370.8 KiB) Viewed 10771 times
Verify that there's data in the relevant InfluxDB table, e.g. SELECT * FROM deviceX
Grafana install
Code: Select all
wget https://github.com/fg2it/grafana-on-raspberry/releases/download/v4.1.2/grafana_4.1.2-1487023783_armhf.deb
sudo apt-get install -y adduser libfontconfig
sudo dpkg -i grafana_4.1.2-1487023783_armhf.deb
Add this to /etc/rc.local
Access at:
http:// [IP]:3000
admin/admin
Add datasource

- grafana.png (76.93 KiB) Viewed 10771 times
Create a Dashboard.
Done!
Re: Grafana with InfluxDB for Domoticz
Posted: Monday 31 July 2017 15:50
by Number8
Hello
I can't get influxdb working, could someone give me a hand, see this thread:
viewtopic.php?f=6&t=18619
Thank you
Re: Grafana with InfluxDB for Domoticz
Posted: Monday 31 July 2017 21:49
by sincze
kijdhfcjdks wrote:Hi, I have InfluxDB and Grafana working on a Raspberry Pi 3. Thought I'd dump the complete instructions as it may save someone some time.
Domoticz: 3.5877
Influxdb: 1.2.4
Grafana: 4.1.2
...
Done!
This is very nice Wiki material

Re: Grafana with InfluxDB for Domoticz
Posted: Tuesday 01 August 2017 19:03
by wergeld
kijdhfcjdks wrote:Hi, I have InfluxDB and Grafana working on a Raspberry Pi 3. Thought I'd dump the complete instructions as it may save someone some time...
I followed this tutorial and it worked great!
I find InfluxDB to be a pain though if you need to remove a data point (like, you can't actually delete it - you have to add in a new value with the same timestamp). Grafana is very interesting - just wish there was better SQL Server integration as that is what I have most of my data in (I am a data scientists by trade).
Re: Grafana with InfluxDB for Domoticz
Posted: Sunday 10 September 2017 18:36
by gizmocuz
InfluxDB is a great database, and once correctly setup, it's a no-brainer.
True... a native grafana->domoticz implementation would be great!
These days it is very easy to install everything via a 'docker' , for instance with portainer.io on a modern odroid uc4
Re: Grafana with InfluxDB for Domoticz
Posted: Saturday 30 September 2017 17:58
by kurniawan77
Is it possible to "PUT" my data from the past three years into influxdb?
Re: Grafana with InfluxDB for Domoticz
Posted: Sunday 29 October 2017 8:00
by dlefol
Hello,
Did you find a way to push your past data into Influx ? I'm starting to look at Influx and would like to push my historic data too.
Cheers
Re: Grafana with InfluxDB for Domoticz
Posted: Sunday 29 October 2017 8:51
by gizmocuz
you could make a bash script for this... it won't be easy
Re: Grafana with InfluxDB for Domoticz
Posted: Monday 13 November 2017 21:05
by Derik
Dear all.
Do i need to install Grafan on the same hardware where is domoticz is on running?
Or can i run on a other [ slave ] domoticz device..?
Grafana with InfluxDB for Domoticz
Posted: Monday 13 November 2017 21:08
by Trigun
you can run it on any device as long as you point the data towards the device on which the database is running and just point Grafana to the dB server
Those two can be on the same server by the way
Sent from my iPhone using Tapatalk
Re: Grafana with InfluxDB for Domoticz
Posted: Tuesday 14 November 2017 8:56
by CaesarPL
It doesn't have to be domoticz, at all. My goal this week is to install it next to Max2play

Re: Grafana with InfluxDB for Domoticz
Posted: Wednesday 22 November 2017 8:54
by thorian
Couple of notes:
- the 'old HTTP Send' still works very well with newest Domoticz
- the ESPEasy software has now Advanced Generic HTTP which allows direct InfluxDB update, works along the Domoticz or/and MQTT update
Re: Grafana with InfluxDB for Domoticz
Posted: Tuesday 28 November 2017 23:49
by glsf91
In stable version de Data push influxdb is working.
Should data push influxdb in beta (3.8755) work?
I don't see anything in log when Debug to logfile is on.
Edit: suddenly it is working. Forget this please.
Re: Grafana with InfluxDB for Domoticz
Posted: Saturday 30 December 2017 18:48
by glsf91
Is InflluxDB not working with Xiaomi temperature sensor (through gateway)?
I don't see anything in InfluxDB or Influxlink messages in the logfile.
Other temperature sensor (by RF) are working.
Edit: Temperature sensor is not working with influxdb. But the combined Tem+Humidity sensor is working with influxdb.
Re: Grafana with InfluxDB for Domoticz
Posted: Monday 01 January 2018 22:10
by Nautilus
I installed a couple of days ago Influxdb (latest version so also needed to install Chronograf) and started using the native integration with 5+ temp sensors. That is the only bigger change in my setup (RPi3, latest Domoticz beta) for a few weeks and I've now witnessed unresponsive web gui about every six hours (Monit restarts Domoticz if it cannot fetch the json url for status but from the logs it seems that Domoticz keeps running normally and no errors in the log) and CPU usage has gone from avg 2% to 5% while RAM usage has increased from 10-15% range to 20-25% (as recorded by the internal hardware sensors in Domoticz).
Before these changes Domoticz would have an uptime of 1-5 days at least (not sure why it has not been longer than that for a few months now, maybe related to the memory leakage) so change is quite clear. Has anyone else witnessed something like this and any pointer of how to make it more stable?
Re: Grafana with InfluxDB for Domoticz
Posted: Thursday 19 April 2018 21:55
by dlefol
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.
Re: Grafana with InfluxDB for Domoticz
Posted: Thursday 19 April 2018 22:37
by ropske
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