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. Troubleshooting
  3. OpenHAB Mysensors binding 2.4: cant get mqtt gateway online

OpenHAB Mysensors binding 2.4: cant get mqtt gateway online

Scheduled Pinned Locked Moved Troubleshooting
mqttmysensors-bindingopenhab
49 Posts 6 Posters 6.0k Views 7 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.
  • W waspie

    I'm still planning to use MQTT as I have it tied to about 20 esp8266s around the house so I would never abandon it :)

    One problem I'm having now that I switched over to the embedded broker is the LWT doesn't seem to work right.

    I have a module in each car that when it disconnects send a LWT of off so I know to automatically close garage doors. Using the embedded broker has broken this for some reason??? So I start to think why not just use ethernet for mysensors. Fix one problem create 10 more :\

    T Offline
    T Offline
    TimO
    Hero Member
    wrote on last edited by
    #40

    @waspie Well, I do use an MySensors ethernet gateway with the MySensors binding which works fine.
    In addition to that I have MQTT devices, for example may heating unit (ebusd) which I connect via Mosquitto and the generic MQTT binding to OpenHAB. MySensors is not involved here.
    My advice: use the ethernet gateway with the MySensors binding and keep Mosquitto for the rest. There were some changes in the MQTT implementation of Openhab in 2.4 which lead to some problems, like the one in this thread and I've found some more, while trying to adapt the new configuration and I'm sure there will be some changes to that in the next release. I'm currently using two Openhab instances (2.3 and 2.4) in parallel till all problems are solved.

    1 Reply Last reply
    0
    • T TimO

      @jimmy-loyens Could you please check if the embedded-mqtt-broker thing is online? I suppose not. If the embedded broker addon (misc) is installed OpenHAB automatically discovers this embedded broker, just add that thing from inbox.
      Now connect your MySensors MQTT gateway (hardware) to the IP and Port of the embedded-broker. After that your MySensors-bridge configuration should work. The port configuration at this point is not needed, but should do no harm, it'll be ignored.

      Documentation for the binding: https://github.com/tobof/openhab2-addons/wiki

      J Offline
      J Offline
      jimmy loyens
      wrote on last edited by
      #41

      @timo Hi Tomo.

      Both the embedded broker thing and the mqtt gateway are online, i can see the mqtt messages in the logvieuwer but i cant discover nodes. I should say i have mosquitto running on port 1883 (for my milight hub) and embedded broker on port 1884. Do you think this is a problem? can i have both brokers on 1883? btw thanks for the link

      W 1 Reply Last reply
      0
      • J jimmy loyens

        @timo Hi Tomo.

        Both the embedded broker thing and the mqtt gateway are online, i can see the mqtt messages in the logvieuwer but i cant discover nodes. I should say i have mosquitto running on port 1883 (for my milight hub) and embedded broker on port 1884. Do you think this is a problem? can i have both brokers on 1883? btw thanks for the link

        W Offline
        W Offline
        waspie
        wrote on last edited by
        #42

        @jimmy-loyens
        1 broker per port otherwise one won't start. Sounds like mys is connecting to 1883 and not 1884

        J 1 Reply Last reply
        0
        • W waspie

          @jimmy-loyens
          1 broker per port otherwise one won't start. Sounds like mys is connecting to 1883 and not 1884

          J Offline
          J Offline
          jimmy loyens
          wrote on last edited by jimmy loyens
          #43

          @waspie I think the embedded broker connects to 1884 since i can see the messages from my nodes. But you might be right that mysensors is connecting to the wrong broker/port. Allso noticed the embedded broker is really slowing down my RPI3. Just uninstalled it and everything speeds up again :disappointed_relieved: Guess i have to wait till everything can connect to mosquitto :disappointed:

          W 1 Reply Last reply
          0
          • J jimmy loyens

            @waspie I think the embedded broker connects to 1884 since i can see the messages from my nodes. But you might be right that mysensors is connecting to the wrong broker/port. Allso noticed the embedded broker is really slowing down my RPI3. Just uninstalled it and everything speeds up again :disappointed_relieved: Guess i have to wait till everything can connect to mosquitto :disappointed:

            W Offline
            W Offline
            waspie
            wrote on last edited by
            #44

            @jimmy-loyens

            i may tinker with things some more in the next day or two to see if i can get MYS to connect to an external broker. i'm assuming @TimO knows best and if he can't get it to work i probably can't either but i'm not in love with how the embedded broker works (plus all the extra garbage it puts in the logs).

            T 1 Reply Last reply
            0
            • W waspie

              @jimmy-loyens

              i may tinker with things some more in the next day or two to see if i can get MYS to connect to an external broker. i'm assuming @TimO knows best and if he can't get it to work i probably can't either but i'm not in love with how the embedded broker works (plus all the extra garbage it puts in the logs).

              T Offline
              T Offline
              TimO
              Hero Member
              wrote on last edited by
              #45

              @waspie Well, it's working for @Guillermo-Schimmel and it's working in my development environment. This bugs the hell out of me. But maybe that's a problem that will be fixed with a update to OH2.

              W 1 Reply Last reply
              0
              • T TimO

                @waspie Well, it's working for @Guillermo-Schimmel and it's working in my development environment. This bugs the hell out of me. But maybe that's a problem that will be fixed with a update to OH2.

                W Offline
                W Offline
                waspie
                wrote on last edited by
                #46

                @timo

                It works for you with an external broker?

                T 1 Reply Last reply
                0
                • W waspie

                  @timo

                  It works for you with an external broker?

                  T Offline
                  T Offline
                  TimO
                  Hero Member
                  wrote on last edited by
                  #47

                  @waspie I'm testing the binding against a mosquitto in my development environment (eclipse IDE) and it is working fine there. That makes it so hard for me to debug the issue.

                  1 Reply Last reply
                  1
                  • R Offline
                    R Offline
                    rgriffogoes
                    wrote on last edited by
                    #48

                    Hello!

                    I currently have a working Openhab2.2 with mqtt1 binding + mosquitto + MySensors MQTT gateway (+ others) installed in RPi. As I'm migrating the Openhab install to FreeNas jail I figure I should try to use the latest versions of the openhab + bindings.

                    But it seems that I'm facing the same issue as others: cant get my MySensor mqtt Gateway to connect to an external mqtt broker.

                    What I've tried was a clean install of Openhab 2.4 + mqtt2 binding + MySensor 2.4 binding, then configuring a Mqtt broker Thing (stays online) and finally a MySensor Gateway binding (never connects, show "No connection to broker: <whatever name I use>")

                    I tried using the embedded Mqtt and the gateway was able to connect (but I didn't check if messages were coming/going as I will definitely use an external mqtt server)

                    As a Java programmer myself, I tried to check the code in Github (next step will be try to create a local dev env, but for that I'll need more time to check the right steps for that) and the only odd things I notice were:

                    Dependency on old mqtt1 code, e.g.: the "MySensorsMqttConnection,java" class is using the MqttService from the package org.eclipse.smarthome.io.transport.mqtt.

                    1. Is this package correct? it seems that it is the old mqtt binding code. The Mqtt stuff I found in openhab2-addons seems to use openhab packages.
                      a. Where would this smarthome package code be?

                    Potential Class version differences:
                    2. I have no idea (and didn't check the provided jar for the MySensor plugin) how the dependencies are managed in openhab runtime, but could it be that the MySensors package depends (or packs) a different version of the "core" mqtt code than the one that openhab2 runtime classloader is providing? then weird things could happen (if method signatures/classes are same I guess)

                    [https://github.com/tobof/openhab2-addons/blob/MySensors_Binding/addons/binding/org.openhab.binding.mysensors/src/main/java/org/openhab/binding/mysensors/internal/protocol/mqtt/MySensorsMqttConnection.java]

                    R 1 Reply Last reply
                    0
                    • R rgriffogoes

                      Hello!

                      I currently have a working Openhab2.2 with mqtt1 binding + mosquitto + MySensors MQTT gateway (+ others) installed in RPi. As I'm migrating the Openhab install to FreeNas jail I figure I should try to use the latest versions of the openhab + bindings.

                      But it seems that I'm facing the same issue as others: cant get my MySensor mqtt Gateway to connect to an external mqtt broker.

                      What I've tried was a clean install of Openhab 2.4 + mqtt2 binding + MySensor 2.4 binding, then configuring a Mqtt broker Thing (stays online) and finally a MySensor Gateway binding (never connects, show "No connection to broker: <whatever name I use>")

                      I tried using the embedded Mqtt and the gateway was able to connect (but I didn't check if messages were coming/going as I will definitely use an external mqtt server)

                      As a Java programmer myself, I tried to check the code in Github (next step will be try to create a local dev env, but for that I'll need more time to check the right steps for that) and the only odd things I notice were:

                      Dependency on old mqtt1 code, e.g.: the "MySensorsMqttConnection,java" class is using the MqttService from the package org.eclipse.smarthome.io.transport.mqtt.

                      1. Is this package correct? it seems that it is the old mqtt binding code. The Mqtt stuff I found in openhab2-addons seems to use openhab packages.
                        a. Where would this smarthome package code be?

                      Potential Class version differences:
                      2. I have no idea (and didn't check the provided jar for the MySensor plugin) how the dependencies are managed in openhab runtime, but could it be that the MySensors package depends (or packs) a different version of the "core" mqtt code than the one that openhab2 runtime classloader is providing? then weird things could happen (if method signatures/classes are same I guess)

                      [https://github.com/tobof/openhab2-addons/blob/MySensors_Binding/addons/binding/org.openhab.binding.mysensors/src/main/java/org/openhab/binding/mysensors/internal/protocol/mqtt/MySensorsMqttConnection.java]

                      R Offline
                      R Offline
                      rgriffogoes
                      wrote on last edited by
                      #49

                      By creating the file org.eclipse.smarthome.mqttbroker.cfg in the service folder (/usr/local/etc/openhab2/services in my case, chown to openhab), with the contents

                      name=mosquitto
                      host=192.168.1.69
                      secure=false
                      port=1883
                      username=
                      password=
                      retain=true
                      

                      I was able to just create the MySensors MQTT gateway (using paperui) and it stayed online (no mqtt broker defined, but its addon is installed). I had the impressions that with the latest versions it should be possible to do everything in the PaperUI, and that the broker would use the mqtt2 addon (but in paper ui, service, config, mqtt tab, mqtt system broker connection, manage->plus button -> expert mode, I get to see the contents of the cfg file above)

                      But unfortunately, it seems that the discovery services enters a endless loop (maybe I need to update my arduinos sketch to the latest mysensors code?) and I don't get any auto discovered things. If I trigger a new discovery it will stop the previous one and start again.

                      Finally, I was able to manually create a thing, and link items on it. Eventually my battery level and humidity were displayed in the paper ui control page (after some weird delay, not updating once it shows in the log. the temperature didn't show up though).

                      Not sure if my understanding is off (or paperui is limited in this sense) but in the "thing" creation page I only get to specify one child id. Then my multi sensors/value nodes would need to be define in multiple things? As I can't properly define channels for each child id, and I'm not sure what var1-5 are all about.

                      I'll try defining things/channels/items directly in files in the following days, because so far I couldn't enjoy most of the benefits of this new version (auto discovery, logical grouping of physical device in "things", questionable "do-it-all in paper ui"), and I'm almost considering using mqtt1 binding in the new install :(

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


                      26

                      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