First time setup of MQTT [solved]

Just install mqtt1 again and everything is back :slight_smile:
And yes OH2 is a different product compared to OH1. It required more steps if you do it by text. The idea is that you just donā€™t to it by textual configuration anymore. HomeAssistant is not easier in this regard, they have ā€œcomponentsā€ and ā€œentitiesā€ which is like our Things and (auto linked) Items.

Hi David,
thanks for your suggestion but what do you mean for mqtt1? I mean that I do not choose the version when I install mqtt by the config tool. As you understand, Iā€™m a beginner.

I expected you are a long time user, because you mentioned OH1.8 (which is quite dusty). Since OH2.4 there is a new MQTT binding. If you have used mqtt before, you were using mqtt1. That required a config file, the new approach donā€™t. mqtt1 was automatically uninstalled with OH2.4.

Please also understand that this forum is about openHAB itself mostly. It is expected that you read up on MQTT yourself and to understand what a broker does, what an mqtt topic is and so on.

Hello, Iā€™m not a GUI-open-minded guy, and I like text based configuration. Once you understand the scripts, it is easier and faster to edit than click, click & more clicks. So my question is: in future OH versions do we still have the text configuration option?

I recommend reading Directions for openHAB 3. And I mean the entire 80 min read time thread. Everything, every argument is covered in there.

1 Like

Hello David,
I am following your tutorial. I have installed the MQTT embedded Broker and then the MQTT binding. As you could see attached I have MQTT broker online but when I create a channel it appears under systemBroker. Is that normal?

Hey!

You did everything correct so far, except the last step with adding channels. The broker thing is really only to configure the broker (and for trigger channels, but that might confuse you atm). You will need to add a ā€œGeneric MQTT Thingā€ and add channels there.

Cheers, David

Thanks for your quick reply. I want to use MQTT between openhab and my ā€œthe Home Remoteā€ (http://thehomeremote.com/) UI design so that I could extend features on both side.

As a first step to better understand how mqtt works I am trying to create a virtual mqtt ā€œswitchā€ and a virtual mqtt ā€œlampā€ in openHab. I thought that the MQTT Binding was meant for that?

If not should I just create by hand these two MQTT in a .thing file or is there a way to create them in Paper UI?

Thatā€™s an interesting project of yours.

Regarding MQTT: Itā€™s for the other way round actually. You have mqtt topics on your broker and the binding allows you bind those topics to Things->Channels->Items.

If you are looking for exporting Things and Channels to MQTT: Thatā€™s what an IO Service is for in openHAB. Unfortunately I havenā€™t written that part. I revamped the Hue Emulation IO service instead recentenly.

Is there a step by step tutorial of Video you could refer me to to understand better how to use MQTT in openhab?

I donā€™t use .thing and .item files. I think itā€™s a pest tbh and there are long community arguments topics and posts about technical aspects, the syntax and all that jazz and a little civil war even that I accidentally started here when I proposed to remove those files completely.

Thatā€™s why I canā€™t help you in this regard, and it is dead simple with Paper UI, I guess you do not need any help on that. And if so, my blog post (openHAB Blog Website) about that topic might help :slight_smile:

1 Like

iā€™ve made a video tutorial how to install and setup new OpenHAB MQTT binding, maybe itā€™ll help you, russian language video, but i hope you understand without words))

3 Likes

Hi David,

I followed the tutorial on installing the Embedded brokerā€¦ I got the MQTT Broker in my Inbox and added it, but nothing can connect to it. When I look at the ā€˜thingā€™ i see ā€˜Offline - Configuration Errorā€™ . I didnā€™t change anything (as far as iā€™m aware!) i just added the thing from my inbox.

Iā€™m running OH on Synology NAS. Any suggestions on what iā€™m doing wrong? Thank you!!

The embedded broker is no longer supported and this topic is a bit old.

I would recommend you uninstall the embedded broker, remove the thing and install mosquitto broker and mqtt binding in PaperUI under binding section.

OK. Iā€™m a bit confusedā€¦

Iā€™ve removed the thing.

Under Add-ons>Misc I see ā€œMQTT Broker Moquetteā€ installed. (This was the one i always had installed, sorry, thought that was the embedded broker?).

Under Config>Services>MQTT I see " MQTT Embedded Broker (org.eclipse.smarthome.mqttembeddedbroker)" and only the option to ā€˜Configureā€™, nothing to remove this? Do i need to remove that as well?

Cheers!

Yes that is the embedded broker.

After you remove the binding this should disappear automagically.

BTW how did you install OH and what are you running it on?

Iā€™m running on Synology NAS, I just installed via the Synology GUI and click to install the app. This is the issue for me, not sure how to install another MQTT broker on my NAS.

Iā€™ve never used Synology so excuse any dumb questions.
Do you have a command line? If so does sudo openhabian-config open the confg tool?