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

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

[插件集成] Clash控制器集成发布 - 支持UI添加

[复制链接]

3

主题

31

帖子

261

积分

中级会员

Rank: 3Rank: 3

积分
261
金钱
230
HASS币
0
发表于 2025-2-12 14:45:13 | 显示全部楼层
TypeError: byte indices must be integers or slices, not str
2025-02-12 14:39:52.100 WARNING (SyncWorker_27) [custom_components.haier.select] Device [D8E23F94D5FC] attribute [refSterilizationForcedOn] value [false] not recognizable
2025-02-12 14:39:52.115 WARNING (SyncWorker_16) [custom_components.haier.select] Device [D8E23F94D5FC] attribute [refSterilizationForcedOff] value [false] not recognizable
2025-02-12 14:39:57.183 WARNING (SyncWorker_38) [custom_components.haier.select] Device [D8E23F94D5FC] attribute [refSterilizationForcedOff] value [false] not recognizable
2025-02-12 14:39:57.230 WARNING (SyncWorker_40) [custom_components.haier.select] Device [D8E23F94D5FC] attribute [refSterilizationForcedOn] value [false] not recognizable
2025-02-12 14:40:07.689 ERROR (Thread-3 (_thread_main)) [roborock.version_1_apis.roborock_mqtt_client_v1] [P10 Pro] Failed to connect (Unknown error.)
2025-02-12 14:40:07.689 WARNING (Thread-3 (_thread_main)) [roborock.version_1_apis.roborock_mqtt_client_v1] [P10 Pro] A network protocol error occurred when communicating with the broker.
2025-02-12 14:40:39.432 ERROR (stream_worker) [homeassistant.components.stream.stream.camera.loock_r2_559c_video_doorbell_2] Error from stream worker: Error demuxing stream (INVALIDDATA, Invalid data found when processing input, https://business.smartcamera.api ... 8iyTx7OqngowtOkE%3D)
2025-02-12 14:40:52.113 WARNING (SyncWorker_28) [custom_components.haier.select] Device [D8E23F94D5FC] attribute [refSterilizationForcedOff] value [false] not recognizable
2025-02-12 14:40:52.114 WARNING (SyncWorker_17) [custom_components.haier.select] Device [D8E23F94D5FC] attribute [refSterilizationForcedOn] value [false] not recognizable
2025-02-12 14:40:57.121 WARNING (SyncWorker_36) [custom_components.haier.select] Device [D8E23F94D5FC] attribute [refSterilizationForcedOn] value [false] not recognizable
2025-02-12 14:40:57.122 WARNING (SyncWorker_61) [custom_components.haier.select] Device [D8E23F94D5FC] attribute [refSterilizationForcedOff] value [false] not recognizable
2025-02-12 14:41:46.487 ERROR (MainThread) [frontend.js.modern.202502050] Uncaught error from Chrome 132.0.0.0 on macOS 10.15.7
Error: Failed to execute 'define' on 'CustomElementRegistry': the name "weather-card" has already been used with this registry
window.CustomElementRegistry.define (src/scoped-custom-element-registry.js:44:14)
/hacsfiles/lovelace-colorfulclouds-weather-card/colorfulclouds-weather-card.js:943:16
2025-02-12 14:41:46.488 ERROR (MainThread) [frontend.js.modern.202502050] Uncaught error from Chrome 132.0.0.0 on macOS 10.15.7
Error: Failed to execute 'define' on 'CustomElementRegistry': the name "button-card-action-handler" has already been used with this registry
window.CustomElementRegistry.define (src/scoped-custom-element-registry.js:44:14)
/hacsfiles/button-card/button-card.js:1:24357
2025-02-12 14:41:52.189 WARNING (SyncWorker_61) [custom_components.haier.select] Device [D8E23F94D5FC] attribute [refSterilizationForcedOff] value [false] not recognizable
2025-02-12 14:41:52.197 WARNING (SyncWorker_54) [custom_components.haier.select] Device [D8E23F94D5FC] attribute [refSterilizationForcedOn] value [false] not recognizable
2025-02-12 14:41:57.190 WARNING (SyncWorker_43) [custom_components.haier.select] Device [D8E23F94D5FC] attribute [refSterilizationForcedOff] value [false] not recognizable
2025-02-12 14:41:57.201 WARNING (SyncWorker_47) [custom_components.haier.select] Device [D8E23F94D5FC] attribute [refSterilizationForcedOn] value [false] not recognizable
2025-02-12 14:42:07.767 ERROR (Thread-3 (_thread_main)) [roborock.version_1_apis.roborock_mqtt_client_v1] [P10 Pro] Failed to connect (Unknown error.)
2025-02-12 14:42:07.769 WARNING (Thread-3 (_thread_main)) [roborock.version_1_apis.roborock_mqtt_client_v1] [P10 Pro] A network protocol error occurred when communicating with the broker.
2025-02-12 14:42:08.387 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'str object' has no attribute 'state' when rendering '{{ states('select.clash_instance_gu_zhang_zhuan_yi').state | regex_replace('.*:(.*)', '\\1') }}'
2025-02-12 14:42:10.454 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'str object' has no attribute 'state' when rendering '{{ states('select.clash_instance_gu_zhang_zhuan_yi').state | regex_replace('.*:(.*)', '\\1') }}'
2025-02-12 14:42:16.196 DEBUG (MainThread) [custom_components.clash_controller.coordinator] Clash API initialized for coordinator homeassistant (http___192_168_31_2_9090_)
2025-02-12 14:42:16.196 DEBUG (MainThread) [custom_components.clash_controller.coordinator] Start fetching data from Clash.
2025-02-12 14:42:16.197 DEBUG (MainThread) [custom_components.clash_controller.api] Session created successfully.
2025-02-12 14:42:16.197 DEBUG (MainThread) [custom_components.clash_controller.api] Making GET request to http://192.168.31.2:9090/version, read line: 0.
2025-02-12 14:42:16.198 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'str object' has no attribute 'state' when rendering '{{ states('select.clash_instance_gu_zhang_zhuan_yi').state | regex_replace('.*:(.*)', '\\1') }}'
2025-02-12 14:42:16.203 DEBUG (MainThread) [custom_components.clash_controller.api] Making GET request to http://192.168.31.2:9090/memory, read line: 2.
2025-02-12 14:42:16.204 DEBUG (MainThread) [custom_components.clash_controller.api] Making GET request to http://192.168.31.2:9090/traffic, read line: 1.
2025-02-12 14:42:16.204 DEBUG (MainThread) [custom_components.clash_controller.api] Making GET request to http://192.168.31.2:9090/connections, read line: 0.
2025-02-12 14:42:16.205 DEBUG (MainThread) [custom_components.clash_controller.api] Making GET request to http://192.168.31.2:9090/group, read line: 0.
2025-02-12 14:42:18.205 DEBUG (MainThread) [custom_components.clash_controller.api] Making GET request to http://192.168.31.2:9090/version, read line: 0.
2025-02-12 14:42:18.208 DEBUG (MainThread) [custom_components.clash_controller.coordinator] Finished fetching homeassistant (http___192_168_31_2_9090_) data in 2.012 seconds (success: True)
2025-02-12 14:42:18.208 DEBUG (MainThread) [custom_components.clash_controller.api] Making GET request to http://192.168.31.2:9090/version, read line: 0.
2025-02-12 14:42:18.220 DEBUG (MainThread) [custom_components.clash_controller.base] Entity Upload Speed (http___192_168_31_2_9090__device_upload_speed) initialized.
2025-02-12 14:42:18.220 DEBUG (MainThread) [custom_components.clash_controller.base] Entity Download Speed (http___192_168_31_2_9090__device_download_speed) initialized.
2025-02-12 14:42:18.220 DEBUG (MainThread) [custom_components.clash_controller.base] Entity Upload Traffic (http___192_168_31_2_9090__device_upload_traffic) initialized.
2025-02-12 14:42:18.221 DEBUG (MainThread) [custom_components.clash_controller.base] Entity Download Traffic (http___192_168_31_2_9090__device_download_traffic) initialized.
2025-02-12 14:42:18.221 DEBUG (MainThread) [custom_components.clash_controller.base] Entity Memory Used (http___192_168_31_2_9090__device_memory_used) initialized.
2025-02-12 14:42:18.221 DEBUG (MainThread) [custom_components.clash_controller.base] Entity Connection Number (http___192_168_31_2_9090__device_connection_number) initialized.
2025-02-12 14:42:18.221 DEBUG (MainThread) [custom_components.clash_controller.base] Entity 自动选择 (http___192_168_31_2_9090__device_自动选择) initialized.
2025-02-12 14:42:18.235 DEBUG (MainThread) [custom_components.clash_controller.base] Entity 故障转移 (http___192_168_31_2_9090__device_故障转移) initialized.
2025-02-12 14:42:18.235 DEBUG (MainThread) [custom_components.clash_controller.base] Entity 水云 (http___192_168_31_2_9090__device_水云) initialized.
2025-02-12 14:42:18.235 DEBUG (MainThread) [custom_components.clash_controller.base] Entity GLOBAL (http___192_168_31_2_9090__device_global) initialized.
2025-02-12 14:42:18.247 DEBUG (MainThread) [custom_components.clash_controller.base] Entity Flush FakeIP Cache (http___192_168_31_2_9090__device_flush_fakeip_cache) initialized.
2025-02-12 14:42:18.250 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'str object' has no attribute 'state' when rendering '{{ states('select.clash_instance_gu_zhang_zhuan_yi').state | regex_replace('.*:(.*)', '\\1') }}'
这一段可以嘛
回复

使用道具 举报

5

主题

69

帖子

978

积分

高级会员

Rank: 4

积分
978
金钱
909
HASS币
0
 楼主| 发表于 2025-2-12 15:35:31 | 显示全部楼层
muziguo 发表于 2025-2-12 14:45
TypeError: byte indices must be integers or slices, not str
2025-02-12 14:39:52.100 WARNING (SyncWor ...

你也是实体少的问题吗?看起来是老版本需要先升级,0.1.5修正了大量错误。
如果不是,给出的这段日志没什么内容,那个warning是你自己的template helper写错了,正确应该是去掉“.state”
'{{ states('select.clash_instance_gu_zhang_zhuan_yi') | regex_replace('.*:(.*)', '\\1') }}'
回复

使用道具 举报

0

主题

12

帖子

100

积分

注册会员

Rank: 2

积分
100
金钱
88
HASS币
0
发表于 2025-2-12 17:40:19 | 显示全部楼层
本帖最后由 Zlucy 于 2025-2-12 17:45 编辑

使用的原版 clash 版本 2023.08.17-13-gdcc8d87。更新到0.1.5后,select 选择不生效,在HA中切换了,但是clash没有切换。或者在clash中切换了,但是HA不更新
回复

使用道具 举报

5

主题

69

帖子

978

积分

高级会员

Rank: 4

积分
978
金钱
909
HASS币
0
 楼主| 发表于 2025-2-13 01:49:02 | 显示全部楼层
Zlucy 发表于 2025-2-12 17:40
使用的原版 clash 版本 2023.08.17-13-gdcc8d87。更新到0.1.5后,select 选择不生效,在HA中切换了,但是cl ...

麻烦按文档启用调试日志,使用select切换一次,然后发一下日志
回复

使用道具 举报

0

主题

12

帖子

100

积分

注册会员

Rank: 2

积分
100
金钱
88
HASS币
0
发表于 2025-2-13 11:42:31 | 显示全部楼层
myhades 发表于 2025-2-13 01:49
麻烦按文档启用调试日志,使用select切换一次,然后发一下日志
2025-02-13 11:33:52.035 DEBUG (MainThread) [custom_components.clash_controller.coordinator] Start fetching data from Clash.
2025-02-13 11:33:52.035 DEBUG (MainThread) [custom_components.clash_controller.api] Making GET request to http://192.168.50.3:9090/version, read line: 0.
2025-02-13 11:33:52.037 DEBUG (MainThread) [custom_components.clash_controller.api] Making GET request to http://192.168.50.3:9090/memory, read line: 2.
2025-02-13 11:33:52.037 DEBUG (MainThread) [custom_components.clash_controller.api] Making GET request to http://192.168.50.3:9090/traffic, read line: 1.
2025-02-13 11:33:52.038 DEBUG (MainThread) [custom_components.clash_controller.api] Making GET request to http://192.168.50.3:9090/connections, read line: 0.
2025-02-13 11:33:52.038 DEBUG (MainThread) [custom_components.clash_controller.api] Making GET request to http://192.168.50.3:9090/proxies, read line: 0.
2025-02-13 11:33:53.042 DEBUG (MainThread) [custom_components.clash_controller.coordinator] Finished fetching clash_controller (http://192.168.50.3:9090/) data in 1.007 seconds (success: True)
2025-02-13 11:34:23.034 DEBUG (MainThread) [custom_components.clash_controller.coordinator] Start fetching data from Clash.
2025-02-13 11:34:23.034 DEBUG (MainThread) [custom_components.clash_controller.api] Making GET request to http://192.168.50.3:9090/version, read line: 0.
2025-02-13 11:34:23.036 DEBUG (MainThread) [custom_components.clash_controller.api] Making GET request to http://192.168.50.3:9090/memory, read line: 2.
2025-02-13 11:34:23.037 DEBUG (MainThread) [custom_components.clash_controller.api] Making GET request to http://192.168.50.3:9090/traffic, read line: 1.
2025-02-13 11:34:23.038 DEBUG (MainThread) [custom_components.clash_controller.api] Making GET request to http://192.168.50.3:9090/connections, read line: 0.
2025-02-13 11:34:23.039 DEBUG (MainThread) [custom_components.clash_controller.api] Making GET request to http://192.168.50.3:9090/proxies, read line: 0.
2025-02-13 11:34:24.043 DEBUG (MainThread) [custom_components.clash_controller.coordinator] Finished fetching clash_controller (http://192.168.50.3:9090/) data in 1.009 seconds (success: True)
2025-02-13 11:34:48.820 ERROR (MainThread) [frontend.js.modern.202502100] Failed to format translation for key 'ui.panel.config.tips.join' in language 'zh-Hans'. Error: The intl string context variable "mastodon" was not provided to the string "请加入我们的社区:{forums}、{mastodon}、{bluesky}、{twitter}、{discord}、{blog} 或 {newsletter}"
2025-02-13 11:35:58.726 ERROR (MainThread) [frontend.js.modern.202502100] Failed to format translation for key 'ui.panel.config.tips.join' in language 'zh-Hans'. Error: The intl string context variable "mastodon" was not provided to the string "请加入我们的社区:{forums}、{mastodon}、{bluesky}、{twitter}、{discord}、{blog} 或 {newsletter}"
2025-02-13 11:36:12.949 ERROR (MainThread) [frontend.js.modern.202502100] Failed to format translation for key 'ui.panel.config.tips.join' in language 'zh-Hans'. Error: The intl string context variable "mastodon" was not provided to the string "请加入我们的社区:{forums}、{mastodon}、{bluesky}、{twitter}、{discord}、{blog} 或 {newsletter}"
2025-02-13 11:36:16.305 ERROR (MainThread) [frontend.js.modern.202502100] Failed to format translation for key 'ui.panel.config.tips.join' in language 'zh-Hans'. Error: The intl string context variable "mastodon" was not provided to the string "请加入我们的社区:{forums}、{mastodon}、{bluesky}、{twitter}、{discord}、{blog} 或 {newsletter}"
2025-02-13 11:36:19.515 ERROR (MainThread) [frontend.js.modern.202502100] Failed to format translation for key 'ui.panel.config.tips.join' in language 'zh-Hans'. Error: The intl string context variable "mastodon" was not provided to the string "请加入我们的社区:{forums}、{mastodon}、{bluesky}、{twitter}、{discord}、{blog} 或 {newsletter}"
2025-02-13 11:37:00.936 ERROR (MainThread) [frontend.js.modern.202502100] Failed to format translation for key 'ui.panel.config.tips.join' in language 'zh-Hans'. Error: The intl string context variable "mastodon" was not provided to the string "请加入我们的社区:{forums}、{mastodon}、{bluesky}、{twitter}、{discord}、{blog} 或 {newsletter}"
2025-02-13 11:37:21.502 DEBUG (MainThread) [custom_components.clash_controller.api] Making PUT request to http://192.168.50.3:9090/proxies/Proxy Status, read line: 0.
2025-02-13 11:40:08.005 DEBUG (MainThread) [custom_components.clash_controller.api] Making PUT request to http://192.168.50.3:9090/proxies/Proxy Status, read line: 0.
回复

使用道具 举报

5

主题

69

帖子

978

积分

高级会员

Rank: 4

积分
978
金钱
909
HASS币
0
 楼主| 发表于 2025-2-13 13:23:51 | 显示全部楼层

请更新到v0.1.5.1
回复

使用道具 举报

0

主题

12

帖子

100

积分

注册会员

Rank: 2

积分
100
金钱
88
HASS币
0
发表于 2025-2-13 14:59:48 | 显示全部楼层

可以了
回复

使用道具 举报

0

主题

12

帖子

100

积分

注册会员

Rank: 2

积分
100
金钱
88
HASS币
0
发表于 2025-2-14 14:35:14 | 显示全部楼层
大佬,我又来了,select 选择不生效的问题解决了,但是在clash中切换,HA不更新的问题还存在
其他的数据都会更新,就这个选择不会更新。
这是日志,但是看起来好像正常:
2025-02-14 14:34:27.076 DEBUG (MainThread) [custom_components.clash_controller.coordinator] Start fetching data from Clash.
2025-02-14 14:34:27.076 DEBUG (MainThread) [custom_components.clash_controller.api] Making GET request to http://192.168.50.3:9090/version, read line: 0.
2025-02-14 14:34:27.078 DEBUG (MainThread) [custom_components.clash_controller.api] Making GET request to http://192.168.50.3:9090/memory, read line: 2.
2025-02-14 14:34:27.078 DEBUG (MainThread) [custom_components.clash_controller.api] Making GET request to http://192.168.50.3:9090/traffic, read line: 1.
2025-02-14 14:34:27.079 DEBUG (MainThread) [custom_components.clash_controller.api] Making GET request to http://192.168.50.3:9090/connections, read line: 0.
2025-02-14 14:34:27.079 DEBUG (MainThread) [custom_components.clash_controller.api] Making GET request to http://192.168.50.3:9090/proxies, read line: 0.
2025-02-14 14:34:28.081 DEBUG (MainThread) [custom_components.clash_controller.coordinator] Finished fetching clash_controller (http://192.168.50.3:9090/) data in 1.004 seconds (success: True)
回复

使用道具 举报

5

主题

69

帖子

978

积分

高级会员

Rank: 4

积分
978
金钱
909
HASS币
0
 楼主| 发表于 2025-2-14 16:34:42 | 显示全部楼层
Zlucy 发表于 2025-2-14 14:35
大佬,我又来了,select 选择不生效的问题解决了,但是在clash中切换,HA不更新的问题还存在
其他的数据都 ...

才发现select类很多问题之前都没人发现,非常感谢。。。
麻烦升级到v0.1.5.2。
回复

使用道具 举报

5

主题

49

帖子

1088

积分

金牌会员

Rank: 6Rank: 6

积分
1088
金钱
1039
HASS币
0
发表于 2025-2-14 17:11:23 | 显示全部楼层
我是openclash,找不到api在哪,这麻烦了
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2025-3-5 01:01 , Processed in 0.121029 second(s), 30 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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