Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. General Discussion
  3. Awesome tutorial on MQTT Node Red

Awesome tutorial on MQTT Node Red

Scheduled Pinned Locked Moved General Discussion
27 Posts 5 Posters 10.7k Views 6 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • YveauxY Yveaux

    @neverdie said in Awesome tutorial on MQTT Node Red:

    1. dumping everything into a mysql database, so everything gets logged forever (storage is cheap).

    Skip the relational databases and pick a time series database like influxdb to store your data.
    You'll thank me in the end!

    gohanG Offline
    gohanG Offline
    gohan
    Mod
    wrote on last edited by
    #9

    @yveaux why is that? I never used influxdb

    1 Reply Last reply
    0
    • scalzS Offline
      scalzS Offline
      scalz
      Hardware Contributor
      wrote on last edited by scalz
      #10

      @gohan
      it's about scale, resources etc. I'm sure there are lot of explanations on google.
      Shortly because time series database are more efficient to process metrics, and we use lot of metrics with our HA.)
      Time series database can process faster big amount of timed data. data indexed by time, these database finally are mostly used for INSERT queries. as the metrics doesn't need to be updated.

      Relational database are better fit for transactions. more indexes, better for UPDATE queries etc.
      Relational databases can show their limits for graphing, dashboards, with big amount of data. (Example monitoring servers, sensors etc each seconds can represents lot of data after a year). Their SQL can looks a bit more complex for some people (JOIN etc).

      I would use relational database for managing collection of devices, or CRM applications for example (mysql etc). And I would use time serie database (influxdb) for graphing, dashboards of metrics.

      I'm former IT dev with relational databases (and I don't work in this field anymore), so not expert on time serie database. I started using influxdb for my HA. I remember first time I read about it, I thought "wowow what's that! Data will look messy" LOL But that's because I was still thinking relational database in my head, and not metrics..
      That's just my point of view on this, I think it makes sense, maybe I'm wrong :)

      @NeverDie you should try nodered/influxdb/grafana for your metrics. Domoticz or others for supervision ;)

      gohanG 1 Reply Last reply
      2
      • NeverDieN Offline
        NeverDieN Offline
        NeverDie
        Hero Member
        wrote on last edited by NeverDie
        #11

        Any favorite arduino MQTT libraries to enable an ESP8266 to send MQTT directly to Mosquitto on the Pi? I was going to let ESP-LINK handle it, but it appears that it can publish to only one topic, and so it seems cleaner to send to the proper topic in the first place rather than re-process it later.

        1 Reply Last reply
        0
        • NeverDieN Offline
          NeverDieN Offline
          NeverDie
          Hero Member
          wrote on last edited by
          #12

          Correction: I guess ESP-LINK can do it after all: https://github.com/jeelabs/el-client

          1 Reply Last reply
          0
          • NeverDieN Offline
            NeverDieN Offline
            NeverDie
            Hero Member
            wrote on last edited by NeverDie
            #13

            And I'm glad it is so, because I already have a shield for that:
            https://www.openhardware.io/view/491/PA-LNA-nRF52832-ESP-LINK-Shield-for-Wemos-D1-Mini-ESP8266 :)

            1 Reply Last reply
            0
            • scalzS scalz

              @gohan
              it's about scale, resources etc. I'm sure there are lot of explanations on google.
              Shortly because time series database are more efficient to process metrics, and we use lot of metrics with our HA.)
              Time series database can process faster big amount of timed data. data indexed by time, these database finally are mostly used for INSERT queries. as the metrics doesn't need to be updated.

              Relational database are better fit for transactions. more indexes, better for UPDATE queries etc.
              Relational databases can show their limits for graphing, dashboards, with big amount of data. (Example monitoring servers, sensors etc each seconds can represents lot of data after a year). Their SQL can looks a bit more complex for some people (JOIN etc).

              I would use relational database for managing collection of devices, or CRM applications for example (mysql etc). And I would use time serie database (influxdb) for graphing, dashboards of metrics.

              I'm former IT dev with relational databases (and I don't work in this field anymore), so not expert on time serie database. I started using influxdb for my HA. I remember first time I read about it, I thought "wowow what's that! Data will look messy" LOL But that's because I was still thinking relational database in my head, and not metrics..
              That's just my point of view on this, I think it makes sense, maybe I'm wrong :)

              @NeverDie you should try nodered/influxdb/grafana for your metrics. Domoticz or others for supervision ;)

              gohanG Offline
              gohanG Offline
              gohan
              Mod
              wrote on last edited by
              #14

              @scalz I am from IT too and I work with databases in the past and I saw you can do many things with a SQL database, you can optimize it for different tasks. Of course the db on its own doesn't have dashboards and reports but you need an external tool for them. I agree that if you have a raspberry you would prefer a lightweight database.

              YveauxY 1 Reply Last reply
              1
              • scalzS Offline
                scalzS Offline
                scalz
                Hardware Contributor
                wrote on last edited by scalz
                #15

                @gohan
                I know. and I also remember seeing some crazy slow sql queries, needing optimizations, sometimes not without pain etc.
                but with internet, iot.. datas increase each year. I think nosql databases have been created to be more flexible in this case.

                I'm "old school" on this too, so I still like the relational schema, sql.. but Imho it's better to choose the db regarding the usecase. Each (nosql and sql db) have their pros and cons.
                I also use influxdb/grafana couple because of the points you mentioned, and it can make very nice graph.

                Looks like since a few years, there is a nosql fashion, which won't stop with Big Data :)

                That would be fun to see a benchmark, with thousands of datas, read/writes, of metrics, for the same task, influxdb vs mysql. (I think I know which one would win for simple metrics..)

                Old docs about influxdb (you can find a lot more docs about sql vs nosql, their usecase, and admins choice)

                • https://docs.influxdata.com/influxdb/v0.10/concepts/insights_tradeoffs/
                • https://grafana.com/blog/2015/01/07/influxdb-first-impressions/
                1 Reply Last reply
                1
                • gohanG gohan

                  @scalz I am from IT too and I work with databases in the past and I saw you can do many things with a SQL database, you can optimize it for different tasks. Of course the db on its own doesn't have dashboards and reports but you need an external tool for them. I agree that if you have a raspberry you would prefer a lightweight database.

                  YveauxY Offline
                  YveauxY Offline
                  Yveaux
                  Mod
                  wrote on last edited by
                  #16

                  @gohan You probably want to graph your data. Especially when combining different datasets, sampled asynchronous at non equidistant intervals you will have a lot of trouble plotting it when it is stored in a standard relational database like MySQL.
                  Time series databases are perfectly fit for sensor data from different sources, like your MySensors network.
                  Tools like Grafana and Influxdb make the perfect combination for this!

                  http://yveaux.blogspot.nl

                  1 Reply Last reply
                  2
                  • gohanG Offline
                    gohanG Offline
                    gohan
                    Mod
                    wrote on last edited by
                    #17

                    As I said before I never used influxdb and grafana, but it is in my to do list so I am just asking some questions as I "grew up" working most of the times on SQL server

                    YveauxY 1 Reply Last reply
                    0
                    • NeverDieN Offline
                      NeverDieN Offline
                      NeverDie
                      Hero Member
                      wrote on last edited by NeverDie
                      #18

                      The above motivated me to put together this upgraded board for nRF52832 and ESP-LINK. This particular fork is not perfected, but it is better than the board I previously posted in that the nRF52832 can be programmed from the top, without having to unplug it from the Wemos:
                      0_1513363273522_upgrade1.jpg
                      0_1513363320334_upgrade2.jpg

                      1 Reply Last reply
                      0
                      • NeverDieN Offline
                        NeverDieN Offline
                        NeverDie
                        Hero Member
                        wrote on last edited by
                        #19

                        Connection to Mosquitto on the Pi can be configured through a webpage presented by ESP-LINK from the ESP8266 :
                        0_1513364912472_esplink_mqtt.png

                        1 Reply Last reply
                        0
                        • gohanG gohan

                          As I said before I never used influxdb and grafana, but it is in my to do list so I am just asking some questions as I "grew up" working most of the times on SQL server

                          YveauxY Offline
                          YveauxY Offline
                          Yveaux
                          Mod
                          wrote on last edited by
                          #20

                          @gohan said in Awesome tutorial on MQTT Node Red:

                          As I said before I never used influxdb and grafana, but it is in my to do list so I am just asking some questions as I "grew up" working most of the times on SQL server

                          I understand. I also grew up with relational databases and did my first iot steps with them too. Then I found influxdb and never want to go back!

                          Just sharing my enthusiasm and hoping to spare you time by making the switch now ;-)

                          http://yveaux.blogspot.nl

                          1 Reply Last reply
                          4
                          • NeverDieN Offline
                            NeverDieN Offline
                            NeverDie
                            Hero Member
                            wrote on last edited by
                            #21

                            Guys,
                            How are you getting your data into the influxdb and grafana? Are you using Node Red, Domoticz plug-ins, or some other method?

                            1 Reply Last reply
                            0
                            • scalzS Offline
                              scalzS Offline
                              scalz
                              Hardware Contributor
                              wrote on last edited by
                              #22

                              on my side, I'm injecting data from node-red to influxdb, grafana is connected to influxdb. my controller is also on the same rpi (v3, with ssd). I'm planning to add some grafana graph to my controller dashboard (because I prefer my controller for dashboards).

                              NeverDieN 1 Reply Last reply
                              1
                              • scalzS scalz

                                on my side, I'm injecting data from node-red to influxdb, grafana is connected to influxdb. my controller is also on the same rpi (v3, with ssd). I'm planning to add some grafana graph to my controller dashboard (because I prefer my controller for dashboards).

                                NeverDieN Offline
                                NeverDieN Offline
                                NeverDie
                                Hero Member
                                wrote on last edited by NeverDie
                                #23

                                @scalz said in Awesome tutorial on MQTT Node Red:

                                I prefer my controller for dashboards

                                Why? Also, which controller are you using?

                                1 Reply Last reply
                                0
                                • scalzS Offline
                                  scalzS Offline
                                  scalz
                                  Hardware Contributor
                                  wrote on last edited by scalz
                                  #24

                                  @NeverDie
                                  with nodered, you can also do some UI with nodered-contrib-ui. and use grafana for graphing for example. Some people do that. without any additional controller like domoticz. for simplicity I think, nodered as standalone controller.

                                  I'm using Jeedom. It's french opensource sw. There is multilanguage but not sure if it's very complete unfortunately.. never tried to change the language.
                                  It provides a nice and easy way to design custom designs for nice UI, without code, else it's not very hard to add some piece of html/css too .
                                  If I wanted to do the same, with nodered as standalone controller and some external package for ui, or from scratch, I would have to reinvent the wheel to get the same UI (no time).
                                  Of course I'm not using an additional controller just for that, but also for plugins :) (again no wheel to reinvent)

                                  I should have said UI instead of dashboard. what I meant is I just want to have access to everything from one place (UI) and not struggle between urls.

                                  note: you'll need linux socat command. for serial->nodered->domoticz
                                  there is a link in the forum, in nodered section I think

                                  1 Reply Last reply
                                  0
                                  • gohanG Offline
                                    gohanG Offline
                                    gohan
                                    Mod
                                    wrote on last edited by
                                    #25

                                    If you have ethernet or mqtt gateway it is easier to connect more controllers at the same time :-)

                                    NeverDieN 1 Reply Last reply
                                    1
                                    • gohanG gohan

                                      If you have ethernet or mqtt gateway it is easier to connect more controllers at the same time :-)

                                      NeverDieN Offline
                                      NeverDieN Offline
                                      NeverDie
                                      Hero Member
                                      wrote on last edited by NeverDie
                                      #26

                                      @gohan said in Awesome tutorial on MQTT Node Red:

                                      If you have ethernet or mqtt gateway it is easier to connect more controllers at the same time :-)

                                      Yeah, I'm assuming that if each gateway is connected to the same MQTT broker, and the same with each controller (if there's more than one, that is), then you can mix and match however you want. In theory anyway. I haven't done it yet, so maybe there are gotcha's along the way.

                                      1 Reply Last reply
                                      0
                                      • NeverDieN Offline
                                        NeverDieN Offline
                                        NeverDie
                                        Hero Member
                                        wrote on last edited by NeverDie
                                        #27

                                        Now that @nca78 has brought it up, has anyone here looked into somehow integrating TensorFlow, or something like it, into their home automation? Other than replicating the Nest thermostat, what else might it do that would be useful?
                                        https://www.tensorflow.org/

                                        1 Reply Last reply
                                        1
                                        Reply
                                        • Reply as topic
                                        Log in to reply
                                        • Oldest to Newest
                                        • Newest to Oldest
                                        • Most Votes


                                        21

                                        Online

                                        11.7k

                                        Users

                                        11.2k

                                        Topics

                                        113.1k

                                        Posts


                                        Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                                        • Login

                                        • Don't have an account? Register

                                        • Login or register to search.
                                        • First post
                                          Last post
                                        0
                                        • MySensors
                                        • OpenHardware.io
                                        • Categories
                                        • Recent
                                        • Tags
                                        • Popular