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

美的美居设备无法添加成功 | Can't get available token for this device #275

Open
wuwentao opened this issue Aug 13, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@wuwentao
Copy link
Owner

wuwentao commented Aug 13, 2024

HA版本

No response

集成版本

0.5.5

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

None

设备类型及型号

None

使用的App

美的美居

问题详细描述

说明

问题现象: 从用户角度来看, 有的设备能够添加成功,而有的设备却无法添加成功

目前大量使用美的美居的设备无法在当前midea_ac_lan中添加成功,github也存在大量此类重复的issue/bug,为了方便跟踪这个问题,同时说明当前问题原因及状态,单独创建一个新的issue,来统一跟踪此问题,同时,关闭其他此类重复的issue,避免影响其他问题。

问题背景

目前看应该主要是美的美居app中添加的新设备存在此问题,海外使用msmart app的设备应该暂时无此问题。如有非此情况的,也可以说明,感谢

无法添加的一些原因

  1. 无法添加的设备,均使用美的v3通讯协议,也只有v3协议的设备才需要token,例如旧的v2协议的设备是不需要token的。
  2. 发现设备时,仅做了设备类型探测,而不会去实际控制设备,因此检测显示设备是【支持】,但是真正去添加设备时,需要使用一个【有效的token】去连接设备并控制设备,而目前却不能获取到这个真正能够控制设备的【有效的token】,所以就只能禁止添加设备了。
  3. 当前midea_ac_lan中使用的是局域网控制设备的方案,基于Midea IoT设备的v1 API来实现,而[美的美居]目前使用的是v2 API,并且通过云端来控制设备,而不是局域网控制方案。
  4. 被控制的美的IoT设备正常应该是既能通过局域网控制,也能通过云端控制,但是美的美居相关v1 API功能不可用,都使用v2 api走云端控制。
  5. 以上信息可能也并不完全准确,也可能是美的新款设备的v1 api相关的token获取方式修改或者调整了,但是问题的根源还是没有一个可以控制设备的有效token,没有这个有效的token是无法通过局域网来控制设备的。
  6. 受影响的可能主要是一些新款的设备和型号,后续可能会越来越多。

错误的操作

  • 大量无法添加成功的用户,强行将自己v3协议的IoT设备降级为midea_ac_lan的旧版本,手工修改为v2协议,尝试强制添加该设备,认为设备添加成功就可以控制和使用,然而在使用v2协议添加成功以后,再到github来给我们报各种issue和bug,浪费双方的大量debug时间和精力,这是不可能成功控制设备的。因此新版midea_ac_lan添加设备时会强制校验设备协议和实际选择的协议,直接禁止此类手工修改v3设备为v2协议来添加的错误行为。如果设备使用的是v3协议,禁止使用v2协议去添加,因为这样是不会有任何效果的。就好比一个人在讲英语,你非要用中文和他沟通。

可能的解决方案

  1. 尝试通过个人开发者名义联系美的官方,美的答复不提供个人开发者支持,仅接受企业对企业形式的二次开发和技术支持。
  2. v2 API必须通过美的官方,需要申请license以及授权,才能使用,因此并不能像v1 API来自由使用
  3. 或者有其他兼容v1 API的方案,目前暂未有此类信息或渠道
  4. 其他问题的可能原因讨论或分析,可以通过Discord Chat群组聊天来在线快速沟通,或者通过当前issue跟踪

重复issue处理

由于目前暂时还不能很好的解决问题,但是github存在大量类似的issue,因此,统一将此类issue关闭,duplicate到这个汇总后的issue,方便统一管理和维护issue,同时不影响其他非token问题的issue跟踪和处理。

同时,已经被close的issue,您也可以继续在之前提交的issue上面发送新的update或消息,仍然会收到提醒的,只不过不会显示在open的issue列表里面而已

其他可能的问题原因分析

从开发者角度:目前从软件层面,无法确认该问题的具体原因,因为API未公开

可能的原因更多还是设备的硬件模块或软件功能确实是存在差异的, 例如:

  1. 拆解IoT设备硬件,确认对应的硬件控制模块信息,确认设备硬件信息是否存在差异
  2. 如果硬件无差异,可能是考虑软件版本的差异,例如软件升级等等,或者说软件降级到旧版固件来解决,但是这些目前都尚未有明确的信息和环境来对比验证。
  3. 以上操作,都需要有足够强大的实际动手能力和操作能力,如果有条件的用户或开发者,可以通过Discord Chat群组聊天来在线沟通
  4. 美的美居app使用MIMT抓包方案也尝试过,客户端有加密,设备控制功能会不可用,旧版未尝试,但是美居使用的是v2 api,所以可能不一定有意义
  5. 欢迎Github大佬们提供其他思路或者可能的解决方案,或者有美的官方开发者渠道的,也可以提供协助和支持,感谢。

The logs

No response

@wuwentao wuwentao added the bug Something isn't working label Aug 13, 2024
@Issues-translate-bot
Copy link

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


