Hello, I’m trying to setup my first sonoff switch (flashed with Tasmota) but I have a problem, it doesn’t work and on the frontend it appears this warning message: “The following components and platforms could not be set up: - mqtt - switch.mqtt. Please check your config”. Could anyone help me please?
I don’t know if it’s important, I’m using a DDNS with Let’s Encrypt. HA (on hassbian) version 0.63.2. Configuration.yaml has no errors.
My sonoff settings are:
Host: 192.168.0.113 (HA ip)
Port: 1883
Client: home-assistant-1 (is it correct?)
Username: homeassistant (is it correct?)
Password: *** (web password)
Topic: sonoff_os
Full topic: %prefix%/%topic%/
My configuration.yaml is:
mqtt:
broker: 192.168.0.113
port: 1883
client_id: home-assistant-1
username: homeassistant
password: *** (HA web psw)
protocol: 3.1switch:
- platform: mqtt
name: “Open Space”
state_topic: “stat/sonoff_os/POWER”
command_topic: “cmdn/sonoff_os/POWER”
availability_topic: “tele/sonoff/LWT”
qos: 1
payload_on: “ON”
payload_off: “OFF”
payload_available: “Online”
payload_not_available: “Offline”
retain: true
The error log is this:
2018-02-20 15:48:33 ERROR (MainThread) [homeassistant.setup] Error during setup of component mqtt
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/setup.py", line 145, in _async_setup_component
result = yield from component.async_setup(hass, processed_config)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/mqtt/__init__.py", line 399, in async_setup
success = yield from hass.data[DATA_MQTT].async_connect()
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/mqtt/__init__.py", line 506, in async_connect
self._mqttc.connect, self.broker, self.port, self.keepalive)
File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
future.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
raise self._exception
File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.5/site-packages/paho/mqtt/client.py", line 768, in connect
return self.reconnect()
File "/srv/homeassistant/lib/python3.5/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/lib/python3.5/socket.py", line 712, in create_connection
raise err
File "/usr/lib/python3.5/socket.py", line 703, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
2018-02-20 15:48:34 ERROR (MainThread) [homeassistant.setup] Unable to setup dependencies of switch.mqtt. Setup failed for dependencies: mqtt
2018-02-20 15:48:34 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform switch.mqtt: Could not setup all dipendencies
Anyone could help me please? Thank you very much!