MQTT Connection not working correctly

My MQTT Connection worked a short time, but now i have following problem:
When i switch a Switch in Openhab, it seems not to send a MQTT message.

Here’s my item:
Switch bed {mqtt=">[broker:/max/light/bed:command:ON:1],>[broker:/max/light/bed:command:OFF:0]"}

How can i verify where the problem is?

What does the log show when you make a switch change?

You can also use an MQTT monitor like mqtt.fx to check if the messages are actually being sent

Yes, i used MqttLens. And there were no messages.

Log says:
2018-09-09 21:13:40.044 [ome.event.ItemCommandEvent] - Item ‘bed’ received command OFF

2018-09-09 21:13:40.055 [vent.ItemStateChangedEvent] - bed changed from ON to OFF

What did you change?
Did you update?

I added only a item, but i commented that out. Has not helped.


Your mqtt.cfg please

You can copy and paste code here too.


It doesn’t seem to make much sense but sometimes it works

Restart OH and monitor the openhab.log for messages about mqtt

After item changes, sometimes there is a need to clean cache and/or tmp folders.

2018-09-09 22:15:20.242 [ERROR] [] - Error starting broker connection

org.eclipse.paho.client.mqttv3.MqttException: Unable to connect to server

at org.eclipse.paho.client.mqttv3.internal.TCPNetworkModule.start( []

at org.eclipse.paho.client.mqttv3.internal.ClientComms$ []

at [?:?]

Caused by: Connection refused (Connection refused)

at Method) ~[?:?]

at ~[?:?]

at ~[?:?]

at ~[?:?]

at ~[?:?]

at ~[?:?]

at org.eclipse.paho.client.mqttv3.internal.TCPNetworkModule.start( ~[?:?]

... 2 more

had that before, have to start the mosquitto manually.

Mosquitto started, but still no message in MQTT Lens (and devices also not switching)

Have you double checked the mosquitto user name and password?


Next question, do you have the MQTT action installed?

Yes, the MQTT Binding is installed (PaperUI).

No, the MQTT action?

Are you by any chance running the snapshot version of OH? I had the same problem a few days ago and spent about a day and a half messing around with it. I had to revert back to the stable version for things to start working again.

Mine was specifically w/ the eventbus, but I don’t have any other MQTT things going on w/ the instance I was testing this on. (It’s a detached garage that has it’s own OH for lights and such).

My post : MQTT Eventbus stopped working?

How can i check this?

Go to PaperUI -> Addons -> Actions tab and see if it is installed:

It is installed NOW.
Do i have to configure anything for it?

Still not sending a MQTT Message (MQTT Lens)