『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
查看: 4559|回复: 0

[求助] 求助大神关于MQTT连接问题

[复制链接]

2

主题

84

帖子

327

积分

中级会员

Rank: 3Rank: 3

积分
327
金钱
241
HASS币
0
发表于 2017-11-21 13:43:09 | 显示全部楼层 |阅读模式
本帖最后由 matthew 于 2017-11-21 13:56 编辑

小白刚玩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
)}}J3ZO(915(BZEYLNRC4U0.png
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.




回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-12-23 11:15 , Processed in 0.166148 second(s), 25 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表