MQTT not talking to OH2

http://docs.openhab.org/addons/bindings/mqtt1/readme.html#item-configuration-for-inbound-messages

Use < for inbound. It’s a subscription to the topic where the payload is being delivered from the ESP.
When the ESP will publish (e.g. “OPEN”), the OH2 item will receive the message from MQTT and update the state of the bound item

Does everything else look okay?

i have created a screen recording which may help…

it seems that OH2 does not communicate with the MQTT Broker
perform these troubleshooting steps:

From PaperUI:
Reinstall MQTT Binding
Uninstall MQTT Action (if installed)

From openHAB2 console:

log:set DEBUG org.openhab.binding.mqtt
log:set DEBUG org.openhab.io.transport.mqtt

Stop OH2 service, delete file /var/lib/openhab2/config/org/openhab/mqtt.config
Use the following /etc/openhab2/services/mqtt.cfg:

broker.url=tcp://127.0.0.1:1883
broker.clientId=openHAB2
broker.retain=true
broker.async=true

Start OH2 service and check logs

Extra note (for later): Your item definitions have some errors in them (e.g. Switch4 first command). Your major problem is that the MQTT Binding is not connecting to the Broker. Let’s fix this first, then we deal with the item configs. You do have some good item configs so they should be sending messages.

1 Like

YOU LEGEND! Its showing up in the mosquitto_sub when i switch on the webpage!

I think i know what was going wrong…slightly embarrassing!

1 Like