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

Authentication failed when running midea-discover #69

Closed
GrabkaMan opened this issue Mar 4, 2022 · 2 comments
Closed

Authentication failed when running midea-discover #69

GrabkaMan opened this issue Mar 4, 2022 · 2 comments

Comments

@GrabkaMan
Copy link

Hey,

I've been trying to add my Rotenso AC unit for few days now with different options and can't add it to HA.

The biggest issues - I think - is when trying to run midea-discover
This is my response:

INFO:msmart.cli:msmart version: 0.2.2 Currently only supports ac devices.
ERROR:msmart.security:authentication failed
ERROR:msmart.lan:Authentication failed for 192.168.3.2:2583 -> 192.168.3.44:6444 retries: 0 time: 0.05
ERROR:msmart.security:authentication failed
ERROR:msmart.lan:Authentication failed for 192.168.3.2:2585 -> 192.168.3.35:6444 retries: 0 time: 0.03
INFO:msmart.lan:Got TCP key for 192.168.3.2:2583 -> 192.168.3.44:6444 retries: 0 time: 0.45 ebe0b222823a7740dd31b342b0a65390f48dcd5dc3827ab66d9b49b172258a14
INFO:msmart.lan:Got TCP key for 192.168.3.2:2585 -> 192.168.3.35:6444 retries: 0 time: 0.28 1de136ccfe1877b0b90bd43071498c8a93a86c9ca10ef22054d8c1111f825028
INFO:msmart.cli:*** Found a device: ←[94m←[1m{'type': 'ac', 'support': True, 'version': 3, 'ip': '192.168.3.35', 'id': **ID**, 'port': 6444, 'token': '**TOKEN**', 'key': '**KEY**'

+The second devices data

The thing is when I run the midea-discover the second time I get different TOKEN and KEY. The rest of the data is the same.

Any ideas why this happens?

I've also tried using my credentials, but the same error happens

@mac-zhou
Copy link
Owner

The token or key has time information, so each request will be different.
token and key is reusable, just choose one, no need to repeat requests for.

@mac-zhou mac-zhou pinned this issue Mar 14, 2022
@mac-zhou
Copy link
Owner

I forgot to explain the issue authentication failed😂
Midea has 2 forms of udpid, it is not confirmed which one is suitable for the device, so it will be requested 2 times and 1 of them will fail

for udpid in [get_udpid(self.id.to_bytes(6, 'little')), get_udpid(self.id.to_bytes(6, 'big'))]:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants