Skip to content
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

Feature(ED): 厨下式净水器所有传感器都显示 未知 #352

Open
jesson20121020 opened this issue Oct 8, 2024 · 29 comments · May be fixed by midea-lan/midea-local#328
Open

Feature(ED): 厨下式净水器所有传感器都显示 未知 #352

jesson20121020 opened this issue Oct 8, 2024 · 29 comments · May be fixed by midea-lan/midea-local#328
Labels
add_new_feature bug Something isn't working

Comments

@jesson20121020
Copy link

HA版本

2024.10.1

集成版本

0.6.2

之前可正常使用的集成版本

不确定,大概是半年前

设备类型及型号

Water Drinking Appliance 6321898A (4481)

使用的App

美的美居

问题详细描述

不确定是从哪个版本开始坏的。
image

The logs

2024-10-08 21:24:27.774 DEBUG (厨下式净水机) [midealocal.device] [162727723851771] refresh_status with cmds: [<midealocal.devices.ed.message.MessageQuery object at 0x7f52b91b7ef0>], check_protocol False
2024-10-08 21:24:27.774 DEBUG (厨下式净水机) [midealocal.device] [162727723851771] refresh_status with cmd: {'_device_type': <DeviceType.ED: 237>, '_message_type': <MessageType.query: 3>, '_body_type': <BodyType.X00: 0>, '_message_protocol_version': 0, 'header': 'aa0ced00000000000003', 'body': '0001', 'message_type': 'query', 'body_type': '00', 'self': <midealocal.devices.ed.message.MessageQuery object at 0x7f52b91b7ef0>}, unsupported protocol, SKIP
2024-10-08 21:24:27.774 DEBUG (厨下式净水机) [midealocal.device] [162727723851771] all the query cmds failed [<midealocal.devices.ed.message.MessageQuery object at 0x7f52b91b7ef0>], please report bug
2024-10-08 21:24:27.774 DEBUG (厨下式净水机) [midealocal.device] [162727723851771] No Supported protocol
2024-10-08 21:24:27.774 DEBUG (厨下式净水机) [midealocal.device] [162727723851771] refresh_status with cmds: [<midealocal.devices.ed.message.MessageQuery object at 0x7f52b91b7ef0>], check_protocol False
2024-10-08 21:24:27.774 DEBUG (厨下式净水机) [midealocal.device] [162727723851771] refresh_status with cmd: {'_device_type': <DeviceType.ED: 237>, '_message_type': <MessageType.query: 3>, '_body_type': <BodyType.X00: 0>, '_message_protocol_version': 0, 'header': 'aa0ced00000000000003', 'body': '0001', 'message_type': 'query', 'body_type': '00', 'self': <midealocal.devices.ed.message.MessageQuery object at 0x7f52b91b7ef0>}, unsupported protocol, SKIP
2024-10-08 21:24:27.774 DEBUG (厨下式净水机) [midealocal.device] [162727723851771] all the query cmds failed [<midealocal.devices.ed.message.MessageQuery object at 0x7f52b91b7ef0>], please report bug
2024-10-08 21:24:27.774 DEBUG (厨下式净水机) [midealocal.device] [162727723851771] No Supported protocol
2024-10-08 21:24:27.774 DEBUG (厨下式净水机) [midealocal.device] [162727723851771] refresh_status with cmds: [<midealocal.devices.ed.message.MessageQuery object at 0x7f52b91b7ef0>], check_protocol False

@jesson20121020 jesson20121020 added the bug Something isn't working label Oct 8, 2024
@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Title: All sensors of the kitchen water purifier show Unknown

@chemelli74
Copy link
Collaborator

You log shows:

unsupported protocol, SKIP

@EricCorleone
Copy link

我的空调和洗碗机也遇到这种情况,回退到0.5.7就解决了

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


My air conditioner and dishwasher also encountered this problem, and it was solved by returning to 0.5.7

@wuwentao
Copy link
Owner

wuwentao commented Oct 9, 2024

@jesson20121020 提供一下设备的SN信息(可以从美居app设备信息里面复制粘贴),这个需要新增设备的协议解析。当前净水器的协议并不适合你这款设备,所以才会报unsupported protocol, SKIP.

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@jesson20121020 Provide the SN information of the device (you can copy and paste it from the device information of the Meiju app). This requires protocol analysis of the new device. The current protocol of the water purifier is not suitable for your device, so it reports unsupported protocol, SKIP.

@wuwentao
Copy link
Owner

wuwentao commented Oct 9, 2024

