Any Support for Midea A/C?

Getting device_id was explained in post #163.
I assumed this the easiest way for everyone as You have already installed Pyton3 (HA runs on it!) and as You change settings etc. on You HA You know how to access it (SSH, Remote access etc.) and You know Your HA IP address and can get Midea AC local IP- so IMO running given script should not be the rocket science :slight_smile: I myself tested it on Win10 and my RPI3+ running HA- both worked and afterwards could test AC functions before enabling integration.
Maybe I was unclear how to save and run the script?
Best, JR

1 Like

How to Get applianceId:

  • if you use androidļ¼Œyou can use adbļ¼Œfilter from log:
adb logcat | grep -i deviceid
  • if you use iPhoneļ¼ŒiPhone connects to macOS with a data cable and filters the applianceId from the console log

  • If you do not have the above environment and conditions, you need to capture the air conditioner and save the files, after can be used pcap-decrypt.py to Get. Remember to use the number, not hex string.

I think the steps are:

Plug iphone into MacBook
Run the console.app
Access the Midea Air app on your iPhone and select some actions
Select the iphone tab on the left

Then try searching for ā€˜DeviceInfoModelā€™, this gives a 14-digit number back which I believe is the device ID.

I have a dehumidifier and it appears using the returned number allows the integration to fire up but I then get errors thrown. Would be good to get confirmation that the above approach gets ID correctly.

2 Likes

this i a other way to get deveice_id https://github.com/NeoAcheron/midea-ac-py/wiki/Basic-Usage

you can try login to midea cloud like this:

from midea.client import client as midea_client
from midea.device import air_conditioning_device as ac

# The client takes an App_Key, an account email address and a password
client = midea_client('3742e9e5842d4ad59c2db887e12449f9', '[email protected]', 'account_password')

# Log in right now, to check credentials (this step is optional, and will be called when listing devices)
client.setup()

# List devices. These are complex state holding objects, no other trickery needed from here. 
devices = client.devices()

for device in devices:

    # Refresh the object with the actual state by querying it
    device.refresh()
    print({
        'id': device.id,
        'name': device.name,
        'power_state': device.power_state,
        'audible_feedback': device.audible_feedback,
        'target_temperature': device.target_temperature,
        'operational_mode': device.operational_mode,
        'fan_speed': device.fan_speed,
        'swing_mode': device.swing_mode,
        'eco_mode': device.eco_mode,
        'turbo_mode': device.turbo_mode
    })

i think device.id is your device id

you add this to your configuration.yaml and show me the debug log

logger:
  default: info
  logs:
    msmart: debug

I got it working.

The issue wasā€¦ I was using the Carrier app instead of the Midea appā€¦
I found the id now.

I have the same issue as INTEL, cannot switch modes

If i switch the mode in the app, i see the corresponding mode in your midea entity

Thanks @jchasey this indeed shows the device_id needed for the plugin. Everything is working properly now.
Myabe it would be nice for @mac_zhou to change the readme to search for DeviceInfoModel instead of applianceId.

i canā€™t change, but add DeviceInfoModel because we uses different apps. :sweat_smile:

show me debug log, thank you.

send you a DM/PM

I saw the logļ¼Œthe deviceā€™s reply is the same as sent.
so, Your device is temporarily not supported

Good job @mac_zhou

I have two air conditioners Midea Mission II R32 (09&12 models).
I installed and use the Midea Air App (latest version) on Android. I am using the Home Assistant 0.110.2.

Both air conditioners integrated normally, but I have not tried their work yet (I try integration remotely). Correctly display the state, target temperature in Cels. and current temperature in Cels. BUT displays the outside temperature wrong, as 102.5 - it is not clear what this value is.

And another question! These air conditioners also display current humidity and current power consumption. Can you add this to your integration? This would be really good! Thanks.

Shure, here it is

Logger: homeassistant.helpers.entity
Source: custom_components/midea_ac/climate.py:108
First occurred: 2:51:47 PM (1 occurrences)
Last logged: 2:51:47 PM

Update for climate.midea_ac_a58500000005 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 108, in async_update
    await self.hass.async_add_executor_job(self._device.refresh)
  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 173, in refresh
    data = self._lan_service.appliance_transparent_send(data)
  File "/usr/local/lib/python3.7/site-packages/msmart/lan.py", line 69, in appliance_transparent_send
    response = bytearray(self.request(data))[40:88]
TypeError: 'NoneType' object is not iterable

edit: full debug log sent in PM :wink:

I also have similar log entries:

Logger: homeassistant.helpers.entity
Source: custom_components/midea_ac/climate.py:108
First occurred: 15:00:14 (4 occurrences)
Last logged: 15:50:15

Update for climate.midea_ac_240b0100000f fails
Update for climate.midea_ac_fe3b01000011 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 108, in async_update
    await self.hass.async_add_executor_job(self._device.refresh)
  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 173, in refresh
    data = self._lan_service.appliance_transparent_send(data)
  File "/usr/local/lib/python3.7/site-packages/msmart/lan.py", line 69, in appliance_transparent_send
    response = bytearray(self.request(data))[40:88]
TypeError: 'NoneType' object is not iterable

Please provide logs and other useful information in a link, not a PM. There are a few platforms, where you can paste code in and get a link to share. Like https://pastebin.com/ . You paste the code and only share the link here in the thread.

This way the thread stays readable, but others, not only the receipient of the PM, might be able to jump in and help. It raises the load on the author and is time consuming. So, please, be so kind and share it with all of us. :slight_smile: Thank you! :slight_smile:

Back to the problem: Iā€™m experiencing this in my logs to, but it doesnā€™t result in any failure. Do you have any failures out of it or is everything working as normal?

The outside temperature seems to be a Ā°F or Ā°C problem. What configuration do you have in HA? Metric or imperial?

For the humidity and power consumption. Iā€™ll check, if I can find some data about it. Could you please provide exact model number, manufacturer (better the name on your A/C) and which app are you using beside this component, where you get this values?

Thanks!

@aleksey_z @INTEL the log is same as @Dinges28
Your device is temporarily not supported
you need to capture the air conditioner and save the files and send to me.

How can I do that?

Deactivation of devices occurs with a frequency of 15 minutes.

Image

Metric, Ā°C

Midea Mission II MB-09N8D6H-I/MB-09N8D6H-O and
Midea Mission II MB-12N8D6H-I/MB-12N8D6H-O

Midea Air App (latest version) on Android . I am using the Home Assistant 0.110.2 .

cany you control the device with my repositories?