Openhab2 beginner needs help in MQTT configuration

Hi, I am a new user of openhab2, and need some help (link to understandable documentation will be fine too ) in configuring items to receive states of relays and change does states using MQTT.

Platform information:

  • Hardware: raspberry pi 3
  • OS: openhabian
  • Java Runtime Environment:
  • openHAB version:2.4

Devices : ESP32 controllers with relay cards

I saw a lot of topics concerning migration form older versions of openhanded to newer versions.
However my problem is much easier, as i am new and started with openhab2.4

I am also confused about the different types of configuration, some times i read about config files sometimes i see configs based on paper, or even see code snippets with config data which are not formatted as i can see in my own config files.

So could someone help me in setting up the following :
I have a mosquitto MQTT broker installed and it works.
I install the MQTT bindings.
i defined a bridge and it is online
When I try to configure things, items or chanels, using that bridge, they are offline and i get an error message : no MQTT client
on the mosquitto log i sees that the openhanded server gets and sends kind of pings
bit not subscription or publishing data

What i want is the following :
i have a light switch and a pump switch.
I want to see the state of the 2 switches ( this is published by the esp32 board, so i have to subscribe to that topic) .
Also, i want to change that state from openhab so have to publish it

Any help ?

The “no MQTT Client” error is known for the MQTT2.4 Version (although this is the stable release, a lot of Problems have been observed in this one and are being solved in the milstone or snapshot Versions).
A restart with no following changes in the setup files does overcome this Problem (I am using actually using this Version)

Thanks for your reply.
So should I use the milestone 2.5.0.M1 ? or is it to unstable yet ?
When you say that no changes in the setup files after restarting ( I guess i may clear the cache as well ?) will help, no changes at all, or only no changes in the MQTT configs ?
Am I able to add switches or not ?

Could you share maybe your different configs with me ?


Can’t share ATM (not at home)

Yes, I should have been more specific, no changes in the MQTT things file (I guess only a Change of the Bridge would raise the error, but…)

In fact, you can change whatever you want, but in question of at least mqtt (and I doubt that this is the only addon which is affected), there will maybe no immediate reaction to this changes. But it’s not required to restart openHAB, you only need to restart the bundle, i.e. use the karaf console

bundle:restart org.eclipse.smarthome.binding.mqtt