我的空调和洗碗机也遇到这种情况,回退到0.5.7就解决了

可能表面上看,是相同的结果,但是问题的原因并不一定一样。
请提供设备详细信息和debug log,并提供设备SN更佳。

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


My air conditioner and dishwasher also encountered this problem, and it was solved by returning to 0.5.7

On the surface, the results may appear to be the same, but the causes of the problems are not necessarily the same.
Please provide device details and debug log, and it is better to provide device SN.

@jesson20121020
Copy link
Author

@jesson20121020 提供一下设备的SN信息(可以从美居app设备信息里面复制粘贴),这个需要新增设备的协议解析。当前净水器的协议并不适合你这款设备,所以才会报unsupported protocol, SKIP.

@wuwentao
SN: 0000ED2116321898A12252S00254QT4K

474a5c37eb0b870e16b0883084968de

@wuwentao
Copy link
Owner

wuwentao commented Oct 9, 2024

多谢,我自己也有一个colmo的管线机DA01,也是ED类型,也报这个错误,但是功能太简单了,没有净水,滤芯等功能,大部分功能我本地都加了一些,但是还没提交进来,也不确定净水机具体有多少款,后续我加上以后,帮忙测试和反馈一下最新的状态即可。

可以通过首页README的Discord Chat链接加入

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Thank you. I also have a colmo pipeline machine DA01, which is also an ED type. I also reported this error, but the function is too simple. There is no water purification, filter element and other functions. I have added most of the functions locally, but have not submitted them yet. , I am not sure how many models of water purifiers there are. I will add them later and help test and give feedback on the latest status.

@wuwentao wuwentao changed the title 厨下式净水器所有传感器都显示 未知 Feature(ED): 厨下式净水器所有传感器都显示 未知 Oct 9, 2024
@jesson20121020
Copy link
Author

经抓包测试发现, 我的这个净水器设备的device_class 是BodyType.X01, 原来是BodyType.X00, 修改后测试各传感器都已正常。
image

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


After the packet capture test, it was found that the device_class of my water purifier equipment is BodyType.
image

@wuwentao
Copy link
Owner

wuwentao commented Oct 14, 2024

@jesson20121020 多谢确认,帮忙提供一个你现在修改以后的 debug log吧。
以及你修改的代码等。

我看看怎么单独加一个if/else的判断和匹配条件来解决吧

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Thank you for confirming. My local pipeline machine is also X01. I have been debugging it locally for a while, but other functions could not be confirmed, so I did not submit the code.
And I’m fixing other bugs recently. I’ll submit the changes later. You can modify them locally first and use them temporarily.

@jesson20121020
Copy link
Author

@jesson20121020 多谢确认,帮忙提供一个你现在修改以后的 debug log吧。 以及你修改的代码等。

我看看怎么单独加一个if/else的判断和匹配条件来解决吧

2024-10-14 14:14:31.574 DEBUG (厨下式净水机) [midealocal.device] [162727723851771] refresh_status with cmds: [<midealocal.devices.ed.message.MessageQuery object at 0x7f6b9fd53140>], check_protocol False
2024-10-14 14:14:31.575 DEBUG (厨下式净水机) [midealocal.device] [162727723851771] Sending: {'_device_type': <DeviceType.ED: 237>, '_message_type': <MessageType.query: 3>, '_body_type': <BodyType.X01: 1>, '_message_protocol_version': 0, 'header': 'aa0ced00000000000003', 'body': '0101', 'message_type': 'query', 'body_type': '01', 'self': <midealocal.devices.ed.message.MessageQuery object at 0x7f6b9fd53140>}, query is True
2024-10-14 14:14:31.735 DEBUG (厨下式净水机) [midealocal.devices.ed] [162727723851771] Received: {'_device_type': <DeviceType.ED: 237>, '_message_type': <MessageType.query: 3>, '_body_type': <BodyType.X01: 1>, '_message_protocol_version': 0, '_header': 'aa33ed00000000000003', '_body': <midealocal.devices.ed.message.EDMessageBody01 object at 0x7f6ba5087980>, 'device_class': <BodyType.X01: 1>, '_data': '01010100000000c80f0000000000000233335400000000000029112911a95400000000003c000c0000', 'parser_list': [], 'power': True, 'water_consumption': 4040, 'in_tds': 60, 'out_tds': 12, 'child_lock': True, 'filter1': 183, 'filter2': 183, 'filter3': 903, 'life1': 51, 'life2': 51, 'life3': 84, 'header': 'aa33ed00000000000003', 'body': '01010100000000c80f0000000000000233335400000000000029112911a95400000000003c000c0000', 'message_type': 'query', 'body_type': '01', 'self': <midealocal.devices.ed.message.MessageEDResponse object at 0x7f6b9deb0290>}
2024-10-14 14:14:31.736 DEBUG (厨下式净水机) [midealocal.device] [162727723851771] Status update: {'power': True, 'water_consumption': 4040, 'in_tds': 60, 'out_tds': 12, 'filter1': 183, 'filter2': 183, 'filter3': 903, 'life1': 51, 'life2': 51, 'life3': 84, 'child_lock': True}
2

