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. Controllers
  3. mqtt/ethernet gateway - node id?

mqtt/ethernet gateway - node id?

Scheduled Pinned Locked Moved Controllers
13 Posts 7 Posters 6.3k 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.
  • H Offline
    H Offline
    Hausner
    wrote on last edited by
    #4

    I have openhab too and it works fine.

    Have you checked that openhab has connected to the mqtt gateway?

    1 Reply Last reply
    0
    • K Offline
      K Offline
      kihotx
      wrote on last edited by kihotx
      #5

      Sure. Openhab connects to mqtt gateway without any problems, but i dont know where to find node and sensor ID ex. for switch "mysensor:MyMQTT/nodeID/sensorID/V_LIGHT:command:ON", what i should put instead of nodeID and sensorID? where to find theme? is there any option i can get nodeID and display it when debugging (node) on com port?

      1 Reply Last reply
      0
      • siodS Offline
        siodS Offline
        siod
        wrote on last edited by
        #6

        I am sorry to dig this old one out but I have the same question and it seems to be unanswered. How can I define a static Node Id instead of auto assign by the gateway?

        still learning...

        barduinoB 1 Reply Last reply
        0
        • siodS siod

          I am sorry to dig this old one out but I have the same question and it seems to be unanswered. How can I define a static Node Id instead of auto assign by the gateway?

          barduinoB Offline
          barduinoB Offline
          barduino
          wrote on last edited by
          #7

          @siod

          Depending on what version of the library you're using it could be:

          For version 1.5

          void setup()  
          {   
            // Initialize library and add callback for incoming messages
            gw.begin(incomingMessage, AUTO, true);
            // Send the sketch version information to the gateway and Controller
            gw.sendSketchInfo("Relay", "1.0");
          

          where AUTO means auto assign, so replace by your static id

          gw.begin(incomingMessage, 10 , true);
          

          For version 1.6/2.0 beta

          It would be

          // Define Node ID
          #define MY_NODE_ID 7
          
          // INCLUDES //
          #include <SPI.h>
          #include <MySensor.h>
          

          Cheers

          1 Reply Last reply
          0
          • siodS Offline
            siodS Offline
            siod
            wrote on last edited by
            #8

            thank you!!

            still learning...

            1 Reply Last reply
            0
            • Meshx86M Offline
              Meshx86M Offline
              Meshx86
              wrote on last edited by Meshx86
              #9

              @barduino said:

              #define MY_NODE_ID 7

              so just to be sure, am assuming the MQTT gateway has nothing to do with Openhab's MySensors Binding and thus won't obtain an automatic Node ID ?

              1 Reply Last reply
              0
              • Q Offline
                Q Offline
                Qu3Uk
                wrote on last edited by
                #10

                No, I don't believe the mysensors binding supports MQTT so won't provide node ID.

                I am using the MQTT binding for openhab2 and using a mixture of auto and static node ID with the MYS 2.0 MQTT client gateway.

                I use Node Red to assign node ID's I think someone already posted a workflow for it.

                I have Node Red ping me a message saying that it's assigned a new ID but you can use mosquitto to subscribe to both the in and out topics so you can see each message going back and forth.

                You could even use mosquitto to reply to the node on the MQTT topic and set it manually.

                Meshx86M 1 Reply Last reply
                0
                • Q Qu3Uk

                  No, I don't believe the mysensors binding supports MQTT so won't provide node ID.

                  I am using the MQTT binding for openhab2 and using a mixture of auto and static node ID with the MYS 2.0 MQTT client gateway.

                  I use Node Red to assign node ID's I think someone already posted a workflow for it.

                  I have Node Red ping me a message saying that it's assigned a new ID but you can use mosquitto to subscribe to both the in and out topics so you can see each message going back and forth.

                  You could even use mosquitto to reply to the node on the MQTT topic and set it manually.

                  Meshx86M Offline
                  Meshx86M Offline
                  Meshx86
                  wrote on last edited by Meshx86
                  #11

                  @Qu3Uk

                  thanks for the quick prompt, i am trying to assign a static gateway address by specifying

                  #define MY_NODE_ID 1
                  

                  and it doesn't take effect, (putting it before the #include)

                  Serial.println(getNodeId());
                  

                  results always in 0

                  any ideas ?

                  1 Reply Last reply
                  0
                  • Q Offline
                    Q Offline
                    Qu3Uk
                    wrote on last edited by
                    #12

                    For 2.0 I think if you want to assign a static nodeID you only need to define it like you are.

                    You do not need to call getNodeID as that I believe will request an ID from the controller.

                    Hopefully someone can confirm that, I've only been using 2.0 for a single node after upgrading my gateway.

                    1 Reply Last reply
                    0
                    • mfalkviddM Offline
                      mfalkviddM Offline
                      mfalkvidd
                      Mod
                      wrote on last edited by
                      #13

                      A gateway always has node id 0. It cannot be configured.

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


                      11

                      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