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. MQTT Protocol Question

MQTT Protocol Question

Scheduled Pinned Locked Moved General Discussion
10 Posts 6 Posters 1.7k Views 5 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.
  • G Offline
    G Offline
    grumpazoid
    wrote on last edited by
    #1

    When my components arrive I plan to start with a sensor or two and a serial gateway to a pi.
    I understand my radios communicate using the mysensors protocol, taken care of in the arduino sketch.

    Now suppose I get that working and decide to implement MQTT (which seems a popular choice)
    Does MQTT run on top of the mysensors protocol or does it have its own completely different sketch.?

    Sorry if this is a daft question. For some reason this is bugging me.

    Raspberry Pi 3B - Domoticz + Node Red
    Arduino Pro Mini 3.3V - W5100 Ethernet, Nrf24
    Arduino Mega, RFLink 433Mhz
    Sonoff/ESP8266/Tasmota switches

    YveauxY 1 Reply Last reply
    0
    • bjacobseB Offline
      bjacobseB Offline
      bjacobse
      wrote on last edited by
      #2

      I use Domoticz, and this have native support for Mysensors. This means that you don't have think about how it's talking to each other (Protocol), It then uses the serial gateway

      You can also install MQTT (and you need a broker too, Mosquitto) so that you can use devices that uses MQTT as protocol.
      https://www.domoticz.com/wiki/MQTT#Introduction

      It depends on your controller (controller= homeautomation controller)

      1 Reply Last reply
      1
      • G grumpazoid

        When my components arrive I plan to start with a sensor or two and a serial gateway to a pi.
        I understand my radios communicate using the mysensors protocol, taken care of in the arduino sketch.

        Now suppose I get that working and decide to implement MQTT (which seems a popular choice)
        Does MQTT run on top of the mysensors protocol or does it have its own completely different sketch.?

        Sorry if this is a daft question. For some reason this is bugging me.

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

        @grumpazoid MySensors uses a gateway to connect the MySensors network to the rest of the world, which is often a controller.
        There are various gateways supporting e.g. serial or ethernet, but there also are MQTT gateways (see the xxxMQTTClient examples here ).
        These gateways are clients, so they connect to an MQTT broker elsewhere to publish and subscribe their messages.

        http://yveaux.blogspot.nl

        1 Reply Last reply
        1
        • G Offline
          G Offline
          grumpazoid
          wrote on last edited by
          #4

          Thanks for the replies.

          To use MQTT do I need to upload a different code to the sensors?

          Raspberry Pi 3B - Domoticz + Node Red
          Arduino Pro Mini 3.3V - W5100 Ethernet, Nrf24
          Arduino Mega, RFLink 433Mhz
          Sonoff/ESP8266/Tasmota switches

          mfalkviddM C 2 Replies Last reply
          0
          • G grumpazoid

            Thanks for the replies.

            To use MQTT do I need to upload a different code to the sensors?

            mfalkviddM Offline
            mfalkviddM Offline
            mfalkvidd
            Mod
            wrote on last edited by
            #5

            @grumpazoid in general no, the sensors will just communicate with the gateway.

            But some controllers do not support dynamic id assignment over mqtt so you might need to define MY_NODE_ID.

            1 Reply Last reply
            0
            • G grumpazoid

              Thanks for the replies.

              To use MQTT do I need to upload a different code to the sensors?

              C Offline
              C Offline
              Craig Thom
              wrote on last edited by
              #6

              @grumpazoid The sensors themselves do not communicate with the MQTT broker. They communicate with the gateway as usual.

              The gateway then communicates with the MQTT broker, like this example.

              G 1 Reply Last reply
              0
              • C Craig Thom

                @grumpazoid The sensors themselves do not communicate with the MQTT broker. They communicate with the gateway as usual.

                The gateway then communicates with the MQTT broker, like this example.

                G Offline
                G Offline
                grumpazoid
                wrote on last edited by grumpazoid
                #7

                @craig-thom said in MQTT Protocol Question:

                @grumpazoid The sensors themselves do not communicate with the MQTT broker. They communicate with the gateway as usual.

                The gateway then communicates with the MQTT broker, like this example.

                Thanks Craig Thom
                That makes a bit more sense now :relaxed:

                Raspberry Pi 3B - Domoticz + Node Red
                Arduino Pro Mini 3.3V - W5100 Ethernet, Nrf24
                Arduino Mega, RFLink 433Mhz
                Sonoff/ESP8266/Tasmota switches

                1 Reply Last reply
                0
                • G Offline
                  G Offline
                  grumpazoid
                  wrote on last edited by
                  #8

                  Update so far:
                  Still using Domoticz with MS serial gateway, but have installed Mosquitto and in Domoticz I have added "MQTT Client Gateway with LAN interface".
                  This allows me to control my sonoff over MQTT. Some progress at least.
                  I notice that all the MySensors data is pushed out on the domoticz/out topic.
                  So do I really need a MySensors MQTT gateway? I guess that would allow interception if MQTT topics for processing with something such as Node Red.
                  I have just installed Node Red but have only managed to process some earthquake data (as per the example).

                  Raspberry Pi 3B - Domoticz + Node Red
                  Arduino Pro Mini 3.3V - W5100 Ethernet, Nrf24
                  Arduino Mega, RFLink 433Mhz
                  Sonoff/ESP8266/Tasmota switches

                  wimdW 1 Reply Last reply
                  0
                  • G grumpazoid

                    Update so far:
                    Still using Domoticz with MS serial gateway, but have installed Mosquitto and in Domoticz I have added "MQTT Client Gateway with LAN interface".
                    This allows me to control my sonoff over MQTT. Some progress at least.
                    I notice that all the MySensors data is pushed out on the domoticz/out topic.
                    So do I really need a MySensors MQTT gateway? I guess that would allow interception if MQTT topics for processing with something such as Node Red.
                    I have just installed Node Red but have only managed to process some earthquake data (as per the example).

                    wimdW Offline
                    wimdW Offline
                    wimd
                    wrote on last edited by
                    #9

                    @grumpazoid You will indeed see that a changed value in Domoticz on one of your MySensor nodes will be published on the domoticz/out topic. This is because the node was presented to Domoticz at start up.
                    You are not able to access a non presented node directly by Domoticz through the gateway.

                    You can walk around that by creating a virtual sensor in Domoticz and a 'bridge' in Node red that translates MQTT to the MySensor.
                    Check https://www.mysensors.org/controller/nodered.

                    G 1 Reply Last reply
                    0
                    • wimdW wimd

                      @grumpazoid You will indeed see that a changed value in Domoticz on one of your MySensor nodes will be published on the domoticz/out topic. This is because the node was presented to Domoticz at start up.
                      You are not able to access a non presented node directly by Domoticz through the gateway.

                      You can walk around that by creating a virtual sensor in Domoticz and a 'bridge' in Node red that translates MQTT to the MySensor.
                      Check https://www.mysensors.org/controller/nodered.

                      G Offline
                      G Offline
                      grumpazoid
                      wrote on last edited by
                      #10

                      @wimd Thanks.
                      Why would I want a non presented node?
                      I am guessing a Mysensors MQTT gateway will let me send and receive MQTT messages direct to/from the Mysensors network without having to rely on Domoticz?

                      Raspberry Pi 3B - Domoticz + Node Red
                      Arduino Pro Mini 3.3V - W5100 Ethernet, Nrf24
                      Arduino Mega, RFLink 433Mhz
                      Sonoff/ESP8266/Tasmota switches

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


                      20

                      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