HA version

No response

Integrated version

0.5.5

Integrated version that worked normally before

None

Equipment type and model

None

App used

Beautiful Mercure

Detailed description of the problem

illustrate

Problem phenomenon: From the user's perspective, some devices can be added successfully, but some devices cannot be added successfully

At present, a large number of devices using Midea and Meiju cannot be successfully added to the current midea_ac_lan. There are also a large number of such repeated issues/bugs on github. In order to facilitate tracking of this issue and explain the cause and status of the current issue, create a new issue separately. Track this issue in a unified manner, and at the same time, close other such duplicate issues to avoid affecting other issues.

Problem background

At present, it seems that this problem mainly occurs in new devices added to the Meiju app. Overseas devices using the msmart app should not have this problem for the time being. If this is not the case, please explain, thank you

#Some reasons why it cannot be added

  1. Devices that cannot be added use the Midea v3 communication protocol, and only devices with the v3 protocol require a token. For example, devices with the old v2 protocol do not require a token.
  2. When a device is discovered, it only detects the device type and does not actually control the device. Therefore, the detection shows that the device is [Supported], but when actually adding a device, you need to use a [valid token] to connect to the device and control it. device, but currently we cannot obtain this [valid token] that can truly control the device, so we can only prohibit adding devices.
  3. Currently midea_ac_lan uses the LAN control device solution, which is implemented based on the v1 API of Midea IoT devices, while [Midea Mercure] currently uses *v2 * API, and controls the device through the cloud instead of the LAN control solution.
  4. The controlled Midea IoT device should normally be controlled through the LAN or the cloud. However, the v1 API functions related to Midea Mercure are not available, so the v2 api is used for cloud control.
  5. The above information may not be completely accurate, or it may be that the token acquisition method related to the v1 api of Midea's new device has been modified or adjusted, but the root of the problem is that there is still no valid token that can control the device. Without this A valid token cannot control the device through the LAN.
  6. Affected may mainly be some new devices and models, and more and more may be affected in the future.

Wrong operation

  • A large number of users who could not be added successfully, ** forcibly downgraded their v3 protocol IoT devices to the old version of midea_ac_lan, manually modified them to v2 protocols, tried to forcefully add the device, and thought that the device could be controlled and used if the device was added successfully**, however After the v2 protocol is successfully added, go to github to report various issues and bugs to us, which wastes a lot of debugging time and energy on both sides. It is impossible to successfully control the device. Therefore, when the new version of midea_ac_lan adds a device, it will be forced to verify the device protocol and the actual selected protocol, directly prohibiting such erroneous behavior of manually modifying the v3 device to add the v2 protocol. If the device uses the v3 protocol, it is prohibited to use the v2 protocol to add it, because it will have no effect. It's like if a person is speaking English, you have to communicate with him in Chinese.

Possible solutions

  1. Try to contact Midea officials in the name of an individual developer. Midea replies that it does not provide individual developer support and only accepts secondary development and technical support in the form of business-to-business.
  2. The v2 API must be officially approved by Midea and needs to apply for a license and authorization before it can be used. Therefore, it cannot be used freely like the v1 API.
  3. There may be other solutions compatible with v1 API. Currently, there is no such information or channel.
  4. For discussion or analysis of possible causes of other problems, you can quickly communicate online through Discord Chat group chat, or track the current issue

Repeat issue processing

Since the problem cannot be solved well yet, but there are a large number of similar issues on github, we will close such issues uniformly and duplicate them into this summarized issue to facilitate unified management and maintenance of issues without affecting other non-token issues. Issue tracking and processing.

Analysis of other possible problem causes

From a developer's perspective: At present, from the software level, it is impossible to confirm the specific cause of this problem because the API is not public.

The possible reason is that there are indeed differences in the hardware modules or software functions of the devices, for example:

  1. Disassemble the IoT device hardware, confirm the corresponding hardware control module information, and confirm whether there are differences in the device hardware information.
  2. If there is no difference in hardware, it may be possible to consider differences in software versions, such as software upgrades, etc., or to downgrade the software to an older version of firmware. However, there is currently no clear information and environment for comparison and verification.
  3. The above operations require strong enough practical and operational abilities. If qualified users or developers can do so through the Discord Chat group chat online communication
  4. I have also tried the MIMT packet capture solution for the Midea Meiju app. The client is encrypted and the device control function will be unavailable. I have not tried it with the old version, but Meiju uses v2 api, so it may not necessarily make sense.
  5. Github bosses are welcome to provide other ideas or possible solutions, or if there are official Midea developer channels, they can also provide assistance and support. Thank you.

The logs

No response

@redhatme
Copy link

redhatme commented Sep 1, 2024

设备型号是否支持是怎么判断的,比如想买一个美的的洗衣机,但不确定是否支持。

@Issues-translate-bot
Copy link

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


How to determine whether a device model is supported? For example, you want to buy a Midea washing machine, but you are not sure whether it is supported.

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

No branches or pull requests

3 participants