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

 找回密码
 立即注册
查看: 10438|回复: 15

[求助] HA连接小米网关后不显示子设备

[复制链接]

4

主题

17

帖子

140

积分

注册会员

Rank: 2

积分
140
金钱
123
HASS币
0
发表于 2020-7-17 11:19:46 | 显示全部楼层 |阅读模式
新手刚接触HA,安装完后自动发现的小米网关,然后配置的时候要求用的是token,没有要求用key,但配置完之后就只有警戒,下面的子设备都没有,然后在网上找教程,又重新配置的,但配置后依然不好使。
跪求大佬们帮帮,谢谢您了。

这是所有的日志文件
2020-07-17 10:00:53 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.140198012492880] not all arguments converted during string formatting
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/fan.py", line 651, in _try_command
    partial(func, *args, **kwargs)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.7/site-packages/miio/airpurifier.py", line 432, in set_mode
    return self.send("set_mode", [mode.value])
  File "/usr/local/lib/python3.7/site-packages/miio/device.py", line 147, in send
    command, parameters, retry_count, extra_parameters=extra_parameters
  File "/usr/local/lib/python3.7/site-packages/miio/miioprotocol.py", line 203, in send
    self._handle_error(payload["error"])
  File "/usr/local/lib/python3.7/site-packages/miio/miioprotocol.py", line 263, in _handle_error
    raise DeviceError(error)
miio.exceptions.DeviceError: {'code': -5001, 'message': 'invaild_arg'}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 130, in handle_call_service
    connection.context(msg),
  File "/usr/src/homeassistant/homeassistant/core.py", line 1260, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1295, in _execute_service
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 209, in handle_service
    self._platforms.values(), func, call, required_features
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 454, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 595, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 485, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/fan.py", line 666, in async_turn_on
    result = await self.async_set_speed(speed)
  File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/fan.py", line 814, in async_set_speed
    AirpurifierOperationMode[speed.title()],
  File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/fan.py", line 658, in _try_command
    _LOGGER.error(mask_error, exc)
  File "/usr/local/lib/python3.7/logging/__init__.py", line 1407, in error
    self._log(ERROR, msg, args, **kwargs)
  File "/usr/local/lib/python3.7/logging/__init__.py", line 1514, in _log
    self.handle(record)
  File "/usr/local/lib/python3.7/logging/__init__.py", line 1524, in handle
    self.callHandlers(record)
  File "/usr/local/lib/python3.7/logging/__init__.py", line 1586, in callHandlers
    hdlr.handle(record)
  File "/usr/local/lib/python3.7/logging/__init__.py", line 894, in handle
    self.emit(record)
  File "/usr/src/homeassistant/homeassistant/components/system_log/__init__.py", line 181, in emit
    record, stack, _figure_out_source(record, stack, self.hass)
  File "/usr/src/homeassistant/homeassistant/components/system_log/__init__.py", line 97, in __init__
    self.message = deque([record.getMessage()], maxlen=5)
  File "/usr/local/lib/python3.7/logging/__init__.py", line 369, in getMessage
    msg = msg % self.args
TypeError: not all arguments converted during string formatting
2020-07-17 10:01:05 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.140198012492880] not all arguments converted during string formatting
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/fan.py", line 651, in _try_command
    partial(func, *args, **kwargs)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.7/site-packages/miio/airpurifier.py", line 432, in set_mode
    return self.send("set_mode", [mode.value])
  File "/usr/local/lib/python3.7/site-packages/miio/device.py", line 147, in send
    command, parameters, retry_count, extra_parameters=extra_parameters
  File "/usr/local/lib/python3.7/site-packages/miio/miioprotocol.py", line 203, in send
    self._handle_error(payload["error"])
  File "/usr/local/lib/python3.7/site-packages/miio/miioprotocol.py", line 263, in _handle_error
    raise DeviceError(error)
miio.exceptions.DeviceError: {'code': -5001, 'message': 'invaild_arg'}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 130, in handle_call_service
    connection.context(msg),
  File "/usr/src/homeassistant/homeassistant/core.py", line 1260, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1295, in _execute_service
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 209, in handle_service
    self._platforms.values(), func, call, required_features
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 454, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 595, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 485, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/fan.py", line 666, in async_turn_on
    result = await self.async_set_speed(speed)
  File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/fan.py", line 814, in async_set_speed
    AirpurifierOperationMode[speed.title()],
  File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/fan.py", line 658, in _try_command
    _LOGGER.error(mask_error, exc)
  File "/usr/local/lib/python3.7/logging/__init__.py", line 1407, in error
    self._log(ERROR, msg, args, **kwargs)
  File "/usr/local/lib/python3.7/logging/__init__.py", line 1514, in _log
    self.handle(record)
  File "/usr/local/lib/python3.7/logging/__init__.py", line 1524, in handle
    self.callHandlers(record)
  File "/usr/local/lib/python3.7/logging/__init__.py", line 1586, in callHandlers
    hdlr.handle(record)
  File "/usr/local/lib/python3.7/logging/__init__.py", line 894, in handle
    self.emit(record)
  File "/usr/src/homeassistant/homeassistant/components/system_log/__init__.py", line 181, in emit
    record, stack, _figure_out_source(record, stack, self.hass)
  File "/usr/src/homeassistant/homeassistant/components/system_log/__init__.py", line 97, in __init__
    self.message = deque([record.getMessage()], maxlen=5)
  File "/usr/local/lib/python3.7/logging/__init__.py", line 369, in getMessage
    msg = msg % self.args
