- 积分
- 880
- 金钱
- 692
- 威望
- 0
- 贡献
- 0
- HASS币
- 0
高级会员
- 积分
- 880
- 金钱
- 692
- HASS币
- 0
|
发表于 2024-5-5 13:43:39
|
显示全部楼层
昨天又重新尝试,无法登录。过程如下:
1、在lifesmart官网取得了, appkey、apptoken。
2、运行python脚本,取得:usertoken、svrurl、svruid(后面帐号里填区域时,是填url、还是ID?)
import time
import hashlib
tick = int(time.time())
appkey = "省略4位jRibPCv0eFt2qZG2mA"
callbackurl = "http://192.168.8.148:8123" #不懂这个是指什么,是需要具体对应ha管理地址,还是随便填,之前手动安装成功时直接用http://localhost/。hacs时总登录不上,就改用ha的内网登录地址,虽然最后还是失败了。是否要改成外网地址?
apptoken = "省略4位yvoombOk2mVsYvDljA"
sdata = "appkey=" + appkey
sdata += "&auth_callback=" + callbackurl
sdata += "&time=" + str(tick)
sdata += "&apptoken=" + apptoken
sign = hashlib.md5(sdata.encode(encoding='UTF-8')).hexdigest()
url = "https://api.ilifesmart.com/app/auth.authorize?id=001&"
url += "&appkey=" + appkey
url += "&time=" + str(tick)
url += "&auth_callback=" + callbackurl
url += "&sign=" + sign
url += "&lang=zh"
print(url)
3、hacs安装集成,添加集成登录:
4、相关的日志:
-----------------------------------------------------------------------------------------------------------------
此错误来自自定义集成。
日志: custom_components.lifesmart.config_flow
来源: custom_components/lifesmart/config_flow.py:92
集成: LifeSmart IoT Integration (文档, 问题)
首次发生: 12:06:08 (10 全部发生)
上次记录: 12:27:58
Input validation error
-----------------------------------------------------------------------------------------------------------------
日志: aiohttp.server
来源: /usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py:421
首次发生: 12:06:08 (10 全部发生)
上次记录: 12:27:58
Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request
resp = await request_handler(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in _handle
resp = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 88, in ban_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp_session/__init__.py", line 199, in factory
response = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 295, in auth_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware
response = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle
result = await handler(request, **request.match_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 71, in with_admin
return await func(self, request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 222, in post
return await super().post(request, flow_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 73, in wrapper
return await method(view, request, data, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 122, in post
result = await self._flow_mgr.async_configure(flow_id, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 356, in async_configure
result = await self._async_configure(flow_id, user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 402, in _async_configure
result = await self._async_handle_step(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 506, in _async_handle_step
result: _FlowResultT = await getattr(flow, method)(user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/lifesmart/config_flow.py", line 95, in async_step_user
await self.async_set_unique_id(validated["unique_id"])
^^^^^^^^^
UnboundLocalError: cannot access local variable 'validated' where it is not associated with a value
5、版本:
①Home Assistant版本:
Core 024.5.0、Supervisor2024.04.4、Operating System、Frontend【前端】20240501.0
②系统版本:Linux内核版本6.1.32-ophub、架构aarch64、系统版本Debian GNU/Linux 11 (bullseye)
6、麻烦大神帮忙看看,问题出在哪。
|
|