midea-air-condition icon indicating copy to clipboard operation
midea-air-condition copied to clipboard

Local mode

Open JacekDob opened this issue 6 years ago • 14 comments

Hi!

Thank you very much for this api, it works very well.

Do you know how to change it to use on local network (connect to device directly) instead of using cloud?

Best regards, Jacek

JacekDob avatar Nov 27 '18 14:11 JacekDob

Hi JacekDob,

I saw that the latest version of the app does use a different way to communicate with the AC locally, so once the implementation is complete, I will investigate further.

It does require a specialized setup with packet capturing and port scanning though, it's going to take a bit of time.

But I will definitely add that as a feature later, the latency with the cloud service is horrible.

NeoAcheron avatar Nov 27 '18 23:11 NeoAcheron

Yes, you are right,: latency with the cloud service is horrible.

JacekDob avatar Nov 28 '18 11:11 JacekDob

Sry I did not see this issue. I tried to find a way, but I could not issue commands on UDP. It's an issue for us not because of the latency, but the external cloud service sometimes lists devices offline, but we know it's not offline. I will try to find what I have now (for a while I had to abandon my reverse-engineering work on it because I have no spare time with my projects)

yitsushi avatar Jan 08 '19 07:01 yitsushi

@yitsushi I've been trying hard to get the local broadcast to work, and I can see packets from the devices, even if the cloud service is offline (manually disconnected from my internet connection on my router). The problem is that the UDP packets seem to be encrypted differently to the messages going to the cloud service. I don't think there is any authentication that happens there, which is a major change from the API.

NeoAcheron avatar Jan 08 '19 08:01 NeoAcheron

@NeoAcheron : That's where I stuck too. Soon I will publish my research pack (part of it, sry but the rest may contain sensitive information and I'm lazy to clean-up; and meanwhile I replaced my computer and I don't find my files about UDP packets).

I'm not sure if it's encrypted, but it has a checksum I could not figure out. I found some references on MD5 in beam functions, but with a bruteforce logic I could not figure out what it uses for the hash and what it does exactly with the hash.

Another interesting part: In NetLanBroadcastResponse there is a mRandomCode which is 16 bytes long and maybe that's what I tried to identify as an md5 hash which is 16 bytes too.

And then ... I had to suspend the project.

yitsushi avatar Jan 08 '19 10:01 yitsushi

I pushed up some maybe useful materials/docs into the research-pack branch

yitsushi avatar Jan 08 '19 10:01 yitsushi

any news about the local mode? this feature would be very nice!

seppe912 avatar Aug 01 '19 07:08 seppe912

@NeoAcheron any update regarding local mode? Or any information you could share regarding it ?

gelsas avatar Apr 12 '20 02:04 gelsas

@NeoAcheron any update regarding local mode? Or any information you could share regarding it ?

Sorry @gelsas, I do not have access to a Midea based AC anymore, since I moved.

NeoAcheron avatar Apr 12 '20 09:04 NeoAcheron

I believe most up to date repo is this one: https://github.com/andersonshatch/midea-ac-py

msanchezt avatar Apr 12 '20 09:04 msanchezt

@NeoAcheron I do have one more question maybe you are able to help with that even tough you do not have access to a midea based AC anymore.

Each time the call is made to get the current state of the AC is causing my ac to change to fan only and set to 17 degrees. Many others have similar issues with some midea AC models

Do you have any idea what could cause this or how to maybe fix it ?

gelsas avatar Apr 12 '20 16:04 gelsas

The main cause can be the way I constructed the payload. I tried to fetch information from the server and use those values in there, but I'm not sure if I covered all the values, so maybe there are some values that are handled as a constant like value in the payload and basically the constant value is the one we were using in the office.

yitsushi avatar Apr 17 '20 14:04 yitsushi

Thank you for your answer.

Any suggestions for a "beginner" like me how I could fix it ?

(Unrelated Info) Nowadays there are new apps from Midea, from what I found out they use this sdk https://github.com/midea-sdk-org/android-sdk Could we use it to get the values etc in another way ?

Best, gelsas

gelsas avatar Apr 17 '20 16:04 gelsas

There is a branch named research-pack, it contains a lot of information how I reverse engineered the android app before. I'm not sure if everything is there or not because it was 2yrs ago.

I'll mark this repo as Archived becaus no future update expected on this repo, at least not from me because of technical reasons.

Maybe the 7-temp-unit branch can be useful too.

yitsushi avatar Apr 20 '20 10:04 yitsushi