Help! openHAB 2.4 binding MQTT



  • Has anyone successfully used Mysensors MQTT gateway with Openhab2.4?

    I have tried and I have followed "How to's" but nothing work. I have googled and search, but only found people trying and failing, or showing things that does not exist.
    Does anyone have a working set up and can share it? Visually if possible? And for starters, just through PaperUI.

    OpenHab is 2.4.0 and mysensors is development branch

    This is what I have done and where I have failed.

    1. Raspberry Pi running MySensors MQTT Gateway
    2. Raspberry Pi running Mosquitto MQTT server on port 1883
    3. OpenHab2.4 with Mysensors Binding installed.
      (everything is running on the same PI)

    I have created a MySensors MQTT Gateway thing in OH
    0_1550487763124_506aade5-7f5d-4000-ad59-bf3f05b625e6-image.png

    When I click on the Mysensors MQTT Gateway I can set some settings.
    0_1550487857398_6d657c63-44fc-4bad-a49c-da7ab99eb98c-image.png
    I set the topic to the same as in the config of the mysensors gateway, but what is "Broker Name"

    It refers to a file, org.eclipse.smarthome.mqtt.cfg, that does not exist. Somewhere I have read you just create the file and past this in it.

    mosquitto.url=tcp://127.0.0.1:1883
    mosquitto.retain=false
    

    Everything is still offline... nothing happens... The mqtt however is full of messages from sensors, I see this in MQTT.fx

    How do I get the Mysensors MQTT Gateway ONLINE in Openhab?

    0_1550489611558_95ed2fe2-9ace-4fa9-bfb1-cc17e8c29881-image.png And what do I write in "Broker name".. that feels kind of important

    Mosquitto and Openhab run in separate docker containers

    mosquitto:
        image: eclipse-mosquitto:1.5
        restart: unless-stopped
        container_name: mosquitto
        expose:
          - 1883
        ports:
          - 1883:1883
        volumes:
          - /mnt/usb1/mosquitto/config/mosquitto.conf:/mosquitto/config/mosquitto.conf:ro
          - /mnt/usb1/mosquitto/data:/mosquitto/data
          - /mnt/usb1/mosquitto/logs:/mosquitto/log:rw
    
      openhab:
        image: openhab/openhab:2.4.0
        container_name: openhab
        restart: always
        network_mode: host
        devices:
          - /dev/ttyACM0:/dev/ttyACM0
        volumes:
          - /etc/localtime:/etc/localtime:ro
          - /etc/timezone:/etc/timezone:ro
          - /mnt/usb1/openhab2/addons:/openhab/addons
          - /mnt/usb1/openhab2/conf:/openhab/conf
          - /mnt/usb1/openhab2/userdata:/openhab/userdata
        environment:
          OPENHAB_HTTP_PORT: "8080"
          OPENHAB_HTTPS_PORT: "8443"
          EXTRA_JAVA_OPTS: "-Duser.timezone=Europe/Berlin"
          USER_UD: "9001"
          GROUP_ID: "9001"
    

    I have made no changes to mosquitto. It is a standard installation, without any changes to config



  • 2_1550494973818_3.PNG 1_1550494973818_2.PNG 0_1550494973817_1.PNG



  • @waspie Thanks, but that did not help me either.

    If I Install a "System MQTT Broker" it has one, and only one option.. "Broker ID"
    0_1550500359231_3960fa3d-227d-4594-84f2-37886e32397a-image.png
    I don't know what to write here.. but I can try to write "mosquitto"
    Then I get this:
    0_1550500426833_d43ee51e-891b-4c8c-a06b-c7340a6d2277-image.png

    I have removed the file in services

    0_1550500549483_ad8ca0b4-e894-4ac5-a795-d17ed59e6858-image.png



  • don't install that.
    just configure a regular broker in a .thing file

    or add it via paperui

    inbox-> + sign -> mqtt thing - > add manually - > mqtt broker -> give it the IP and hit the check.
    then you'll have a broker to attack mysensors to



  • @waspie But if I install a normal "MQTT broker", I can enter an IP adress to my mosquitto server. And I can see that the thing connects to the server
    0_1550502031766_099fa547-82d4-40ea-b18e-0a8a679dc704-image.png

    If I can use the "MQTT Broker".. how do I get Mysensors MQTT Gateway thing to connect to it?



  • what is the name of that broker?



  • @waspie said in Help! openHAB 2.4 binding MQTT:

    what is the name of that broker?

    I don't know how to answer that.... You vitually see my screen (all the screen shots).. What you see is what I have. Where do I see the name of the broker?



  • I dont see a broker in your things view. Please re-snip and post



  • @waspie said in Help! openHAB 2.4 binding MQTT:

    I dont see a broker in your things view. Please re-snip and post

    0_1550502701324_ecb17fca-779c-464d-98bb-6b5f232ae0eb-image.png



  • in your mysensors gateway config the name of the broker is fd3193ea



  • @waspie said in Help! openHAB 2.4 binding MQTT:

    fd3193ea

    OK, thanks. I changed the "Broker name" in Mysensors MQTT Gateway in OH to fd3193ea.
    The Mysensors thing is still "Offline" though... I rebooted every thing... but still offline...



  • this is 2.4.0 and not a 2.5.x build, right?



  • @waspie said in Help! openHAB 2.4 binding MQTT:

    this is 2.4.0 and not a 2.5.x build, right?

    Yes it is the 2.4 build. Both OH is 2.4 and mysensors is 2.4 (any newer is not available to my knowledge)

    OH is an installation from a docker image (openhab/openhab:2.4.0)

    Trace file does not look very healthy...
    0_1550510334727_7d5615cc-e7e7-4f1f-82f1-3388f2654308-image.png



  • i dont know what folder path your stuff would be in exactly but can you list openhab???/userdata/config/org/openhab/

    ex:

    /volume1/public/openHAB/userdata/config/org/openhab$ ls -la
    total 852
    drwxrwxrwx+ 1 openhab users    504 Feb 13 13:55 .
    drwxrwxrwx+ 1 openhab users     74 Feb 13 12:39 ..
    -rwxrwxrwx+ 1 openhab users    402 Feb 13 13:55 addons.config
    -rwxrwxrwx+ 1 openhab users    118 Feb 13 12:39 basicui.config
    -rwxrwxrwx+ 1 openhab users    120 Feb 13 12:39 dashboard.config
    -rwxrwxrwx+ 1 openhab users 796758 Feb 13 08:28 habpanel.config
    -rwxrwxrwx+ 1 openhab users    230 Feb 13 12:39 http.config
    -rwxrwxrwx+ 1 openhab users    184 Feb 13 12:39 influxdb.config
    -rwxrwxrwx+ 1 openhab users    162 Feb 13 12:39 jdbc.config
    -rwxrwxrwx+ 1 openhab users    131 Feb 13 12:39 logging.config
    -rwxrwxrwx+ 1 openhab users    115 Feb 13 12:39 mail.config
    -rwxrwxrwx+ 1 openhab users    116 Feb 13 12:39 mapdb.config
    -rwxrwxrwx+ 1 openhab users    118 Feb 13 12:39 network.config
    -rwxrwxrwx+ 1 openhab users    114 Feb 13 12:39 nma.config
    -rwxrwxrwx+ 1 openhab users    158 Feb 13 12:39 plex.config
    -rwxrwxrwx+ 1 openhab users    200 Feb 13 12:39 pushover.config
    -rwxrwxrwx+ 1 openhab users    116 Feb 13 12:39 rrd4j.config
    -rwxrwxrwx+ 1 openhab users    118 Feb 13 12:39 runtime.config
    -rwxrwxrwx+ 1 openhab users    119 Feb 13 12:39 services.config
    -rwxrwxrwx+ 1 openhab users    119 Feb 13 12:39 voicerss.config
    -rwxrwxrwx+ 1 openhab users    308 Feb 13 12:39 weather.config
    


  • @waspie said in Help! openHAB 2.4 binding MQTT:

    i dont know what folder path your stuff would be in exactly but can you list openhab???/userdata/config/org/openhab/

    Looks like this:
    0_1550518144592_5e8c60de-218f-4af3-a1d9-4819e4d8e3eb-image.png

    I tried some experiments. I made a simple flow in node-red. Listen to "mysensors-out/#" then print it to debug. And yes, it works.
    0_1550519442233_e92fa4ed-1394-4143-b7af-0584c19e7713-image.png

    I also tried to add a channel to the "MQTT Broker" thing, also "mysensors-out/#"
    0_1550519346507_e143655d-6832-4cbe-8880-e9cf960b9048-image.png

    It showed up without any problems... not very usable, but can see the connection...

    But the "Mysensors MQTT Gateway"... just dead in the water...



  • yeah, mysensors in 2.4+ is very touchy.

    Have you restarted the openhab service lately?

    Try deleting your mysensors gateway then restart openhab and re-add the mysensors mqtt gateway. Just for grins...



  • @waspie said in Help! openHAB 2.4 binding MQTT:

    yeah, mysensors in 2.4+ is very touchy.

    Have you restarted the openhab service lately?

    Try deleting your mysensors gateway then restart openhab and re-add the mysensors mqtt gateway. Just for grins...

    I did that now... same thing...

    0_1550521530210_23ea03b3-01ca-43ea-8b7a-c08f3e3a3db2-image.png

    So, The "Mysensors Binding" creates a Thing, "Mysensors MQTT Gateway".
    The "Mysensors MQTT Gateway" needs a "MQTT Broker" Thing. This thing is called "mosquitto". The mosquitto thing is configured to connect to 127.0.0.1:1883
    In "Mysensors MQTT Gateway" I say "Broker Name" is "mosquitto".

    In log "Mysensors MQTT Gateway" says "No connection to broker: mosquitto"

    Maybe I should just revert back to Ethernet. I have spent 3 days with this, and somthing that "mysterious" can just not be right.



  • @magpern
    sorry, without direct access to tinker with it I can't say where it is stuck. At this moment I've dumped the binding altogether and just do everything via MQTT. I have a good feeling the binding was somehow crashing the mqtt broker which is why I stopped using the binding.



  • I have exactly same problem. Does it work for anyone not using the system broker?
    Both binding and openhab are 2.4.



  • @gahlawathome said in Help! openHAB 2.4 binding MQTT:

    I have exactly same problem. Does it work for anyone not using the system broker?
    Both binding and openhab are 2.4.

    Googleing this problem at it is quite reoccurring that the questions are about "How to get mysensors mqtt gateway online". Something must be wrong with it, otherwise so many cannot report the same thing.

    @TimO as the developer, do you have any leads?


Log in to reply
 

Suggested Topics

  • 22
  • 132
  • 1
  • 19
  • 2
  • 135

65
Online

11.4k
Users

11.1k
Topics

112.7k
Posts