@wuwentao
Copy link
Owner

多谢,你这个就是query的修改即可。

请试试将midea-local里面devices/ed/__init.py
这行代码:
return [MessageQuery(self._message_protocol_version, self._device_class)]

修改为:
return [MessageQuery(self._message_protocol_version, BodyType.X00), MessageQuery(self._message_protocol_version, BodyType.X01)]

看看是不是就解决的问题?

@jesson20121020

@wuwentao
Copy link
Owner

@jesson20121020 请帮忙抽空确认一下,上面的修改是否能够解决问题,多谢

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@jesson20121020 Please take the time to confirm whether the above modifications can solve the problem. Thank you.

@jesson20121020
Copy link
Author

@jesson20121020 请帮忙抽空确认一下,上面的修改是否能够解决问题,多谢

不要意思,给忘了; 刚测试了下, 还是有点问题, 因为device.py里refresh_status函数中,在for循环中,如果出现了timeout, 就会添加到unspported_protocol中,导致后面的cmd跳过执行了。

2024-10-16 11:42:07.595 DEBUG (厨下式净水机) [midealocal.device] [162727723851771] refresh_status with cmd: {'_device_type': <DeviceType.ED: 237>, '_message_type': <MessageType.query: 3>, '_body_type': <BodyType.X00: 0>, '_message_protocol_version': 0, 'header': 'aa0ced00000000000003', 'body': '0001', 'message_type': 'query', 'body_type': '00', 'self': <midealocal.devices.ed.message.MessageQuery object at 0x7f89e5391130>}, unsupported protocol, SKIP
2024-10-16 11:42:07.595 DEBUG (厨下式净水机) [midealocal.device] [162727723851771] refresh_status with cmd: {'_device_type': <DeviceType.ED: 237>, '_message_type': <MessageType.query: 3>, '_body_type': <BodyType.X01: 1>, '_message_protocol_version': 0, 'header': 'aa0ced00000000000003', 'body': '0101', 'message_type': 'query', 'body_type': '01', 'self': <midealocal.devices.ed.message.MessageQuery object at 0x7f89e3810ad0>}, unsupported protocol, SKIP
2024-10-16 11:42:07.595 DEBUG (厨下式净水机) [midealocal.device] [162727723851771] all the query cmds failed [<midealocal.devices.ed.message.MessageQuery object at 0x7f89e5391130>, <midealocal.devices.ed.message.MessageQuery object at 0x7f89e3810ad0>], please report bug
2024-10-16 11:42:07.595 DEBUG (厨下式净水机) [midealocal.device] [162727723851771] No Supported protocol
2024-10-16 11:42:07.595 DEBUG (厨下式净水机) [midealocal.device] [162727723851771] refresh_status with cmds: [<midealocal.devices.ed.message.MessageQuery object at 0x7f89e5391130>, <midealocal.devices.ed.message.MessageQuery object at 0x7f89e3810920>], check_protocol False
2024-10-16 11:42:07.595 DEBUG (厨下式净水机) [midealocal.device] [162727723851771] refresh_status with cmd: {'_device_type': <DeviceType.ED: 237>, '_message_type': <MessageType.query: 3>, '_body_type': <BodyType.X00: 0>, '_message_protocol_version': 0, 'header': 'aa0ced00000000000003', 'body': '0001', 'message_type': 'query', 'body_type': '00', 'self': <midealocal.devices.ed.message.MessageQuery object at 0x7f89e5391130>}, unsupported protocol, SKIP
2024-10-16 11:42:07.595 DEBUG (厨下式净水机) [midealocal.device] [162727723851771] refresh_status with cmd: {'_device_type': <DeviceType.ED: 237>, '_message_type': <MessageType.query: 3>, '_body_type': <BodyType.X01: 1>, '_message_protocol_version': 0, 'header': 'aa0ced00000000000003', 'body': '0101', 'message_type': 'query', 'body_type': '01', 'self': <midealocal.devices.ed.message.MessageQuery object at 0x7f89e3810920>}, unsupported protocol, SKIP

