Skip to content

[Bug]: yeelink.light.ceiling19和yeelink.light.ceiling20的氛围灯无法控制 #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lns103 opened this issue Dec 16, 2024 · 10 comments
Assignees
Labels
wontfix This will not be worked on

Comments

@lns103
Copy link

lns103 commented Dec 16, 2024

Describe the bug / 描述问题

这两款灯具有氛围灯,但是Xiaomi Home只能控制主灯的开关和状态

To Reproduce / 复现步骤

image

Expected behavior / 预期结果

提供氛围灯的亮度和色彩控制

Home Assistant Logs / 系统日志

No response

Home Assistant Core version / Home Assistant Core 版本

2024.12.3

Home Assistant Operation System version / Home Assistant Operation System 版本

N/A 使用的docker版本

Xiaomi Home integration version / 米家集成版本

v0.1.0

Additional context / 其他说明

这是ceiling19在Yeelight集成中的可控制项
image
image

@lns103 lns103 added the bug Something isn't working label Dec 16, 2024
@SusanPhevos SusanPhevos self-assigned this Dec 17, 2024
@SusanPhevos
Copy link
Contributor

yeelink.light.ceiling19yeelink.light.ceiling20的MIoT-Spec-V2定义只有一个Light,故xiaomi_home只能生成一个Light Entity

@lns103
Copy link
Author

lns103 commented Dec 17, 2024

隔壁项目似乎自定义了MIoT-Spec-V2来实现控制,能否修复该设备的官方spec?或者让xiaomi_home支持修改Spec定义 https://github.com/al-one/hass-xiaomi-miot/blob/d5a4076861b24185bd216f013ac9ad72ec12e7de/custom_components/xiaomi_miot/core/miot_specs_extend.json#L1453

@SusanPhevos SusanPhevos added enhancement New feature or request and removed bug Something isn't working labels Dec 18, 2024
@SusanPhevos
Copy link
Contributor

请帮忙验证一下 #284 是不是你想要的效果,获取PR后需要重启 Home Assistant,并且勾选 配置>更新实体转换规则,重新载入一遍设备。

@lns103
Copy link
Author

lns103 commented Jan 6, 2025

使用了这个pr里的文件,似乎还是没有出现氛围灯实体设备

@caibinqing
Copy link
Contributor

yeelink.light.lamp15 也有同样的问题,看 spec 似乎是用 yeelight 定义了另一个灯。

测试了 pr284 ,仿照添加了 "urn:miot-spec-v2:device:light:0000A001:yeelink-lamp15": "urn:miot-spec-v2:device:light:0000A001:yeelink-ceiling4",,但没能解决问题。

@SusanPhevos
Copy link
Contributor

请帮忙验证一下 #953 是否能解决您的问题。获取 PR 后,需要重启 Home Assistant,并且勾选 xiaomi_home > 配置 > 更新实体转换规则 & 更新设备列表,移除设备再重新添加设备。

@lns103
Copy link
Author

lns103 commented Apr 1, 2025

请帮忙验证一下 #953 是否能解决您的问题。获取 PR 后,需要重启 Home Assistant,并且勾选 xiaomi_home > 配置 > 更新实体转换规则 & 更新设备列表,移除设备再重新添加设备。

有实体设备了,但是无法获取状态,无法控制

Image

home-assistant_2025-04-01T13-35-25.941Z.log

@SusanPhevos
Copy link
Contributor

请帮忙验证一下 #953 是否能解决您的问题。获取 PR 后,需要重启 Home Assistant,并且勾选 xiaomi_home > 配置 > 更新实体转换规则 & 更新设备列表,移除设备再重新添加设备。

有实体设备了,但是无法获取状态,无法控制

Image

home-assistant_2025-04-01T13-35-25.941Z.log

氛围灯服务不在设备的 MIoT-Spec-V2 定义中,中枢网关无法识别氛围灯的相关属性。看来如果用中枢本地控制,就无法使用未定义的设备属性。
您试试将中枢网关断电,看能否通过云端控制氛围灯?

@lns103
Copy link
Author

lns103 commented Apr 2, 2025

一样无法控制,报错似乎有区别

