Newbie ESPEasy to Grafana Question

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
gregoinc
Normal user
Posts: 41
Joined: 21 Jan 2019, 06:08
Location: Australia

Newbie ESPEasy to Grafana Question

#1 Post by gregoinc » 21 Mar 2019, 09:13

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.
Grafana.jpg
Grafana.jpg (39.09 KiB) Viewed 1473 times
Here's the database table...
InfluxDB Config.jpg
InfluxDB Config.jpg (56.9 KiB) Viewed 1466 times
Here's the Node Red config...
Node-Red Config.jpg
Node-Red Config.jpg (51.5 KiB) Viewed 1466 times
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.

gregoinc
Normal user
Posts: 41
Joined: 21 Jan 2019, 06:08
Location: Australia

Re: Newbie Grafana Question

#2 Post by gregoinc » 21 Mar 2019, 22:28

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.

Code: Select all

SELECT * FROM "OutTemp"
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.

User avatar
grovkillen
Core team member
Posts: 3330
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Newbie ESPEasy to Grafana Question

#3 Post by grovkillen » 22 Mar 2019, 05:44

You should look at Telegraf to do the injection.

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 :idea: :idea: :idea:

gregoinc
Normal user
Posts: 41
Joined: 21 Jan 2019, 06:08
Location: Australia

Re: Newbie ESPEasy to Grafana Question

#4 Post by gregoinc » 22 Mar 2019, 06:57

Excuse my lack ofknowledge, but what application would Telegraf replace?

User avatar
grovkillen
Core team member
Posts: 3330
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Newbie ESPEasy to Grafana Question

#5 Post by grovkillen » 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.
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 :idea: :idea: :idea:

Prutsium
Normal user
Posts: 39
Joined: 29 Mar 2018, 15:39
Location: Germany / Netherlands

Re: Newbie ESPEasy to Grafana Question

#6 Post by Prutsium » 22 Mar 2019, 14:02

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)

User avatar
grovkillen
Core team member
Posts: 3330
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Newbie ESPEasy to Grafana Question

#7 Post by grovkillen » 22 Mar 2019, 15:30

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 :idea: :idea: :idea:

pppp33
Normal user
Posts: 67
Joined: 25 Oct 2015, 17:53

Re: Newbie ESPEasy to Grafana Question

#8 Post by pppp33 » 24 Mar 2019, 11:01

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

gregoinc
Normal user
Posts: 41
Joined: 21 Jan 2019, 06:08
Location: Australia

Re: Newbie ESPEasy to Grafana Question

#9 Post by gregoinc » 24 Mar 2019, 23:10

pppp33 wrote:
24 Mar 2019, 11:01
But, how do you inject directly data from ESPEasy's MQTT into Influx, without using NodeRed ?
I was wondering the same thing?

gregoinc
Normal user
Posts: 41
Joined: 21 Jan 2019, 06:08
Location: Australia

Re: Newbie ESPEasy to Grafana Question

#10 Post by gregoinc » 24 Mar 2019, 23:15

Prutsium wrote:
22 Mar 2019, 14:02
Why use telegraf when you are on ESP_Easy this can inject directly into Influx.
Influx <> Grafana is the easy part
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.

kimot
Normal user
Posts: 170
Joined: 12 Oct 2017, 20:46

Re: Newbie ESPEasy to Grafana Question

#11 Post by kimot » 24 Mar 2019, 23:34

@gregoinc and ppp33

Maybe wiki helps?

https://www.letscontrolit.com/wiki/inde ... dvanced.29

Prutsium
Normal user
Posts: 39
Joined: 29 Mar 2018, 15:39
Location: Germany / Netherlands

Re: Newbie ESPEasy to Grafana Question

#12 Post by Prutsium » 25 Mar 2019, 08:34

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 )

Code: Select all

[[udp]]
enabled = true
bind-address = ":8089"
database = "ESP_Database"
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)
Image
Image
Image
Image

pppp33
Normal user
Posts: 67
Joined: 25 Oct 2015, 17:53

Re: Newbie ESPEasy to Grafana Question

#13 Post by pppp33 » 25 Mar 2019, 13:39

Thanks to @Kinot for the reminder (actually I forgot about it :oops: )
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

Prutsium
Normal user
Posts: 39
Joined: 29 Mar 2018, 15:39
Location: Germany / Netherlands

Re: Newbie ESPEasy to Grafana Question

#14 Post by Prutsium » 25 Mar 2019, 15:02

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.

pppp33
Normal user
Posts: 67
Joined: 25 Oct 2015, 17:53

Re: Newbie ESPEasy to Grafana Question

#15 Post by pppp33 » 25 Mar 2019, 20:22

thanx for your answer, Prutsium !

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 11 guests