[SOLVED] Cannot get MQTT v2 to work

For some reason, I can’t get my MQTT working in OH. I am using version 2.4 of MQTT and followed the steps described in the blog. From the OH Paper UI everything seems good. I’ve created the MQTT-binding (v2.4), the broker-thing and a Generic MQTT thing. To the Generic MQTT thing, I’ve added a channel, and linked it to an item. The channels I’veprovided with the right MQTT-topic. However, the lightswitch doesn’t switch on, from the command-section in PaperUI.

When I use the command line command mosquitto_pub, the switch does activate. So for some reason using the switch in the control area of PaperUI, doesn’t generate the right message or the message doesn’t get through.

Potential issues/questions:

  • I did install the mosquitto broker via the openhabian-config command, but also installed the embedded-broker via the PaperUI. Is this a problem? If so, how do I get rid of the mosquitto server?
  • when providing the mqtt-topic to the channel, also a channel-id was requested. Does it matter what to fill-out in this section?
  • in the service section, I see two related services: MQTT Embedded broker and MQTT System broker connection. Is that correct?

Your help is much appreciated. It took me quite some time to work on this so any advice would be largely appreciated.

Platform information:

  • Hardware: Raspberry PI
  • OS: OpenHabian
  • Java Runtime Environment: which java platform is used and what version
  • openHAB version: 2.4

No

No but it is better to fill out something human readable

Yes

What do you see in the logs when you activate the switch?

It won’t the paperUI is not for this purpose, create a sitemap or use HABpanel

Are your things online?
If yes, please provide a screen shot of your MQTT generic thing, thanks

1 Like

Many thanks for your answer and very good to know that most of the configuration is good. The problem is fixed now: I forgot to fill in the values for On/Open en Off/Closed in the Switch, which should be 1 and 0.

It helped a lot to know that the settings with the broker are actually correct, I was focussing on those to fix the issue.

Great, please mark the thread as solved, thanks