2025-04-02 02:56:51.556 ERROR (1535260fe96ffde6) [custom_components.xiaomi_home.miot.miot_client] 家, __mips_connect, connect error, [Errno 113] Host is unreachable
2025-04-02 02:56:51.556 ERROR (1535260fe96ffde6) [custom_components.xiaomi_home.miot.miot_client] 家, __mips_connect error result, 13
2025-04-02 02:56:51.557 ERROR (1535260fe96ffde6) [custom_components.xiaomi_home.miot.miot_client] 家, mips try reconnect after 6s
2025-04-02 02:56:55.148 DEBUG (MainThread) [custom_components.xiaomi_home.miot.miot_client] show device list changed notify, add 0, del 0, offline 12
2025-04-02 02:56:55.288 DEBUG (MainThread) [custom_components.xiaomi_home.miot.miot_cloud] mihome api post, https://ha.api.io.mi.com/app/v2/miotspec/prop/set, {'params': [{'did': '583510233', 'siid': 200, 'piid': 201, 'value': True}]} -> {'code': 0, 'message': 'ok', 'result': [{'did': '583510233', 'iid': '0.200.201', 'siid': 200, 'piid': 201, 'code': -704040002, 'exe_time': 0}]}
2025-04-02 02:56:55.288 DEBUG (MainThread) [custom_components.xiaomi_home.miot.miot_client] set prop response, 583510233.200.201, True, result, [{'did': '583510233', 'iid': '0.200.201', 'siid': 200, 'piid': 201, 'code': -704040002, 'exe_time': 0}]
2025-04-02 02:56:55.289 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140189181429216] Unexpected exception
Traceback (most recent call last):
  File "/config/custom_components/xiaomi_home/miot/miot_device.py", line 1049, in set_property_async
    await self.miot_device.miot_client.set_prop_async(
        did=self.miot_device.did, siid=prop.service.iid,
        piid=prop.iid, value=value)
  File "/config/custom_components/xiaomi_home/miot/miot_client.py", line 678, in set_prop_async
    raise MIoTClientError(
        self.__get_exec_error_with_rc(rc=rc))
custom_components.xiaomi_home.miot.miot_error.MIoTClientError: 执行错误, Service不存在

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 245, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<7 lines>...
    )
    ^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2794, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2837, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1007, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
        hass, entity, func, data, call.context
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1079, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 648, in async_handle_light_on_service
    await light.async_turn_on(**filter_turn_on_params(light, params))
  File "/config/custom_components/xiaomi_home/light.py", line 257, in async_turn_on
    await self.set_property_async(
        prop=self._prop_on, value=value_on)
  File "/config/custom_components/xiaomi_home/miot/miot_device.py", line 1053, in set_property_async
    raise RuntimeError(
        f'{e}, {self.entity_id}, {self.name}, {prop.name}') from e
RuntimeError: 执行错误, Service不存在, light.yeelink_cn_583510233_ceiling20_s_200_ambient_light,  氛围灯, on
2025-04-02 02:56:57.863 DEBUG (MainThread) [custom_components.xiaomi_home.miot.miot_cloud] mihome api post, https://ha.api.io.mi.com/app/v2/miotspec/prop/set, {'params': [{'did': '583510233', 'siid': 200, 'piid': 201, 'value': False}]} -> {'code': 0, 'message': 'ok', 'result': [{'did': '583510233', 'iid': '0.200.201', 'siid': 200, 'piid': 201, 'code': -704040002, 'exe_time': 0}]}
2025-04-02 02:56:57.864 DEBUG (MainThread) [custom_components.xiaomi_home.miot.miot_client] set prop response, 583510233.200.201, False, result, [{'did': '583510233', 'iid': '0.200.201', 'siid': 200, 'piid': 201, 'code': -704040002, 'exe_time': 0}]
2025-04-02 02:56:57.864 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140189181429216] Unexpected exception
Traceback (most recent call last):
  File "/config/custom_components/xiaomi_home/miot/miot_device.py", line 1049, in set_property_async
    await self.miot_device.miot_client.set_prop_async(
        did=self.miot_device.did, siid=prop.service.iid,
        piid=prop.iid, value=value)
  File "/config/custom_components/xiaomi_home/miot/miot_client.py", line 678, in set_prop_async
    raise MIoTClientError(
        self.__get_exec_error_with_rc(rc=rc))
custom_components.xiaomi_home.miot.miot_error.MIoTClientError: 执行错误, Service不存在

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 245, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<7 lines>...
    )
    ^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2794, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2837, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1007, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
        hass, entity, func, data, call.context
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1079, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 659, in async_handle_light_off_service
    await light.async_turn_off(**filter_turn_off_params(light, params))
  File "/config/custom_components/xiaomi_home/light.py", line 298, in async_turn_off
    await self.set_property_async(prop=self._prop_on, value=value_on)
  File "/config/custom_components/xiaomi_home/miot/miot_device.py", line 1053, in set_property_async
    raise RuntimeError(
        f'{e}, {self.entity_id}, {self.name}, {prop.name}') from e
RuntimeError: 执行错误, Service不存在, light.yeelink_cn_583510233_ceiling20_s_200_ambient_light,  氛围灯, on
2025-04-02 02:57:00.676 ERROR (1535260fe96ffde6) [custom_components.xiaomi_home.miot.miot_client] 家, __mips_connect, connect error, [Errno 113] Host is unreachable
2025-04-02 02:57:00.676 ERROR (1535260fe96ffde6) [custom_components.xiaomi_home.miot.miot_client] 家, __mips_connect error result, 13
2025-04-02 02:57:00.677 ERROR (1535260fe96ffde6) [custom_components.xiaomi_home.miot.miot_client] 家, mips try reconnect after 12s

@SusanPhevos
Copy link
Contributor

小米云服务为 xiaomi_home 提供的接口也严格检查了设备 MIoT-Spec-V2,故 xiaomi_home 无法通过云端控制未定义的设备属性。

@SusanPhevos SusanPhevos added wontfix This will not be worked on and removed enhancement New feature or request labels Apr 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants