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

 找回密码
 立即注册
楼主: esanisa

[插件集成] [240429] LifeSmart 云起设备一站式 HACS (窗帘、门锁、传感器等

[复制链接]

1

主题

35

帖子

270

积分

论坛技术达人

积分
270
金钱
230
HASS币
20
 楼主| 发表于 2024-5-1 12:34:04 | 显示全部楼层
yun59t 发表于 2024-5-1 12:23
前段时间安装了一次,这次又安装了,每次设备都是空的,导不进来。
原先是采用手动安装的方法,只有实体没 ...

你的是什么设备,目前门锁、传感器、窗帘应该都是可以获取到的(基于官方的API给的结果),或者你看看hass的日志里面有没有什么报错。

另外如果只是门锁模块需要找官方申请授权才能获取到实体,否则你的这些设备都只有传感器,没有实体,但是也可以监控状态
回复

使用道具 举报

13

主题

82

帖子

342

积分

中级会员

Rank: 3Rank: 3

积分
342
金钱
260
HASS币
0
发表于 2024-5-1 12:39:28 | 显示全部楼层
本帖最后由 yun59t 于 2024-5-1 13:25 编辑
esanisa 发表于 2024-5-1 12:34
你的是什么设备,目前门锁、传感器、窗帘应该都是可以获取到的(基于官方的API给的结果),或者你看看has ...

流光开关、幻彩灯带、动态感应器、门禁感应器、灯泡、超级碗、水浸感应器、随心开关、wifi插座,一个都没接入。之前也是用你的集成,手动拷入,然后yaml中配置这些参数,虽然没在设备中出现,但实体中都有。删除后安装插件了,实体中的没了,设备也没导入进来。用原先的usertoken不行,重新生了个usertoken也不成。通过备份返回去之前的手动版,还是能用。

日志: homeassistant.components.recorder.db_schema
来源: components/recorder/db_schema.py:598
集成: Recorder (文档, 问题)
首次发生: 12:55:07 (4 全部发生)
上次记录: 13:12:07
State attributes for weather.fuzhou exceed maximum size of 16384 bytes. This can cause database performance issues; Attributes will not be stored


此错误来自自定义集成。

日志: homeassistant.components.cover
来源: helpers/entity_platform.py:356
集成: 窗帘 (文档, 问题)
首次发生: 13:06:52 (1 全部发生)
上次记录: 13:06:52

Error while setting up lifesmart platform for cover
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 356, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/config/custom_components/lifesmart/cover.py", line 36, in async_setup_entry
    for device in devices:
TypeError: 'bool' object is not iterable


日志: custom_components.lifesmart
来源: custom_components/lifesmart/__init__.py:400
集成: LifeSmart IoT Integration (文档, 问题)
首次发生: 13:07:12 (1 全部发生)
上次记录: 13:07:12
Lifesmart HACS: WebSocket closed without authentication. Check if the authentication process is working correctly.


此错误来自自定义集成。

日志: custom_components.lifesmart
来源: custom_components/lifesmart/__init__.py:418
集成: LifeSmart IoT Integration (文档, 问题)
首次发生: 13:07:12 (1 全部发生)
上次记录: 13:07:12
Lifesmart HACS: Received unknown message type: {'message': 'sign error', 'code': 10004, 'id': 1}


日志: homeassistant.components.sensor
来源: helpers/entity_platform.py:356
集成: 传感器 (文档, 问题)
首次发生: 13:06:52 (1 全部发生)
上次记录: 13:06:52
Error while setting up lifesmart platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 356, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/config/custom_components/lifesmart/sensor.py", line 45, in async_setup_entry
    for device in devices:
TypeError: 'bool' object is not iterable


日志: homeassistant.components.binary_sensor
来源: helpers/entity_platform.py:356
集成: 二元传感器 (文档, 问题)
首次发生: 13:06:52 (1 全部发生)
上次记录: 13:06:52

Error while setting up lifesmart platform for binary_sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 356, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/config/custom_components/lifesmart/binary_sensor.py", line 41, in async_setup_entry
    for device in devices:
TypeError: 'bool' object is not iterable


日志: homeassistant.components.switch
来源: helpers/entity_platform.py:356
集成: 开关 (文档, 问题)
首次发生: 13:06:52 (1 全部发生)
上次记录: 13:06:52

Error while setting up lifesmart platform for switch
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 356, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/config/custom_components/lifesmart/switch.py", line 46, in async_setup_entry
    for device in devices:
TypeError: 'bool' object is not iterable


日志: homeassistant.components.stream.stream.camera.she_xiang_tou_mainstream
来源: components/stream/__init__.py:448
集成: Stream (文档, 问题)
首次发生: 13:06:42 (1 全部发生)
上次记录: 13:06:42
Error from stream worker: Error demuxing stream: [Errno 110] Operation timed out: 'rtsp://admin:[email protected]:554/stream1'
导出的日志:

2024-05-01 13:06:42.786 ERROR (stream_worker) [homeassistant.components.stream.stream.camera.she_xiang_tou_mainstream] Error from stream worker: Error demuxing stream: [Errno 110] Operation timed out: 'rtsp://admin:[email protected]:554/stream1'
2024-05-01 13:06:52.628 ERROR (MainThread) [homeassistant.components.switch] Error while setting up lifesmart platform for switch
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 356, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/config/custom_components/lifesmart/switch.py", line 46, in async_setup_entry
    for device in devices:
TypeError: 'bool' object is not iterable
2024-05-01 13:06:52.635 ERROR (MainThread) [homeassistant.components.binary_sensor] Error while setting up lifesmart platform for binary_sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 356, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/config/custom_components/lifesmart/binary_sensor.py", line 41, in async_setup_entry
    for device in devices:
TypeError: 'bool' object is not iterable
2024-05-01 13:06:52.642 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up lifesmart platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 356, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/config/custom_components/lifesmart/sensor.py", line 45, in async_setup_entry
    for device in devices:
TypeError: 'bool' object is not iterable
2024-05-01 13:06:52.650 ERROR (MainThread) [homeassistant.components.cover] Error while setting up lifesmart platform for cover
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 356, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/config/custom_components/lifesmart/cover.py", line 36, in async_setup_entry
    for device in devices:
TypeError: 'bool' object is not iterable
2024-05-01 13:07:07.263 WARNING (Recorder) [homeassistant.components.recorder.db_schema] State attributes for weather.fuzhou exceed maximum size of 16384 bytes. This can cause database performance issues; Attributes will not be stored
2024-05-01 13:07:12.945 WARNING (MainThread) [custom_components.lifesmart] Lifesmart HACS: Received unknown message type: {'message': 'sign error', 'code': 10004, 'id': 1}
2024-05-01 13:07:12.946 ERROR (MainThread) [custom_components.lifesmart] Lifesmart HACS: WebSocket closed without authentication. Check if the authentication process is working correctly.
2024-05-01 13:12:07.061 WARNING (Recorder) [homeassistant.components.recorder.db_schema] State attributes for weather.fuzhou exceed maximum size of 16384 bytes. This can cause database performance issues; Attributes will not be stored




回复

使用道具 举报

1

主题

35

帖子

270

积分

论坛技术达人

积分
270
金钱
230
HASS币
20
 楼主| 发表于 2024-5-1 22:39:11 | 显示全部楼层
yun59t 发表于 2024-5-1 12:39
流光开关、幻彩灯带、动态感应器、门禁感应器、灯泡、超级碗、水浸感应器、随心开关、wifi插座,一个都没 ...

我看了一下,有几个错误是说你的 usertoken 认证失效了,你可能需要新认证一个,今年他新生成的 token 绑定 api 地址了,也就是你进那个授权页面用 app 帐号登录之后,会返回一个地址带 usertoken 后面还会跟一个 api 域名,必须要用那个否则认证失败,其他的错误日志要等5.1之后我回去看了,现在在外面玩不是很方便调试
回复

使用道具 举报

1

主题

35

帖子

270

积分

论坛技术达人

积分
270
金钱
230
HASS币
20
 楼主| 发表于 2024-5-1 22:42:58 | 显示全部楼层
日志: custom_components.lifesmart
来源: custom_components/lifesmart/__init__.py:418
集成: LifeSmart IoT Integration (文档, 问题)
首次发生: 13:07:12 (1 全部发生)
上次记录: 13:07:12
Lifesmart HACS: Received unknown message type: {'message': 'sign error', 'code': 10004, 'id': 1}

这里 Websocket 没有通过验证,所以 Websocket 直接就不通信了,和之前那样,虽然没设备,但是实体会经过通信生成,现在为了保证 websocket 一直通信保持,所以如果认证都过不去就不通信了暂时,提示是签名错误。

所以你如果用新的HACS 插件,config 那个 yaml 里面最好注释掉 Lifesmart 相关的配置,然后最好是重新走一遍认证拿到新的 UserToken
回复

使用道具 举报

13

主题

82

帖子

342

积分

中级会员

Rank: 3Rank: 3

积分
342
金钱
260
HASS币
0
发表于 2024-5-2 00:34:43 | 显示全部楼层
esanisa 发表于 2024-5-1 22:42
日志: custom_components.lifesmart
来源: custom_components/lifesmart/__init__.py:418
集成: LifeSmart  ...

好咧,明天我再试试。
作为纯小白,再向大神确认两个疑问:
1、这段配置中的 url是生成新token时,系统返回的一个地址,而不是代码中提供那两个api地址二选一对吧。
lifesmart:
  appkey: # 你应用的 appkey
  apptoken: # 你应用的 apptoken
  usertoken: # 你获取到的 usertoken
  userid: # 你获取到的 userid
  url:  # 你使用的 api 地址,建议使用 api.cn0.ilifesmart.com 或者 api.cn2.ilifesmart.com

2、生成新token时这里有个http://localhost,是直接用这个,有内容返回就成,还是需要填其他的?
import time
import hashlib
tick = int(time.time())
appkey = "你的应用 APPKEY"
callbackurl = "http://localhost"
apptoken = "你的应用 APPK TOKEN"
回复

使用道具 举报

1

主题

35

帖子

270

积分

论坛技术达人

积分
270
金钱
230
HASS币
20
 楼主| 发表于 2024-5-5 12:28:52 | 显示全部楼层
yun59t 发表于 2024-5-2 00:34
好咧,明天我再试试。
作为纯小白,再向大神确认两个疑问:
1、这段配置中的 url是生成新token时,系统返 ...

都要看lifesmart授权之后的返回值,那个返回地址无所谓,只是看返回值用的
回复

使用道具 举报

13

主题

82

帖子

342

积分

中级会员

Rank: 3Rank: 3

积分
342
金钱
260
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安装集成,添加集成登录:
327924382-38735181-ba55-4324-bca2-ea49cd82e51d.png
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、麻烦大神帮忙看看,问题出在哪。

回复

使用道具 举报

2

主题

15

帖子

132

积分

注册会员

Rank: 2

积分
132
金钱
117
HASS币
0
发表于 2024-5-5 15:21:27 来自手机 | 显示全部楼层
刚刚去淘宝店铺看了一下,超级超级贵,一个仅带指纹的门锁需要2000元,没有人脸识别,没有摄像头猫眼,更不谈结构光之类的,实在无法理解。顺嘴说一句,这个锁外形和我100元京东买的基本无差,大概率是oem。
回复

使用道具 举报

1

主题

35

帖子

270

积分

论坛技术达人

积分
270
金钱
230
HASS币
20
 楼主| 发表于 2024-5-5 21:39:56 | 显示全部楼层
本帖最后由 esanisa 于 2024-5-5 21:50 编辑
yun59t 发表于 2024-5-5 13:43
昨天又重新尝试,无法登录。过程如下:
1、在lifesmart官网取得了, appkey、apptoken。
2、运行python脚本 ...

域名填错了,域名只用填域名,不要带奇怪的协议,这个破公司有很多通信协议
回复

使用道具 举报

1

主题

35

帖子

270

积分

论坛技术达人

积分
270
金钱
230
HASS币
20
 楼主| 发表于 2024-5-5 21:41:16 | 显示全部楼层
本帖最后由 esanisa 于 2024-5-5 21:55 编辑
qq123000qq 发表于 2024-5-5 15:21
刚刚去淘宝店铺看了一下,超级超级贵,一个仅带指纹的门锁需要2000元,没有人脸识别,没有摄像头猫眼,更不 ...

云起主要是给其它没有智能接入的门锁做通信模块用的,比如yale等,这样可以让他们接入到apple或者ha里面
另外很多开发商的装修给的都是他家的设备
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-5-29 07:35 , Processed in 0.103176 second(s), 33 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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