MQTT gateway - Openhab & Mosquitto



  • Hi guys, I am running 1.4 version of mqtt gateway with some sensors.
    What I found that in my case if I subscribe to MQTT gateway directly using mosquitto ( to check sensors communication ) , it will disconnect OpenHab client and will never reconnect until I restart Openhab mqtt bundle or the gateway. I wonder if there any workaround to this .. or is it maybe possible to somehow subscribe to mqtt using mosquitto and forward these under different topic to openhab ? That would make it easier instead of configuring 2 different brokers in Openhab.
    Appreciate any suggestions.....


  • Hero Member

    set the mysensor gw to connect to mosquito, then Openhab to Mosquito



  • Do you know what would I need to configure for this to work automatically ?
    Does mosquitto automatically re publish topics its subscribed to ?



  • @alexeinz figured it out, apparently had to add experimental and get latest mosquitto for the conf file to work correctly , now the bridge is working perfectly 👍
    --- broker.conf file in /etc/mosquitto/conf.d
    the topics coming from gw will appear under sensor/# on mosquitto

    connection MMQTTtoSensor
    address 192.168.1.234 <-gw ip
    clientid MyMQTT
    cleansession true
    notifications true
    topic # in 2 sensor/ MyMQTT/



Suggested Topics

  • 12
  • 4
  • 4
  • 12
  • 10
  • 5
  • 15
  • 4

12
Online

11.4k
Users

11.1k
Topics

112.7k
Posts