Errors with Home Assistant and HBMQTT

Hi there,

I am just getting started with Home Assistant. I setup with the Raspberry Pi all in one installer and it all seems fine except I cannot seem to connect to a broker.

I tried the default setting and the embedded broker and kept getting errors. I fiddled with the configuration.yaml using different settings gleaned from the posted examples.

This is my current error message:

The following errors have been logged this session:

16-09-11 08:35:58 homeassistant.components.mqtt: Can't connect to the broker. Please check your settings and the broker itself.
Traceback (most recent call last):
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/mqtt/", line 238, in setup
    client_cert, tls_insecure, protocol)
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/mqtt/", line 324, in __init__
    self._mqttc.connect(broker, port, keepalive)
  File "/home/hass/.homeassistant/deps/paho/mqtt/", line 686, in connect
    return self.reconnect()
  File "/home/hass/.homeassistant/deps/paho/mqtt/", line 808, in reconnect
    sock = socket.create_connection((self._host, self._port), source_address=(self._bind_address, 0))
  File "/usr/lib/python3.4/", line 509, in create_connection
    raise err
  File "/usr/lib/python3.4/", line 500, in create_connection
ConnectionRefusedError: [Errno 111] Connection refused
16-09-11 08:35:58 homeassistant.bootstrap: component mqtt failed to initialize

I thought that it might be something to do with HBMQTT not being installed/configured correctly. When I tried to reinstall / update it I get the following error:

Traceback (most recent call last):
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/pip/", line 215, in main
    status =, args)
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/pip/commands/", line 317, in run
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/pip/req/", line 742, in install
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/pip/req/", line 831, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/pip/req/", line 1032, in move_wheel_files
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/pip/", line 346, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/pip/", line 317, in clobber
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/pip/utils/", line 83, in ensure_dir
  File "/srv/hass/hass_venv/lib/python3.4/", line 237, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/srv/hass/hass_venv/lib/python3.4/site-packages/passlib-1.6.5.dist-info'

Thanks in advance for any insight, I am a totally newbie to all this :wink:

Whatever you configured for your broker and port actively refused HASS’ connection. This usually means there is nothing actually running at that address and port (it also usually means there is no firewall in the way, but it could mean there is a firewall actively refusing the connection). Check that your broker is running and that you have correctly told HASS the IP and port it is listening on. You didn’t post any of your config so I can’t be more specific.

Whatever user you ran that command as (what command? looks like a pip command?) does not have Linux permissions to access that folder. When you installed passlib, perhaps you did it as root instead of the HASS user, and now you are not doing it as root. Again you did not post much context for the error, making it difficult to troubleshoot.