Yeah, mine has internet access. When blocked, cloud control is not possible, and still get a timeout with the local version.
hello, everyone
Good news, the next version will no longer require configuring ip and id
it will scans the LAN for available devices
hi guys, I have 2 ac in my home branded as “mirage” im from mexico and they are midea ac units rebranded, how I know it? cuzz I log in the mirage app, and then with the same credentials, without making another account, log in in the midea app, and they are almost the same app, just different colors, here is my question, does you think I can get my AC integrated with home assistant? my AC needs an usb wifi dongle, I need too buy it to try it, but, does you think it can work? locally or via cloud, doesnt matter, what do you recommend? Thanks
Hi. When will the next version be available?
I also have re-branded units that utilize the Midea Cloud so should work for you also if they are just re-branded
thanks for your help, it works, just installed the usb wifi dongle in the AC, and add the config lines, and voila, it works, thanks for your work @mac_zhou !!! just one question, does any one have problems that if you turn off with the remote controller, it doesnt turn off in the home assistant card?
I’ve been working on reverse engeneering my Midea MSmart and Midea Smart (both seem to be gone from google app store) compatible Midea Liva AC unit
So far I could get the source code from the original APK, get some constants (i.e. API_KEY) and investigate the security model that is quite different from this midea devices (seems based on MD5 instead of SHA256). That’s exactly the hard part, calculating the “sign” url parameter that validates the API call
The protocol it self is quite simple and I could sniff it with wireshark and is based on XML instead of JSON
I cannot add my AC to the Midea Air app, but I works fine with the others I’ve mentioned or via LAN using it too
It seems to have been developed by JinQuan Liu
Even got some Youtube videos of the development: https://www.youtube.com/channel/UCX74x-APhefK3qMT6kxudiw
I guess that using Mac_zhou’s code and some effort to get back coding I’ll be able to do it via internet
As for the LAN side, the device discovery was quite easy to get scrubbing the logcat of the APK
But it seems that the commands itself are sent via a TCP2UART connection that I’ve never used before
Maybe someone could solve this part later
Att,
Will
GOOD NEWS!!!
After some hard work I was able to reverse engeneer the secutiry protocol of the old cloud service my unit uses and get a a successful login with some serious modification to the Michael0yodi’s code and side-by-side java debugging
Next steps, get the rest of the protocolo working (store the right parameters in the right variables and send some commands to the unit
Att,
Will
the library msmart
update to 0.1.16
you can run midea-discover
, that is a easy way to discover Midea Devices with UDP Broadcast.
if the device’s type is 0xAC, the cli will send a refresh command to confirmation of support.
# midea-discover
INFO:msmart.cli:Discovering devices with UDP Broadcast, press CTRL-C to quit...
INFO:msmart.cli:Found a supported '0xac' at 10.0.0.236 - id: 703687xxxxxxxx - sn: D110001129xxxx - ssid: midea_ac_xxxx
INFO:msmart.cli:Found a supported '0xac' at 10.0.0.241 - id: 2111062xxxxxxxx - sn: D110005058xxx - ssid: midea_ac_xxxx
Note: This component only supports devices with model 0xac (air conditioner) and words supported
in the output.
Hi Mac,
I just got my new U-Shaped Midea set up and tried to get it connected to HA. I was able to get the ID using the QR method, have it set to a DHCP reservation, and have added the config into HA. It seems to find the unit, however I am unable to control any functions. I am able to control the unit through the Midea Air iOS app. Not sure if this unit is supported, and if it is not, what, if anything, can I do to help get this supported?
I also tried midea-discover
but I am receiving an error related to crypto: ValueError: Padding is incorrect.
Please let me know if/what I can provide to help get this supported. Appreciate all the work that you have put into this!
Hi,
same issue for me: ‘Padding is incorrect’ running midea-discover
Bad news
The final protocol that goes inside de XML conversation is encapsulated inside various .so (precompiled libraries) files.
Reverse engeneering that will be a little harder
Here are my logs:
INFO:msmart.cli:Debug mode active
INFO:msmart.cli:Discovering devices with UDP Broadcast, press CTRL-C to quit...
Traceback (most recent call last):
File "/usr/local/bin/midea-discover", line 8, in <module>
sys.exit(discover())
File "/usr/lib/python3/dist-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/usr/lib/python3/dist-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/usr/lib/python3/dist-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python3/dist-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/msmart/cli.py", line 63, in discover
reply = _security.aes_decrypt(data)
File "/usr/local/lib/python3.8/dist-packages/msmart/security.py", line 26, in aes_decrypt
decrypted = unpad(decrypted, self.blockSize)
File "/usr/local/lib/python3.8/dist-packages/Crypto/Util/Padding.py", line 90, in unpad
raise ValueError("Padding is incorrect.")
ValueError: Padding is incorrect.
that is not full output
please show me the full output
That’s everything. I tried with and without the -d, same results.
maybe a firewall or antivirus blocks traffic? try turning it off.
update to 0.1.17
hi, im getting this error while sending command, “Failed to call service climate/set_hvac_mode. Padding is incorrect.”
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 470, in async_device_update
await self.async_update()
File “/config/custom_components/midea_ac/climate.py”, line 104, in async_update
await self.hass.async_add_executor_job(self._device.apply)
File “/usr/local/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/local/lib/python3.7/site-packages/msmart/device.py”, line 205, in apply
data = self._lan_service.appliance_transparent_send(data)
File “/usr/local/lib/python3.7/site-packages/msmart/lan.py”, line 78, in appliance_transparent_send
reply = self.decode(self.security.aes_decrypt(response[40:88]))
File “/usr/local/lib/python3.7/site-packages/msmart/security.py”, line 26, in aes_decrypt
decrypted = unpad(decrypted, self.blockSize)
File “/usr/local/lib/python3.7/site-packages/Crypto/Util/Padding.py”, line 90, in unpad
raise ValueError(“Padding is incorrect.”)
ValueError: Padding is incorrect.
2020-06-11 09:10:22 ERROR (MainThread) [homeassistant.helpers.entity] Update for climate.aire_papas fails
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 279, in async_update_ha_state
await self.async_device_update()
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 470, in async_device_update
await self.async_update()
File “/config/custom_components/midea_ac/climate.py”, line 104, in async_update
await self.hass.async_add_executor_job(self._device.apply)
File “/usr/local/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/local/lib/python3.7/site-packages/msmart/device.py”, line 205, in apply
data = self._lan_service.appliance_transparent_send(data)
File “/usr/local/lib/python3.7/site-packages/msmart/lan.py”, line 78, in appliance_transparent_send
reply = self.decode(self.security.aes_decrypt(response[40:88]))
File “/usr/local/lib/python3.7/site-packages/msmart/security.py”, line 26, in aes_decrypt
decrypted = unpad(decrypted, self.blockSize)
File “/usr/local/lib/python3.7/site-packages/Crypto/Util/Padding.py”, line 90, in unpad
raise ValueError(“Padding is incorrect.”)
ValueError: Padding is incorrect.