MQTT Connection not working correctly

Hello,
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.

Ok,

Your mqtt.cfg please

https://pastebin.com/aiffWGK9

You can copy and paste code here too.

Change:
broker.url=tcp://localhost:1883
to:
broker.url=tcp://127.0.0.1:1883

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.

Now:
2018-09-09 22:15:20.242 [ERROR] [penhab.io.transport.mqtt.MqttService] - Error starting broker connection

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

at org.eclipse.paho.client.mqttv3.internal.TCPNetworkModule.start(TCPNetworkModule.java:79) [209:org.openhab.io.transport.mqtt:1.12.0]

at org.eclipse.paho.client.mqttv3.internal.ClientComms$ConnectBG.run(ClientComms.java:650) [209:org.openhab.io.transport.mqtt:1.12.0]

at java.lang.Thread.run(Thread.java:748) [?:?]

Caused by: java.net.ConnectException: Connection refused (Connection refused)

at java.net.PlainSocketImpl.socketConnect(Native Method) ~[?:?]

at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) ~[?:?]

at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) ~[?:?]

at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) ~[?:?]

at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[?:?]

at java.net.Socket.connect(Socket.java:589) ~[?:?]

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

... 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?

Yes.

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)