小白刚玩Mqtt遇到问题,请求大神指点
配置文件设置
binary_sensor :
- platform: mqtt
name: "Rain"
state_topic: "/esptest/sensor.Rain/Rain"
qos: 0
payload_on: "1"
payload_off: "0"
device_class: moisture
mqtt:
broker: 192.168.1.192
log文件显示:
2017-11-21 13:37:47 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 190, 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 387, 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 498, 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 refused2017-11-21 13:46:45 ERROR (MainThread) [homeassistant.setup] Unable to setup dependencies of binary_sensor.mqtt. Setup failed for dependencies: mqtt
2017-11-21 13:46:45 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform binary_sensor.mqtt: Could not setup all dependencies.