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. OpenHAB
  4. Openhab und mqtt: autoassign node IDs and howto use them

Openhab und mqtt: autoassign node IDs and howto use them

Scheduled Pinned Locked Moved OpenHAB
7 Posts 3 Posters 3.8k Views
  • 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.
  • dakkyD Offline
    dakkyD Offline
    dakky
    wrote on last edited by
    #1

    Hello

    I need some explanations concerning this setup:

    Node => gateway mit mqqt client => mosquitto broker => openhab

    Openhab and mosquitto are running fine. Gateway too I think.

    At the moment I have 2 items: one static mqqt pub script and one mysensor module.
    This can be seen in mosquitto:

    infrastructure/sky_state ON
    sensor-gw1-out/255/255/3/0/3 (null)
    sensor-gw1-out/255/255/3/0/3 (null)
    sensor-gw1-out/255/255/3/0/3 (null)
    
    

    The infrastructure part works and is switched in openhab. The sensor-gw1-out messages are (as far as I've understood this) are the requests from to node to get a NODE_ID

    And this is the part, where I'm clueless

    • how does openhab assign IDs to the nodes?
      IMHO openhab does not know anything about this message format and the "wish" of the node to get an ID?
    • and a resulting question, IF the node ID is assigned dynamically, how does this match with the static item configuration of openhab? Or do i have to wait, until a node ID is assigned by openhab and create the item after that? :confused: are these node id static after initial assignment? Where are they stored in order to survive a node restart? Or are dynamic nodes in my setup the wrong approach and I have to use static node IDs (which would be quite annoying :D )

    Thank for input ;)

    Controller: Raspberry Pi 2 :: Openhab2 :: with @TimO MySensors Binding
    Gateway: Arduino MEGA 2560 R3 :: W5100 :: Ethernet GW

    Software: MySensors 2.0development

    1 Reply Last reply
    0
    • Y Offline
      Y Offline
      Yveaux
      Mod
      wrote on last edited by
      #2

      @dakky said:

      • how does openhab assign IDs to the nodes?

      Simple; it doesn't ;-)

      IF the node ID is assigned dynamically, how does this match with the static item configuration of openhab?

      Save yourself the trouble and use static node ID's.

      http://yveaux.blogspot.nl

      1 Reply Last reply
      1
      • dakkyD Offline
        dakkyD Offline
        dakky
        wrote on last edited by
        #3

        :P ok thats simple :D

        How to you manage your sketches? I have a git repos with the sketches i use. This means a lot of code duplication, because now i need a sketch per node ID instead per node "type"?

        Controller: Raspberry Pi 2 :: Openhab2 :: with @TimO MySensors Binding
        Gateway: Arduino MEGA 2560 R3 :: W5100 :: Ethernet GW

        Software: MySensors 2.0development

        Y 1 Reply Last reply
        0
        • dakkyD dakky

          :P ok thats simple :D

          How to you manage your sketches? I have a git repos with the sketches i use. This means a lot of code duplication, because now i need a sketch per node ID instead per node "type"?

          Y Offline
          Y Offline
          Yveaux
          Mod
          wrote on last edited by
          #4

          @dakky you could store a node's ID in its eeprom and retrieve it on start. This allows all nodes to have identical firmware.

          http://yveaux.blogspot.nl

          1 Reply Last reply
          0
          • dakkyD Offline
            dakkyD Offline
            dakky
            wrote on last edited by
            #5

            @Yveaux do u have some code snipplet/example showing this ?

            Controller: Raspberry Pi 2 :: Openhab2 :: with @TimO MySensors Binding
            Gateway: Arduino MEGA 2560 R3 :: W5100 :: Ethernet GW

            Software: MySensors 2.0development

            Y 1 Reply Last reply
            0
            • dakkyD dakky

              @Yveaux do u have some code snipplet/example showing this ?

              Y Offline
              Y Offline
              Yveaux
              Mod
              wrote on last edited by
              #6

              @dakky just have a look at the api description on the MySensors home page. Everything should be in there.

              http://yveaux.blogspot.nl

              1 Reply Last reply
              0
              • M Offline
                M Offline
                moskovskiy82
                wrote on last edited by
                #7

                Maybe this information should be put on the webpage for the openhab? It took quite some time to find the answer

                1 Reply Last reply
                0

                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                With your input, this post could be even better 💗

                Register Login
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                13

                Online

                12.0k

                Users

                11.2k

                Topics

                113.4k

                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