TypeError: not all arguments converted during string formatting

回复

使用道具 举报

73

主题

1165

帖子

6641

积分

论坛元老

Rank: 8Rank: 8

积分
6641
金钱
5471
HASS币
30
发表于 2020-7-17 11:33:08 | 显示全部楼层
在【配置】【集成】添加【Xiaomi Gateway 】
回复

使用道具 举报

4

主题

17

帖子

140

积分

注册会员

Rank: 2

积分
140
金钱
123
HASS币
0
 楼主| 发表于 2020-7-17 12:18:18 | 显示全部楼层
xuyang 发表于 2020-7-17 11:33
在【配置】【集成】添加【Xiaomi Gateway 】

IMG_20200717_121017.jpg IMG_20200717_120958.jpg IMG_20200717_113829.jpg IMG_20200717_120943.jpg
添加就是这种的,我应该怎么添加大佬,谢谢您了



回复

使用道具 举报

0

主题

71

帖子

1399

积分

金牌会员

Rank: 6Rank: 6

积分
1399
金钱
1328
HASS币
0
发表于 2020-7-17 12:40:45 | 显示全部楼层
我也遇到了同样的问题,在集成里面添加,输入IP地址和token后,显示网关添加成功,但只有警戒实体,所有子设备无法显示和添加。请大佬帮忙啊
回复

使用道具 举报

0

主题

173

帖子

1403

积分

金牌会员

Rank: 6Rank: 6

积分
1403
金钱
1230
HASS币
0
发表于 2020-7-17 13:05:32 | 显示全部楼层

應該會有兩個,一個是警報一個是底下的子設備

我在configuration.yaml還是有放

xiaomi_aqara:
  discovery_retry: 10
  gateways:
    - key: xxxxxxxxxxxxxx


Xnip2020-07-17_13-02-26.png
回复

使用道具 举报

73

主题

1165

帖子

6641

积分

论坛元老

Rank: 8Rank: 8

积分
6641
金钱
5471
HASS币
30
发表于 2020-7-17 14:36:11 | 显示全部楼层
15049940833 发表于 2020-7-17 12:18
添加就是这种的,我应该怎么添加大佬,谢谢您了

第二个地址应该填写ha的地址
回复

使用道具 举报

4

主题

17

帖子

140

积分

注册会员

Rank: 2

积分
140
金钱
123
HASS币
0
 楼主| 发表于 2020-7-17 15:28:34 | 显示全部楼层
xuyang 发表于 2020-7-17 14:36
第二个地址应该填写ha的地址

我填写了ha的地址了,我ha是安装在黑群晖上的,群晖的ip是192.168.3.16,是不是就是填写这个IP,但显示的是这个 1111.jpg
然后日志是这样的
2020-07-17 15:20:52 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 418, in start
    resp = await task
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/real_ip.py", line 39, in real_ip_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 73, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 127, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 129, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 145, in post
    return await super().post(request, flow_id)
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 60, in wrapper
    result = await method(view, request, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 106, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 153, in async_configure
    result = await self._async_handle_step(flow, cur_step["step_id"], user_input)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 201, in _async_handle_step
    result: Dict = await getattr(flow, method)(user_input)
  File "/usr/src/homeassistant/homeassistant/components/xiaomi_aqara/config_flow.py", line 61, in async_step_user
    await self.hass.async_add_executor_job(xiaomi.discover_gateways)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.7/site-packages/xiaomi_gateway/__init__.py", line 47, in discover_gateways
    _socket.bind((self._interface, 0))
OSError: [Errno 99] Address not available

回复

使用道具 举报

4

主题

17

帖子

140

积分

注册会员

Rank: 2

积分
140
金钱
123
HASS币
0
 楼主| 发表于 2020-7-17 15:30:05 | 显示全部楼层
jasonlai79 发表于 2020-7-17 13:05
應該會有兩個,一個是警報一個是底下的子設備

我在configuration.yaml還是有放

我配置文件里面也写了,在集成里面添加另外一个,但一直显示错误,添加不上 1111.jpg
回复

使用道具 举报

73

主题

1165

帖子

6641

积分

论坛元老

Rank: 8Rank: 8

积分
6641
金钱
5471
HASS币
30
发表于 2020-7-17 15:50:16 | 显示全部楼层
15049940833 发表于 2020-7-17 15:28
我填写了ha的地址了,我ha是安装在黑群晖上的,群晖的ip是192.168.3.16,是不是就是填写这个IP,但显示的 ...

进入ha页面的ip
回复

使用道具 举报

4

主题

17

帖子

140

积分

注册会员

Rank: 2

积分
140
金钱
123
HASS币
0
 楼主| 发表于 2020-7-17 16:21:21 | 显示全部楼层

进入ha的IP就是我刚才说的192.168.3.16,但我填写完之后就是刚才显示的那样,加不了
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-11-25 03:26 , Processed in 0.258063 second(s), 34 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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