Do you have an exposed port so that it can connect?
Not sure what you mean? I’m getting the local MQTT add-on trying to connect to a remote CloudMQTT instance using the customize option. I have no outbound port firewalls.
I’m not at home right now, but in cloudmqtt you’ve to create a new user with access rights to the topics you want to sync. I used this user as my client id
I created three users and I tried using the name for the first user as the clientid and I get the same error.
Hello all, I added the MQTT addon to Hassio, and my options currently look like this:
{
“plain”: true,
“ssl”: false,
“anonymous”: true,
“logins”: [
{
“username”: “username”,
“password”: “password”
}
],
“customize”: {
“active”: false,
“folder”: “mosquitto”
},
“certfile”: “fullchain.pem”,
“keyfile”: “privkey.pem”
}
I then added this to my config:
mqtt:
broker: 172.17.0.1
I then saved it, restarted the addon and rebooted the Pi. How can I tell if it is running properly? I am trying to set it up to get an addressable LED strip working through Hass (from Ben’s video).
Thanks!
Download MQTT.fx, it’s a life saver. Create a connection to your broker using the IP, username and password you set and then subscribe to # (everything). You can then use that to publish commands and to see what is happening at the broker. Great tool if you’re not into the command line stuff.
Wondering if you can confirm your config for me? If I use CloudMQTT as my broker (instead of the local IP) I connect to CloudMQTT and see that my position reported by Owntracks is being updated. If I then revert to the hassio MQTT add-on with a customize option using the same credentials as before (but now in a conf file), I get socket errors and disconnection.
Hey @xbmcnut,
this is the config in the mqtt addon:
{
"plain": true,
"ssl": false,
"anonymous": false,
"logins": [
{
"username": "REDACTED",
"password": "REDACTED"
}
],
"customize": {
"active": true,
"folder": "mosquitto"
},
"certfile": "fullchain.pem",
"keyfile": "privkey.pem"
}
This is my *.conf file (located in share\mosquitto)
connection cloudmqtt
address REDACTED
remote_username me-Hassio
remote_password REDACTED
clientid me-Hassio
try_private false
start_type automatic
topic # in
And these are the users for owntracks
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.
@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.
that happens, no problem
Sure does! Not my first time a typo has cost be days
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 )
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.
same here\did you figured this out?
bump 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.