I am trying to set up MQTT on my home assistant. I’ve added
mqtt:
to the config.yaml file. When I check the config it comes up with no errors. When I restart HA it says “Invalid config, The following components or platforms could not be setup: MQTT, Please check you config”
There are some spaces in the next line of the file after mqtt: that are confusing the configuration. Or possibly the error is just in the next configuration section.
You already have an MQTT broker running, which is preventing the HA broker from opening the default port (1883). Or possibly some other network problem is stopping the broker.
2018-03-26 20:56:36 ERROR (MainThread) [hbmqtt.broker] Broker startup failed: [Errno 98] error while attempting to bind on address (‘0.0.0.0’, 8080): address already in use
2018-03-26 20:56:36 ERROR (MainThread) [homeassistant.components.mqtt.server] Error initializing MQTT server
Traceback (most recent call last):
File “uvloop/loop.pyx”, line 1026, in uvloop.loop.Loop._create_server
File “uvloop/handles/streamserver.pyx”, line 43, in uvloop.loop.UVStreamServer.listen
File “uvloop/handles/streamserver.pyx”, line 80, in uvloop.loop.UVStreamServer._fatal_error
OSError: [Errno 98] Address already in use
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/hbmqtt/broker.py”, line 280, in start
subprotocols=[‘mqtt’])
File “/usr/local/lib/python3.6/site-packages/websockets/server.py”, line 356, in serve
server = yield from loop.create_server(factory, host, port, **kwds)
File “uvloop/loop.pyx”, line 1527, in create_server
File “uvloop/loop.pyx”, line 1030, in uvloop.loop.Loop._create_server
OSError: [Errno 98] error while attempting to bind on address (‘0.0.0.0’, 8080): address already in use
This is the error that is causing the problem. Something already has port 8080 open. I’m not sure why the embedded broker is trying to open it, but it might be something to do with websockets.