I´m using the MQTT ver 1 in my setup which works fine with with my mosquitto broker. I would like to upgrade to the MQTT v2 Binding, but I don´t get it to work and really don´t understand why it has become so complicated. I expected a flawless move to v2, but I was wrong (as so often in OH).
Can anyone explain step by step what I have to do? The documentation doesn´t help. There is explained how to install the binding, and that worked, it is online, but my devices do not get the messages.
So the in the documentation I read there is a “MQTT Things and Channels Binding”, but I can´t find any download link or a binding in the marketplace. This all is very confusing and frustrating…
Ok, thank you guys, following hafniumzinc guide I was able to set up my first MQTT device.
I must mention that my inital step was to try setting up broker and things through PaperUI -> No success!
After I switched to textual configuration it worked.
I hope UI setup will work in ver3 of OH…
I would also like to mention that setting up MQTT devices is more complex than with the old version (especially setting up a thing for every device). As far as I understand this is required to follow the logic behind OH things/channels logic.
I think the problem is just well known: OH does not have the most user friendly frontend. I am using OH for years now, but just switching from one binding version to another is quickly very confusing. So if you not look into the community frequently you miss important changes what leads into trouble when you want to update your system later. As I mentioned, the documentation didn´t help me, too.
Also, I decided to switch back to MQTT ver 1.xxx just because I don´t have to configure things, just use my items and I am good to go. When I upgrade to OH 3 I will move on to MQTT v2.
It’s also much more capable. But setting up one Thing per device is the recommended approach. It is not the required approach. You can set it up how ever you want. But the whole point of a Thing is that conceptually a Thing should represent a single device. And when you do this other features that are new in the MQTT 2.x binding can be used, such as subscribing to a LWT topic as part of the Thing configuration and have the Thing be marked as OFFLINE when the MQTT broker publishes that it’s gone offline.