What all do I need to install to enable MQTT

I can see three things

  1. MQTT as part of Openhabian-config tool
  2. enbedded MQTT Broker
  3. MQTT Binding
    So what all should I install? and in what order? to enable MQTT.

Its Openhab2 (latest image 1.4.1 downloaded yesterday (19-Mar-2019)) and installing in RPi3.

I tried installing all three in the order 1-3-2 mentioned above, but its giving error. So trying to redo the entire installation again. Please help.

Only one mqtt broker please. openHABian installs the mosquitto one and that’s fine.

Additionally just the mqtt binding. Then configure an mqtt broker thing with the IP

Next add your generic mqtt things and add channels.

1 Like

So here is what I did after reading your reply

  1. Installed fresh openhabian in RPi3
  2. Installed Standard Package in the dashboard
  3. Installed Embedded MQTT Broker under Add-ons->Misc
  4. Installed MQTT Binding under Add-ons -> Bindings

Suddenly found MQTT Broker (System MQTT Broker) in Inbox asking to be added as a Thing.

  1. So added that as a Thing
  2. Now addedd a Light Switch as a thing which uses MQTT Using generic MQTT Thing. Bridge was embedded mqtt broker (That was the only thing available in the selection anyway)
  3. Added a Channel to it as ON/Off Switch
  4. Linked to a new item

The Switch is not working and in the log I am getting this message now

2019-03-22 08:59:07.544 [vent.ItemStateChangedEvent] - LightSwitch changed from NULL to UNDEF

What did I miss?

What does that mean? It definitely works if all things are online. You have configured a state and/or command topic and know what a state and command topic is in mqtt speech?

I have defined State Topic. When I say switch is not working means, on the control screen I can see the switch. But I cant move the slider towards right to switch on the light. The cursor is still an arrow and doesnt change to “hand”.

Log says
2019-03-22 08:59:07.544 [vent.ItemStateChangedEvent] - LightSwitch changed from NULL to UNDEF

I tried reinstalling all bindingd and Embeded MQTT broker again. Now when I add a channel to a Thing it says internal server error.

Its so unstable :frowning:

And then I uninstalled everything and installed Mosquitto using openhabian-config. And somehow managed to add a thing and channel and item after a lot of internal server error. It worked for 5 minutes, and now its not working again.

So unstable :frowning:

Yes personally I’m using a fork of openHAB core. The extension installation is unstable and the model engine responsible for .things and .item files.

But this is not windows. Don’t uninstall extension. That will not fix anything. Just do a restart of openHAB if in doubt, but that’s also usually not required. (Except if you use .things and .item files)

hmm, will keep on trying, not giving up that easy. Thanks for the inputs David, appreciate the help.


Check out this link along with free zbigz premium accounts and your life is sorted.