The following errors have been logged this session:
17-04-21 02:49:53 ERROR (MainThread) [homeassistant.setup] Error during setup of component mqtt
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/setup.py", line 189, in _async_setup_component
result = yield from component.async_setup(hass, processed_config)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/components/mqtt/__init__.py", line 363, in async_setup
success = yield from hass.data[DATA_MQTT].async_connect()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/components/mqtt/__init__.py", line 473, in async_connect
None, self._mqttc.connect, self.broker, self.port, self.keepalive)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/concurrent/futures/thread.py", line 55, in run
result = self.fn(*self.args, **self.kwargs)
File "/Users/JK/.homeassistant/deps/paho/mqtt/client.py", line 704, in connect
return self.reconnect()
File "/Users/JK/.homeassistant/deps/paho/mqtt/client.py", line 826, in reconnect
sock = socket.create_connection((self._host, self._port), source_address=(self._bind_address, 0))
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/socket.py", line 722, in create_connection
raise err
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/socket.py", line 713, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 61] Connection refused
17-04-21 02:49:53 ERROR (MainThread) [homeassistant.setup] Unable to setup dependencies of switch.mqtt. Setup failed for dependencies: mqtt
17-04-21 02:49:53 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform switch.mqtt: Could not setup all dependencies.
17-04-21 02:50:03 WARNING (MainThread) [homeassistant.setup] Setup of sensor is taking over 10 seconds.
17-04-21 02:50:03 WARNING (MainThread) [homeassistant.components.sensor] Setup of platform yr is taking over 10 seconds.
17-04-21 02:50:03 WARNING (MainThread) [homeassistant.components.sensor.yr] Retrying in 15 minutes:
17-04-28 16:33:15 WARNING (MainThread) [homeassistant.setup] Setup of mqtt is taking over 10 seconds.
17-04-28 16:33:39 ERROR (MainThread) [hbmqtt.broker] Broker startup failed: [Errno 98] error while attempting to bind on address (‘0.0.0.0’, 1883): address already in use
17-04-28 16:33:39 ERROR (MainThread) [homeassistant.components.mqtt.server] Error initializing MQTT server
My goal is to use a mqtt with ssl/tls, if not possible with mosquitto, then I am fine with the embedded, but how do I stop mosquitto from running on boot.
You’ll need to ensure you configure TLS as detailed here. You can also configure Mosquitto to use TLS, and if you want to use Owntracks then you can’t use the embedded broker.
To access either from outside your network, forward port 1883, or your chosen port, to 1883 on your HA server. Ensure that you’ve configured an appropriate username and password for authentication.
The approach I used was to use a CloudMQTT instance, and set up a bridge from my local Mosquitto instance to it, following this guide. That allows me to run a local MQTT instance for use within my network, and still use OwnTracks or any remote MQTT client.