banto6 / haier

海尔智能家居设备接入HomeAssistant
Apache License 2.0
626 stars 125 forks source link

使用1.10版本加载集成时没有设备或实体,设置失败 #145

Closed liucheng1513 closed 5 months ago

liucheng1513 commented 5 months ago

前言

问题描述 使用最新的1.10版本,clientID和refresh token都填写好,登陆后加载一直没有出现相关的实体和设备信息。状态为设置失败。

环境信息:

设备信息 若是设备无法识别或控制错误则此项必填,没有设备信息可能会被直接关闭不做处理。

设备信息可在.storage/haier/目录下找到,文件格式为device_设备ID.json,上传文件时可将文件名和文件内容中的设备ID替换为任意值以保护个人隐私。

设备ID可开启debug模式后可在Device Info部分的日志中找到。日志可在配置 > 系统 > 日志 > 加载完整日志中查看。

错误日志 若是运行报错或操控异常则日志必填,没有日志可能会被直接关闭不做处理。

2024-06-02 19:36:48.276 DEBUG (MainThread) [custom_components.haier] token is valid 2024-06-02 19:36:48.542 DEBUG (MainThread) [custom_components.haier.core.client] Device Info: {'deviceId': 'A0822202FD90', 'deviceName': '滚筒洗衣机', 'deviceType': '05001153', 'online': True, 'permissions': [{'auth': {'control': True, 'set': True, 'view': True}, 'authType': 'owner'}], 'productCodeT': 'CEAAH9005', 'productNameT': 'C1 HD10LD3CLU1', 'totalPermission': {'control': True, 'set': True, 'view': True}, 'wifiType': '201c51890c31c308050100218001914400000000000000000000000000000040'} 2024-06-02 19:36:48.820 DEBUG (MainThread) [custom_components.haier.core.client] Device Info: {'deviceId': 'A08222290F6C', 'deviceName': '燃气热水器', 'deviceType': '1801700d', 'online': True, 'permissions': [{'auth': {'control': True, 'set': True, 'view': True}, 'authType': 'owner'}], 'productCodeT': 'GD0R7J001', 'productNameT': 'JSQ31-16CT7NVU1', 'totalPermission': {'control': True, 'set': True, 'view': True}, 'wifiType': '201c120000118674181700418007680000000002000000000000000000000040'} 2024-06-02 19:36:49.126 DEBUG (MainThread) [custom_components.haier.core.client] Device Info: {'deviceId': '68E478447434', 'deviceName': '冰箱', 'deviceType': '01028014', 'online': True, 'permissions': [{'auth': {'control': True, 'set': True, 'view': True}, 'authType': 'owner'}], 'productCodeT': 'BC12N0000', 'productNameT': 'BCD-520WGHTD14GZU1', 'totalPermission': {'control': True, 'set': True, 'view': True}, 'wifiType': '200861051c40850401280061800982415a000000000061801066657200000040'} 2024-06-02 19:36:49.356 DEBUG (MainThread) [custom_components.haier.core.client] Device Info: {'deviceId': '51B5AB61BF', 'deviceName': '虚拟设备', 'deviceType': '1401102f', 'online': False, 'permissions': [{'auth': {'control': True, 'set': True, 'view': True}, 'authType': 'owner'}], 'productCodeT': 'STN1NJ070', 'productNameT': 'YLP双路控制器', 'totalPermission': {'control': True, 'set': True, 'view': True}, 'wifiType': '200051c2147108001411fe6d76f0cb00000015134c0b0766463a1c9aae1cea40'} 2024-06-02 19:36:49.495 DEBUG (MainThread) [custom_components.haier.core.client] Device Info: {'deviceId': 'BB2FCAD261', 'deviceName': 'YLP网关-7ED6', 'deviceType': '3000102V', 'online': False, 'permissions': [{'auth': {'control': True, 'set': True, 'view': True}, 'authType': 'owner'}], 'productCodeT': 'STN1NJ010', 'productNameT': 'YLP网关', 'totalPermission': {'control': True, 'set': True, 'view': True}, 'wifiType': '200051c214710800300105dbefe9ec000000fc9b304fdbd896b2894415821840'} 2024-06-02 19:36:49.762 DEBUG (MainThread) [custom_components.haier.core.client] Device Info: {'deviceId': '84267A7AE836', 'deviceName': '智能音箱', 'deviceType': '3B001016', 'online': False, 'permissions': [{'auth': {'control': True, 'set': True, 'view': True}, 'authType': 'owner'}], 'productCodeT': 'J70012M00', 'productNameT': 'HSPK-X31UD(星球崛起)', 'totalPermission': {'control': True, 'set': True, 'view': True}, 'wifiType': '2054a0000426cb243b01b351503e7e0000009ebe6edafddeb12ed7637cacda40'} 2024-06-02 19:36:49.991 DEBUG (MainThread) [custom_components.haier.core.client] Device Info: {'deviceId': 'DC330DB7DD3B', 'deviceType': '0102301d', 'online': True, 'permissions': [{'auth': {'control': True, 'set': True, 'view': True}, 'authType': 'owner'}], 'totalPermission': {'control': True, 'set': True, 'view': True}, 'wifiType': '201c120024000810012300618001214b00000000000061800346f00000000040'} 2024-06-02 19:36:50.437 DEBUG (MainThread) [custom_components.haier.core.client] Device Info: {'deviceId': '68E4785D865C', 'deviceName': '我的设备', 'deviceType': '0A00202H', 'online': True, 'permissions': [{'auth': {'control': True, 'set': True, 'view': True}, 'authType': 'owner'}], 'productCodeT': 'FA08H6000', 'productNameT': 'EYBW15328JLU1', 'totalPermission': {'control': True, 'set': True, 'view': True}, 'wifiType': '201c51890c31c3080a0201208090410000000000000000000000000000000040'} 2024-06-02 19:36:50.649 DEBUG (MainThread) [custom_components.haier] 共获取到8个设备 2024-06-02 19:36:51.155 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'hacs' accesses hass.components.frontend. This is deprecated and will stop working in Home Assistant 2024.9, it should be updated to import functions used from frontend directly at custom_components/hacs/frontend.py, line 68: hass.components.frontend.async_register_built_in_panel(, please create a bug report at https://github.com/hacs/integration/issues 2024-06-02 19:36:52.683 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Haier - 18940173154 for haier Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 584, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/haier/init.py", line 45, in async_setup_entry 'name': device.name, ^^^^^^^^^^^ File "/config/custom_components/haier/core/device.py", line 27, in name return self._raw_data['deviceName']


KeyError: 'deviceName'
banto6 commented 5 months ago

使用最新master代码试试