本帖最后由 astonish921 于 2019-9-19 14:07 编辑
hassio安装ha0.98,addon 方式安装的Mosquitto broker 。ha通过mqtt的方式无法发现论坛的开关模块。
HA报错:
2019-09-15 15:27:08 ERROR (MainThread) [homeassistant.components.mqtt.switch] Exception in async_discover when dispatching 'mqtt_discovery_new_switch_mqtt': ({'name': 'door_light_4E22AF', 'command_topic': 'hassmart/switch/hassmart_1key_module_4E22AF_1/set', 'state_topic': 'hassmart/switch/hassmart_1key_module_4E22AF_1/state', 'ip': '192.168.1.178', 'ver': '1.5', 'qos': 1, 'retain': False, 'platform': 'mqtt'},)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/mqtt/switch.py", line 81, in async_discover
config = PLATFORM_SCHEMA(discovery_payload)
File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 272, in __call__
return self._compiled([], data)
File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 594, in validate_dict
return base_validate(path, iteritems(data), out)
File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 432, in validate_mapping
raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: extra keys not allowed @ data['ip']
ha config如下:
mqtt:
broker: 192.168.1.108
port: 1883
username: mqtt
password: mqtt
discovery: true
Mosquitto broker的配置如下:
{
"logins": [
{
"username": "mqtt",
"password": "mqtt"
}
],
"anonymous": false,
"customize": {
"active": false,
"folder": "mosquitto"
},
"certfile": "fullchain.pem",
"keyfile": "privkey.pem"
}
已经做了的测试,使用mqtt.fx客户端连接mqtt,可以成功,论坛的开关模块开灯和关灯,通过这个客户端工具可以订阅到正确的反馈状态,说明论坛开关是可以成功注册到这个mqtt服务器的。目前就是ha上发现不了这个设备。
求助。
|