I was on V0.54.0 of home assistant and v3.4 of python on Raspbian Jessie.
Upgraded to Raspbian Stretch/Python3.6.3/HA V0.59.1 all at once following the instructions in this thread:
https://community.home-assistant.io/t/python-3-6-upgrade-of-a-virtualenv/21722
I had a few issues that I was able to get resolved but I can’t fix my MQTT.
I have uninstalled it by doing a purge:
$ sudo apt-get purge mosquitto
Then did a reinstall.using the same user name and password as I already had before.
Now I get the following errors:
2017-12-04 05:08:17 ERROR (MainThread) [homeassistant.setup] Error during setup of component mqtt
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/setup.py", line 190, in _async_setup_component
result = yield from component.async_setup(hass, processed_config)
File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/mqtt/__init__.py", line 387, in async_setup
success = yield from hass.data[DATA_MQTT].async_connect()
File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/mqtt/__init__.py", line 498, in async_connect
self._mqttc.connect, self.broker, self.port, self.keepalive)
File "/usr/local/lib/python3.6/asyncio/futures.py", line 332, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/local/lib/python3.6/asyncio/tasks.py", line 250, in _wakeup
future.result()
File "/usr/local/lib/python3.6/asyncio/futures.py", line 245, in result
raise self._exception
File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.6/site-packages/paho/mqtt/client.py", line 768, in connect
return self.reconnect()
File "/srv/homeassistant/lib/python3.6/site-packages/paho/mqtt/client.py", line 895, in reconnect
sock = socket.create_connection((self._host, self._port), source_address=(self._bind_address, 0))
File "/usr/local/lib/python3.6/socket.py", line 724, in create_connection
raise err
File "/usr/local/lib/python3.6/socket.py", line 713, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
Here is my config:
mqtt:
broker: 192.168.1.125
port: 1883
client_id: home-assistant-1
username: !secret MQTT_user
password: !secret MQTT_password
Am I doing something wrong or is there something I’m missing because of the upgrades?