MQTT: Working Mosquitto / CloudMQTT Bridge

Not at all.

Thanks for everybody’s assistance. This thread was quite a help. The bridge is now working great for me. I wrote up a little tutorial which I hope will be useful complete with screen shots. https://geekvisit.com/home-assistant-mosquitto-mqtt-cloudmqtt-work-mqtt-bridge/

I am now able to control my in home Sonoff lights with mosquitto while at the same time using Owntracks and CloudMQTT.

5 Likes

Thank you for this awesome tutorial! I’m still having an issue though.

Mosquitto to Home Assistant is working fine (woo! before I was using Home Assistant direct to cloudmqtt), but, it seems like mosquitto to cloudmqtt is not working. When I publish something from the websockets UI I can’t see it in mosquitto, and vice versa.

I don’t see anything in the error log, but when I run mosquitto from the command line with verbose logging I see Error: Unknown configuration variable "remote_clientid"

Does anyone know what the problem is? Help please!

@DZMM I think in the cloudmqtt console, you can give her user only write permissions.

When running tail -f /var/log/mosquitto/mosquitto.log as recommended here, I saw the error “OpenSSL Error: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed”

I’m still stumped. Naturally it seems to be an issue with the certificate but I have no idea how to fix it!

@ryanm101 helped me resolve the “unknown configuration variable” issue (I thought I was using the latest version of mosquitto, but it turns out I’m just using the latest version for debian jessie), but I’m still having the “OpenSSL Error.” Does anyone have any recommendations as to how I should fix this? Thank you!

I was also having the OpenSSL Error. It is because of Jessie having an old version of mosquitto (1.3.4). I’m using 1.4.10 and that issue is fixed. Since I’m running it in Docker, I just pulled a Stretch image instead of Jessie…

I’m not running docker, just debian jessie in a venv. I’ve already updated to python 3.6. How painful do you think the update to stretch would be?

I can’t say… I’m still using Jessie on the host (outside docker containers).

Okay now that my update to stretch is done, I have the answer… just mildly agonizing. :laughing: I run headless, but lost wifi once I rebooted. I connected a monitor to the pi, and with some googling I figured out that my wpa_supplicant.conf needed to have basically everything except for the first line removed.

And on to mosquitto / cloudmqtt… it’s bridging! I think I still have a ways to go till it’s all running smoothly and with home assistant, but the initial connection has been made! Woo! Updating to Stretch did it, thank you!

Grrr! Now I get a similar error when trying to connect home assistant to mosquitto:

OpenSSL Error: error:1408F10B:SSL routines:ssl3_get_record:wrong version number

Hi, so to write balues to CloudMqtt I have to change the last line

topic # in

By

topic [read|write|readwrite] ?

topic # both is what you need

How is possible in Hassio to create the file in /etc/mosquitto/conf.d/ directory ?

ah didn’t realise you were on hass.io. Don’t believe it’s directly possible. You may have to ssh into it, but hass.io isn’t designed/intended to tinker with.

this method is to bridge mosquitto and a separate mqtt broker on devices where you’ve installed mosquitto, which I guess you haven’t?

That’s it, I have the Mosquitto Addon installed in Hassio, in the same raspberry.

Then not sure how you would go about it, you probably need to ssh and look for that conf file to edit it. No idea if it’s in the same location or not though. Good luck

Thanks to all, I found a solution here!

Thanks, man. Working great.

Have had Owntracks/ CloudMQTT/Mosquitto working finr for the last several months. I have just noticed that the Presence indicators have stopped working in HA. The only thing I have changed of late is I set up a new router (Google Wifi Mesh) So not sure if this causing problem or not.

I have checked that Owntrack is publishing to CloudMQTT - viewed in websocketUI all Good.
I have made no change to my Mosquitto bridge (on a separate machine form HA)

tls_version tlsv1.2
connection CloudMQTT
address m14.cloudmqtt.com:11571
remote_username <redacted>
remote_password <redacted>
start_type automatic
topic owntracks/# in 0

Tailing log file shows this response

1537189912: Connecting bridge CloudMQTT (m14.cloudmqtt.com:11571)
1537189974: Connecting bridge CloudMQTT (m14.cloudmqtt.com:11571)

When I send an Owntracks position, I see in cloudMQTT websocket UI, but nothing is relayed to my internal Mosquitto. AS per the log it says it is the bridge connected.

Is there anything that could off changed recently that broke this? I have had the new router for about a week, but HA is only reporting no change in presence for the last couple of days. DuckDNS/Lets encrypt is all working and can access my HA instance externally OK
Mosquitto is working finr for internal devices with HA
I have tried restarting Mosquitto and HA

Hi.

It’s possible to use an encrypted connection between Mosquitto and CloudMQTT?

Thanks.