[solved] Local Mosquitto broker - CloudMQTT bridge

Thank you. It seems I have the same but the logs for MQTT give me this:
1502922011: Connecting bridge cloudmqtt (m11.cloudmqtt.com:http_port)
1502922011: Socket error on client local.hass, disconnecting.

Here is my MQTT config:
{
“plain”: true,
“ssl”: false,
“anonymous”: false,
“logins”: [
{
“username”: “pi”,
“password”: “raspberry”
}
],
“customize”: {
“active”: true,
“folder”: “mosquitto”
},
“certfile”: “fullchain.pem”,
“keyfile”: “privkey.pem”
}

Here is my cloudmqtt.conf located in \localipaddress\share\mosquitto

connection cloudmqtt
address m11.cloudmqtt.com:http_port
remote_username hass
remote_password xxxxxxxxx
clientid hass
try_private false
start_type automatic
topic # in

And the user I set up in CloudMQTT (I have another user for my phone which connects and the CloudMQTT console shows my location being updated.

Can you share your logs for the MQTT add-on? Unless I’m staring at a glaringly obvious typo I can’t see, my config appears to be the same as yours?

P.S Did you add a bridge back to your local HASS instance in the CloudMQTT console as I see some mentioning that?

If I remove the local MQTT instance in my configuration.yaml and add CloudMQTT instead with the same username and password, HASS connects and reports my phones location so something a bit nuts.

1 Like

@tillmannschatz My BAD!!! I had the @#@#$%^%^ CloudMQTT address wrong! I had m11.cloudmqtt.com instead of m13.cloudmqtt.com even though I’d recorded the correct address in my network database. Argh. That’ll teach me for trying to do home automation at 1130 at night. Thanks for sharing your config and for your patience.

:joy:
that happens, no problem

Sure does! Not my first time a typo has cost be days :frowning:

Oh man, should have known about this earlier. Thx for the tip! (tbh, the app is quite confusing but still easier than the command line :slight_smile:)

Hi,
I have just got owntracks reporting back to Hassio internal MQTT broker successfully.
However, I already run another MQTT (Mosquitto) broker on a separate RP3 that has been working great with HA for several months now. It is set up without SSL or Usernames and passwords as it sits inside my network.
I have a number of MQTT Clients linked to it as part of my HA set up - sonoffs, Particle Photons, ESP devices. So not super keen to play with the setup to much.
What I was hoping I could do is use the HASSIO MQTT as my external facing MQTT and rout the owntracks request through to my internal MQTT for HA to deal with.
I know this is possible through conf changes on the MQTT server, but not sure how to do this with the HASSIO MQTT.
I tried adding the following to the config through HA like in this post

“bridges”: [
{
“connection”: “mqtt”,
“address”: “internal IP and port”,
“remote_username”: “bridge_testuser”,
“remote_password”: “bridge_testpw”,
“clientid”: “HomeAssistant”,
“try_private”: “false”,
“start_type”: “automatic”,
“topic”: “# in”
}
]

But this just got wiped when i Saved it and restarted Hassio MQTT.

How do I add the bridge to the internal HASSIO MQTT?

thanks

Did you ever get this figured out? I’m trying to get this setup right now as well using the MQTT broker that runs as its own docker container. I added the file to the /share/mosquitto location but I’m not seeing any attempts by anything to reach out to the cloud bridge. Thanks for the help with this.

EDIT:
Figured this out

{
  "plain": true,
  "ssl": false,
  "anonymous": true,
  "logins": [],
  "customize": {
    "active": true,
    "folder": "mosquitto"
  },
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem"
}

Had to change the active flag in here from false to true and then it loaded the custom config for the cloudmqtt stuff. Now the device is being reported properly.

1 Like

same here\did you figured this out?

bump :slight_smile: i can’t get it to work either. Do you need to get some special settings in cloudmqtt?

Can you update mosquitto to 1.4.15 version?

Hi, I got a doubt about the config.yaml file part of mqtt: should I set it up with the cloudmqtt data or with the “internal” mqtt broker?

EDIT: Restarted both CloudMQTT instances (No change) and then restarted MQTT hassio addon and all seems to be in order. Weird, didn’t change anything the first time just restarting MQTT addon.

I have something strange today.
I’ve had 2 bridges set up (as per @tillmannschatz) and working for the passed week. Nothing has changed.
Today I updated my config.yaml to remove some history tracking.

After restarting I have found that the MQTT devices connected to cloudMQTT arent updating Hassio.
I went onto cloudMQTT and saw that my devices are still posting as normal, but it seems the link to Hassio has broken.

I have these logs from cloud MQTT
New client connected from IP ADDRESS as cloudmqtt-st-ui-0.NUMBERS (c1, k60, u’sffqavg’).
2019-02-04 10:50:29: Socket error on client cloudmqtt-st-ui-0.NUMBERS, disconnecting…

and these from MQTT Hassio Broker
154___67: Connecting bridge cloudmqtt (#you:1883)
154___67: Error creating bridge: Name does not resolve.

Nothing looks like it has been changed. Im going through setups again and will update if I find the issue.