yitsushi / midea-air-condition

MIT License
40 stars 16 forks source link

Temperature units #7

Open ghost opened 5 years ago

ghost commented 5 years ago

First off, kudos! This library is awesome and is working well with Mr Cool DIY 12k mini-split (whitelabel midea). However, any set command changes the temperature unit from F to C.

Is it possible to retain the current setting or at least for me to hard code it somewhere (in the data I presume)?

NeoAcheron commented 5 years ago

Hi @alexgrieco

Is it the temperature display on your AC changing to Fahrenheit, or the value returned by the app?

ghost commented 5 years ago

Hi @NeoAcheron

It’s the other way around. I have manually set my AC to Fahrenheit (my own preference), but anytime I run a command through midea-ac the setting is switched to Celsius. I can see in the midea iOS app, there is a setting called “Units”. There is also an led display on the actual AC which also changes from (F) to (C) after firing a command through midea-ac.

I tried to wireshark the commands, while manually changing the setting in the app but I can’t tell which value is changing.

It is not a huge deal, everything works fine, just a preference and wondered if it might be easy to use Fahrenheit.

yitsushi commented 5 years ago

I think there is a bit for that and because we use Celsius all the data I had was Celsius. When I started my experiment it was in my mind, but later (because I had no issue with this) totally format about that.

I'll check if I find anything quick, but to speed up all the researches, I will publish all the scripts I used for reverse-engineering (basically I patched apk with my own ssl cert + an ruby MitM proxy with that SSL cert which is encoding every single message and prints out in a much readable format)

The problem with wireshark is... all packets are aes encoded so watching on raw packets is totally useless.

yitsushi commented 5 years ago

I started to publish a HowTo-ish post here: https://cheppers.com/operation-ac-ctf-without-flag-part-i

The second part (the guessing game) is sadly is still in progress because of time issues :/

yitsushi commented 5 years ago

@alexgrieco : Can you check if the linked patch works or not? I'm not sure if I'll have the opportunity to test it this week.

Check out the branch, build and install the built gem (ping me if you need more details).

yitsushi commented 5 years ago

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

ghost commented 5 years ago

@yitsushi Thank you! The link works. I will try to dig into it today.

ghost commented 5 years ago

@yitsushi I ran the 7-temp-unit branch today and I think this is positive feedback.

Before, the get command will show:

Target temperature: 22 celsius Indoor temperature: 25 celsius Outdoor temperature: 17 celsius

After, it reads the unit correctly, but does not convert the actual value (maybe expected at this point)

Target temperature: 22.0 F Indoor temperature: 24 F Outdoor temperature: 17 F

Then if I send any set command...it will revert to C.

Target temperature: 22.0 C Indoor temperature: 24 C Outdoor temperature: 17 C

yitsushi commented 5 years ago

Thanks for the quick test. Next time I can inspect/test it in the office (where we have all the devices) will be next Monday.

robp2175 commented 5 years ago

Any update on this? If you can lead me in the right direction to prevent the AC changing from Fahrenheit to Celsius every time a command is sent, I would really appreciate.