Any Support for Midea A/C?

If you get this error message, you are not on the actual version. Check manifest.json if you really have 0.1.15 in there and try another restart.

this is just warning log, but it is better to let more people use it.
i will update it later

just timeout for 10s

no

yes, I really have 0.1.15.

to @mac_zhou, Ok, thanks.

to @mac_zhou

The same dropout.

Picture

ac_09_2

this is known issues, i will fix it later.

more important: can you control your AC?

I still get timeout(s)

2020-05-28 16:23:05 WARNING (MainThread) [homeassistant.helpers.entity] Update of climate.midea_ac_72210586215917 is taking over 10 seconds
2020-05-28 16:23:05 INFO (SyncWorker_4) [msmart.lan] Connect the Device 172.16.0.83:6444 TimeOut for 10s. don’t care about a small amount of this. if many maybe not support.
2020-05-28 16:23:11 DEBUG (SyncWorker_0) [msmart.lan] Sending to 172.16.0.83:6444 5a5a011169002000000000000000000000000000722…

Port is open:

Nmap scan report for 172.16.0.83
Host is up (0.033s latency).

PORT STATE SERVICE
6444/tcp open sge_qmaster

What data do you like to capture I can run a wireshark session

your device_id maybe not right

A yes sorry i changed it by accident, however issue is still the same, looks like some data / validation might be missing see comparison:

OMG
What do you want me to grind from the picture?
show me the text.
you can send me the cap file with telegram, i will PM you my tg_id

yes. I can control my AC.

Updating to 0.1.15 AND (gotta do both) changing port from 6444 to 20088 in /usr/local/lib/python3.7/site-packages/msmart/lan.py changed my scenario

Now the widget is shown but values are wrong and I’m unable to control the unit

The test script to detect the deviceid now returns some data:
{'id': '01001047017f', 'power_state': False, 'audible_feedback': False, 'target_temperature': 17, 'operational_mode': <operational_mode_enum.auto: 1>, 'fan_speed': <fan_speed_enum.Auto: 101>, 'swing_mode': <swing_mode_enum.Off: 0>,'eco_mode': False, 'turbo_mode': False, 'indoor_temperature': 0.0, 'outdoor_temperature': 0.0}

This ID converts to 1099784716671 decimal (that’s used in the config)
The widget than displays the device as midea_ac_7f0147100001

The device name in the widget (the numeric part) is exactly the ID logcat gives
7f0147100001 converts to 139643463925761 decimal
This gives me a device name of midea_ac_01001047017f in the widget (exactly the ID shown in the script output)

Neither using 1099784716671 nor 139643463925761 I’m able to communicate with the device.
It’s IP is reserved in my DHCP server and responding for ping from within the HA container

This is the logcat output:
https://pastebin.com/6tqLbJ9j

Nmaped the device ports 1 to 25000 and the only open port I could find was the 20088 already show in the logcat output

In time, the same 10s timeout issue here

Anything else I may do to help supporting the device and enhancing the integration?

Thanks in advance
Will

pcap-decrypt.py update
it can print your device_id from the pcap file and parse

  • if you use Midea Air app outside China, there is a easy way to get your deviceid.
  1. open Midea Air app, and share the device, you will get a QR Code.

  2. save the QR Code

  3. upload QR Code Sreenshort to https://zxing.org/w/decode.jspx or decode QR code use other tool.

  4. you will get the data like MADEVICESHARE:<base64_string>

  5. decode base64 string online https://www.base64decode.org/ or use other tool

3 Likes

Hello everyone.

For those who use the Midea Air app on Android, and have a PC with Windows OS.

For getting the Midea AC LocalKey (or device ID, or etc.). There a method a “easier” way.

The Midea Air app stores the LocalKey in a XML-File on your phone/tablet. Usually you can’t access it until the phone is rooted. But don’t worry, no need to root your phone, there is a easier way.

We will install a Android emulator, root it, install the Midea Air app and extract the keys. To do so, go to:

Bstweaker

and download the latest BlueStacks Tweaker (Link is on top of the page) and Bluestacks installation (down below) according to your OS (32/64Bit).
Also go town to “utils” and download SuperSu 2.82-SR5.apk and Root Checker Pro 1.6.2.apk.

Then install Bluestacks, and after installation, follow the first instructional video on the page to root Bluestacks.

With rooted Bluestacks, go to Play Store and Download “Midea Air” app. Make sure to run it once, login and access your A/C’s once!
This is essential because only when doing so, it will get the configuration to our Bluestacks rooted phone!

Next, install “ES File Explorer” from Google Play store.
Set ES File Explorer to “Root Mode” (Scroll down left to find “Root Explorer”)

a warning will popup if root sholud be granted, grant it.

get_id_4

Now on the right, navigate to:

/data/data/com.midea.aircondition.obm/shared_prefs

You end up in a folder with some XML-files, this is where we want to go.

Find the file called:

Midea_Preferencse.xml

and click it. ES File Explorer will open it (or better copy file and open in Notepad++). You will find the ID of your A/C’s!

In my case, it 14 digit (for Midea Air App):

1 Like

I have an easier way. :smiley:

1 Like

Maybe. But my method is more convenient for me, since I use it to get local ID for devices of various manufacturers, for example Tuya Smart, Xiaomi, etc.

you did not fix this issues?

no, This project has consumed a lot of my time.
i will take a break and enjoy the holidays! :stuck_out_tongue_closed_eyes:

Ok, happy holidays!

This saved a lot of time for me plus Midea started to work as never before - just two weeks after I bought Tado haha. Great work!