@wuwentao
Copy link
Owner

@jesson20121020 是的,但是必须要有一个能够返回结果的query,才能生成后续的数据和刷新状态。
按你数偶读是device_class改成01就行了,于是我就新增了一个01的query,但是从你测试的结果看,仍然不能获取到结果。
所以你之前是怎么修改的?并且修改后能够返回你上面的结果。
如果方便Discord Chat快速沟通,可以加入直接聊天,快速解决掉这个问题算了。
如果不方便,那就仍然github issue沟通吧。

按你的描述,应该就是消息查询和解析的问题,具体字段都是一样的。

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@jesson20121020 Yes, but there must be a query that can return results in order to generate subsequent data and refresh the status.
According to your calculation, just change the device_class to 01, so I added a new query of 01, but judging from the results of your test, I still cannot get the result.
So how did you modify it before? And after modification, it can return you the above results.
If it is convenient for Discord Chat to communicate quickly, you can join the direct chat and quickly solve this problem.
If it is inconvenient, then still communicate on github issue.

According to your description, it should be a problem of message query and parsing. The specific fields are the same.

@wuwentao
Copy link
Owner

@jesson20121020 需要提供完整的log,以上log并不能体现任何错误,均是最后已经处于错误状态的log了,无法反应准确的状态和错误。
因此,请使用你能够获取准确数据的代码修改,提供一份完整的debug log file,以附件上传吧,单独几行并不能解决问题。

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@jesson20121020 A complete log needs to be provided. The above logs cannot reflect any errors. They are all logs that are already in an error state at the end and cannot reflect the exact status and errors.
Therefore, please use code modifications that allow you to obtain accurate data, provide a complete debug log file, and upload it as an attachment. A few lines alone will not solve the problem.

@jesson20121020
Copy link
Author

@wuwentao
Copy link
Owner

wuwentao commented Oct 16, 2024

@jesson20121020 多谢提供log,请帮忙继续修改一下代码测试一下:

确实2个文件都需要修改,具体修改内容如下:

1. 将midea-local里面devices/ed/message.py中新增代码:

class MessageQuery01(MessageEDBase):
    """ED message01 query."""

    def __init__(self, protocol_version: int, body_type: BodyType = BodyType.X01) -> None:
        """Initialize ED message query."""
        super().__init__(
            protocol_version=protocol_version,
            message_type=MessageType.query,
            body_type=body_type,
        )

    @property
    def _body(self) -> bytearray:
        return bytearray([0x01])

2. 将midea-local里面devices/ed/__init.py中修改代码:

之前应该已经修改为:
return [MessageQuery(self._message_protocol_version, BodyType.X00), MessageQuery(self._message_protocol_version, BodyType.X01)]

现在需要修改为:
return [MessageQuery(self._message_protocol_version, BodyType.X00), MessageQuery01(self._message_protocol_version, BodyType.X01)]

主要是将后一个MessageQuery改为新增的MessageQuery01即可。

大概率应该就解决问题了,你的其他修改可能也可以回退了

@jesson20121020
Copy link
Author

@jesson20121020 多谢提供log,请帮忙继续修改一下代码测试一下:

确实2个文件都需要修改,具体修改内容如下:

1. 将midea-local里面devices/ed/message.py中新增代码:

class MessageQuery01(MessageEDBase):
    """ED message01 query."""

    def __init__(self, protocol_version: int, body_type: BodyType = BodyType.X01) -> None:
        """Initialize ED message query."""
        super().__init__(
            protocol_version=protocol_version,
            message_type=MessageType.query,
            body_type=body_type,
        )

    @property
    def _body(self) -> bytearray:
        return bytearray([0x01])

2. 将midea-local里面devices/ed/__init.py中修改代码:

之前应该已经修改为: return [MessageQuery(self._message_protocol_version, BodyType.X00), MessageQuery(self._message_protocol_version, BodyType.X01)]

现在需要修改为: return [MessageQuery(self._message_protocol_version, BodyType.X00), MessageQuery01(self._message_protocol_version, BodyType.X01)]

主要是将后一个MessageQuery改为新增的MessageQuery01即可。

大概率应该就解决问题了,你的其他修改可能也可以回退了

已测试 ok

@wuwentao
Copy link
Owner

@jesson20121020 收到,多谢确认,我提交MR,争取下个版本生效吧

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@jesson20121020 Received, thank you for confirming, I will submit MR and try to take effect in the next version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
add_new_feature bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants