Newbie ESPEasy to Grafana Question
Moderators: grovkillen, Stuntteam, TD-er
Newbie ESPEasy to Grafana Question
I know I should probably place this question in a Grafana forum, but I am posting it here first because I trust the members and advice in this forum.
I have worked hard to setup the ESPEasy NodeMCU to send temperature data to Node Red via MQTT and into an InfluxDB. The data is arriving into the InfluxDB successfully, however no matter how many tutorials I read and videos I watch I cannot get the data to appear in Grafana.
No doubt there will be something I am doing wrong that is probably really simple... it is driving me crazy!!
Here's a screen capture from Grafana 6.0.1, and I figure there is something in here that I have setup incorrectly? The InTemp is the table in the InfluxDB and it was automatically found.
Here's the database table... Here's the Node Red config... What am I missing?? I am open to questions and ideas, and again I appreciate any advice from the members of this forum.
I have worked hard to setup the ESPEasy NodeMCU to send temperature data to Node Red via MQTT and into an InfluxDB. The data is arriving into the InfluxDB successfully, however no matter how many tutorials I read and videos I watch I cannot get the data to appear in Grafana.
No doubt there will be something I am doing wrong that is probably really simple... it is driving me crazy!!
Here's a screen capture from Grafana 6.0.1, and I figure there is something in here that I have setup incorrectly? The InTemp is the table in the InfluxDB and it was automatically found.
Here's the database table... Here's the Node Red config... What am I missing?? I am open to questions and ideas, and again I appreciate any advice from the members of this forum.
Last edited by gregoinc on 21 Mar 2019, 22:41, edited 1 time in total.
Re: Newbie Grafana Question
Update!!
So I managed to get Grafana to display the temperature data. Had to 'hack' the query to get it to work... see below. Not pretty, and Grafana tries to change it back when I edit.
I am thinking my problems are coming from how the data is presented to the Influx database, either starting from how the data is pushed to Node-Red via MQTT or how the data is handled by Node-Red and written to the InfluxDB.
At the moment I am 'publishing' two seperate temperature data streams (InTemp and OutTemp), but am thinking it might be best to just publish a single stream with all temperature data and let InfluxDB handle the keys side of things. Have no idea how to do that, so more reading and research.
So I managed to get Grafana to display the temperature data. Had to 'hack' the query to get it to work... see below. Not pretty, and Grafana tries to change it back when I edit.
Code: Select all
SELECT * FROM "OutTemp"
At the moment I am 'publishing' two seperate temperature data streams (InTemp and OutTemp), but am thinking it might be best to just publish a single stream with all temperature data and let InfluxDB handle the keys side of things. Have no idea how to do that, so more reading and research.
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Newbie ESPEasy to Grafana Question
You should look at Telegraf to do the injection.
https://www.influxdata.com/time-series- ... /telegraf/
https://www.influxdata.com/time-series- ... /telegraf/
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
Re: Newbie ESPEasy to Grafana Question
Excuse my lack ofknowledge, but what application would Telegraf replace?
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Newbie ESPEasy to Grafana Question
It is the official way of injecting data into InfluxDB. It'll push data directly from the MQTT stream instead of doing the hack of using Node-Red.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
Re: Newbie ESPEasy to Grafana Question
Why use telegraf when you are on ESP_Easy this can inject directly into Influx.
Influx <> Grafana is the easy part
Edit:
I use the following for an temp graph:
SELECT mean("value") FROM "Living_Room_Temp" WHERE $timeFilter GROUP BY time($__interval) fill(linear)
Results in (an bit larger setup :
https://snapshot.raintank.io/dashboard/ ... DY2xWjINSK
Most data is coming from ESP units running ESP Easy or Tasmota (In case of Tasmota i push their data via Domoticz back into Influx)
Influx <> Grafana is the easy part
Edit:
I use the following for an temp graph:
SELECT mean("value") FROM "Living_Room_Temp" WHERE $timeFilter GROUP BY time($__interval) fill(linear)
Results in (an bit larger setup :
https://snapshot.raintank.io/dashboard/ ... DY2xWjINSK
Most data is coming from ESP units running ESP Easy or Tasmota (In case of Tasmota i push their data via Domoticz back into Influx)
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Newbie ESPEasy to Grafana Question
Now that's even "better"
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
Re: Newbie ESPEasy to Grafana Question
hello there,
@Prutsium: I saw the dashboard: GREAT Job !
But, how do you inject directly data from ESPEasy's MQTT into Influx, without using NodeRed ?
Thanks
Paolo
@Prutsium: I saw the dashboard: GREAT Job !
But, how do you inject directly data from ESPEasy's MQTT into Influx, without using NodeRed ?
Thanks
Paolo
Re: Newbie ESPEasy to Grafana Question
I agree the Influx / Grafana part should be easy, the problem I am dealing with is how to inject the data into Influx that makes it easier to setup Grafana. At present I am mostly focusing on injecting temperature data, but am having difficulty getting all the data in a single Influx table.
Be great if you could share some config details so I can understand the setup you are using.
Re: Newbie ESPEasy to Grafana Question
The most simple way is to use UDP (You must enable this in Influx by adding to your config of Influx:
( /etc/influxdb/influxdb.conf )
Then its a matter of setting up the ESP. Below the controller config and the device config.
These are 2 examples one with just a regular temp sensor (1) and one where i need to do some calculations in Grafana so i push more values into 1 string (2)
( /etc/influxdb/influxdb.conf )
Code: Select all
[[udp]]
enabled = true
bind-address = ":8089"
database = "ESP_Database"
These are 2 examples one with just a regular temp sensor (1) and one where i need to do some calculations in Grafana so i push more values into 1 string (2)
Re: Newbie ESPEasy to Grafana Question
Thanks to @Kinot for the reminder (actually I forgot about it )
Thanks to @prutsium for the fast, detailed & clear answer.
But, this way you don't use MQTT as the general I/O platform to know the state of variables and switch on/off commands, do you ?
Thanks & Regards
Paolo
Thanks to @prutsium for the fast, detailed & clear answer.
But, this way you don't use MQTT as the general I/O platform to know the state of variables and switch on/off commands, do you ?
Thanks & Regards
Paolo
Re: Newbie ESPEasy to Grafana Question
For sensors i dont use MQTT unless they are send by Tasmota devices as there MQTT is the best option.
But on many devices i use ESPEasy but most of them are sensor only or not supported things in Tasmota software.
So device state doesnt matter for me and as they are not switches.
Btw ... ESPEasy supports MQTT (only on the 1st controller) but this is in general one way communication.
But on many devices i use ESPEasy but most of them are sensor only or not supported things in Tasmota software.
So device state doesnt matter for me and as they are not switches.
Btw ... ESPEasy supports MQTT (only on the 1st controller) but this is in general one way communication.
Re: Newbie ESPEasy to Grafana Question
thanx for your answer, Prutsium !
Re: Newbie ESPEasy to Grafana Question
grovkillen wrote: ↑22 Mar 2019, 09:18 It is the official way of injecting data into InfluxDB. It'll push data directly from the MQTT stream instead of doing the hack of using Node-Red.
Hello
Can you share your telegraf.conf ? And the way you configured espeasy ? With Mqtt-openhab ?
I have an invalid syntax on input telegraf ..
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Newbie ESPEasy to Grafana Question
I'm now using the development setup with a router which got InfluxDB and Mosquitto which do the import.tparvais wrote: ↑05 Feb 2020, 08:31grovkillen wrote: ↑22 Mar 2019, 09:18 It is the official way of injecting data into InfluxDB. It'll push data directly from the MQTT stream instead of doing the hack of using Node-Red.
Hello
Can you share your telegraf.conf ? And the way you configured espeasy ? With Mqtt-openhab ?
I have an invalid syntax on input telegraf ..
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
Who is online
Users browsing this forum: No registered users and 3 guests