Help setting up CloudMQTT

Trying to link my CloudMQTT account in my configuration.yaml

I need OwnTracks to track two different phones for location/automation.

I’ve tried an assortment of configurations, but can someone point out how to fill out the configuration for an mqtt broker with these example settings?

mqtt:
  broker: <Server>
  port: <SSL Port>
  username: <User>
  password: <Password>

Somebody chime in if I’m doing this wrong but the way I have it working is (based on your example):

Broker: m12.cloudmqtt.com
Port: 24938
Username: homeassistant
Password: the password you created for the homeassistant user

You then have to make separate usernames and passwords for the phones you want to connect and set up the ACL’s the same as the first one. Each phone will be set up with its unique username and password.

You also need to add the Owntracks as a device tracker platform if you haven’t already - I use NMap and OwnTracks so my config entry looks like this:

device_tracker:
  - platform: nmap_tracker
    hosts: 192.168.1.1/24
    home_interval: 5
  - platform: owntracks
    max_gps_accuracy: 200

Once you restart HA, you should see the trackers in the dev States panel under the list of sensors.

That is what I tried, but I keep getting this:
> 16-05-17 21:55:04 homeassistant.components.mqtt: Can’t connect to the broker. Please check your settings and the broker itself.
> Traceback (most recent call last):
> File “/usr/src/app/homeassistant/components/mqtt/init.py”, line 238, in setup
> client_cert, tls_insecure, protocol)
> File “/usr/src/app/homeassistant/components/mqtt/init.py”, line 324, in init
> self._mqttc.connect(broker, port, keepalive)
> File “/usr/local/lib/python3.4/site-packages/paho/mqtt/client.py”, line 612, in connect
> return self.reconnect()
> File “/usr/local/lib/python3.4/site-packages/paho/mqtt/client.py”, line 747, in reconnect
> ciphers=self._tls_ciphers)
> File “/usr/local/lib/python3.4/ssl.py”, line 890, in wrap_socket
> ciphers=ciphers)
> File “/usr/local/lib/python3.4/ssl.py”, line 580, in init
> self.do_handshake()
> File “/usr/local/lib/python3.4/ssl.py”, line 807, in do_handshake
> self._sslobj.do_handshake()
> ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)
> 16-05-17 21:55:04 homeassistant.bootstrap: component mqtt failed to initialize

Is anyone else having an issue with cloudMQTT? I try to look at the server log and get an “unknown error”

I just checked. No issues on mine. I will say the server I’m on is m10.cloudmqtt.com, so maybe it’s an issue with the specific server your on?

Nope, I’m using the same server and have no issues. But I didn’t change the port setup and instead used the defaults (17070, 27070 and 37070). In my case I connect on 17070.

Are you able to see the Server Log on CloudMQTT control panel? I contacted their site for support.

I don’t see it - I get unknown error. But if I go to the websocket UI, I see my messages coming though from my device. If it were me, I would start by standardizing everything. Use the default ports in your setup. Match it in your device client as well.

Or were these the ports assigned to you when you first created the instance?

The screenshot is basically the default configuration it gave me when I set up this instance.

That’s why I edited my reply, I started to realize that might be the case. Have you tried connecting both HA and the client on 14938?

Hi. My cloudmqtt + owntracks configuration seems to be working however I’m getting these errors:

16-07-04 22:33:01 homeassistant.components.device_tracker: Error setting up platform owntracks
Traceback (most recent call last):
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/device_tracker/__init__.py", line 133, in setup_platform
    if not platform.setup_scanner(hass, p_config, tracker.see):
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/device_tracker/owntracks.py", line 180, in setup_scanner
    mqtt.subscribe(hass, LOCATION_TOPIC, owntracks_location_update, 1)
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/mqtt/__init__.py", line 174, in subscribe
    MQTT_CLIENT.subscribe(topic, qos)
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/mqtt/__init__.py", line 346, in subscribe
    _raise_on_error(result)
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/mqtt/__init__.py", line 444, in _raise_on_error
    raise HomeAssistantError('Error talking to MQTT: {}'.format(result))
homeassistant.exceptions.HomeAssistantError: Error talking to MQTT: 1

Any clues?

I’m seeing the same SSL handshake errors and I’m also on the m12 server. I know the homeassistant setup instructions for cloudmqtt indicate that homeassistant will automatically load the correct cert, I wonder if it just doesn’t have one for m12?

Had this problem yesterday but it went away after a few reboots with no explanation. Emailed CloudMQTT because I couldn’t ping the server from ANYWHERE but got no response.

Still can’t ping it but it appears to be working anyway - glad to know I am not the only one with this issue…

Hi all,

I’m having the same issue today. Everything was working with no issue yesterday.

The only thing I’ve changed is adding the certificates because I’m about to expose HA to the internet to control things from outside home.

I did not changed anything on the broker config but I’m guessing:

Once HA is working on HTTPS, shouldn’t I change the port to the SSL port for the mqtt broker?

thanks in advance

one more thing … checking the owntracks config on my mobile it shows Connection Refused errors …

it looks like an issue on the CloudMQTT side but just want to double check with you.

thanks!

Ok, sorry for boombing this thread but I’ve been able to resolve it and hopefully this works for you in the future.

the problem was on the CloudMQTT side. After testing with some clients, etc, the system was not responding at all so I decided to go with a basic test: Restart the Instance.

No more problems since then.

1 Like

Are you on m12.cloudmqtt.com? They’ve been having a lot of issue with that server lately. It would be nice if they listed it on their status page but the only time you see anything about it is if it’s down.

Starting to think I might have to set up mosquitto…

Agree with you, more details on server status would be great.

Yes, I’m on m12 … Since I restarted his morning no issue.

I’m getting the same error as posted by kevince52. But I’m running mosquitto private broker. I also have ssl set up for HA http. And I’m also trying to set up certificates for mosquitto.

Hi all… I have had the same problem 6 months later! with cloud MQTT and with AWS. I have tried EVERYTHING!
i even fresh installed rasbian. I am wondering if it is a router issue since I seem to be having issues even with settign up a basic mosquitto setup.