Any Support for Midea A/C?

Hi, anyone having issues with Midea custom component today, only works intermittently. So if I restart it sometimes loads and sometimes not…

Logs:

Thu Nov 28 2019 12:20:19 GMT+0200 (SAST)

Update for climate.midea_XXXXX fails
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 270, in async_update_ha_state
await self.async_device_update()
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 448, in async_device_update
await self.async_update()
File “/config/custom_components/midea/climate.py”, line 111, 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/midea/device.py”, line 146, in refresh
data = self._cloud_service.appliance_transparent_send(self.id, data)
File “/usr/local/lib/python3.7/site-packages/midea/cloud.py”, line 173, in appliance_transparent_send
‘applianceId’: id
File “/usr/local/lib/python3.7/site-packages/midea/cloud.py”, line 88, in api_request
self.handle_api_error(int(response[‘errorCode’]), response[‘msg’])
File “/usr/local/lib/python3.7/site-packages/midea/cloud.py”, line 224, in handle_api_error
handler()
File “/usr/local/lib/python3.7/site-packages/midea/cloud.py”, line 209, in throw
raise ValueError(error_code, message)
ValueError: (3123, ‘the appliance is off line.’)

1 Like

Hi,
I was reading almost all posts here, and it seems that some are able to discover their ACs, other not even that and others, like me, are able to discover the devices but not able to control them.

The steps I did:

  • Repository installed using HACS
  • Renamed the repository from ./custom_components/midea to ./custom_components/climate
  • In these directory I have: init.py, climate.py, manifest.json and a directory pycache
  • Copy ./custom_components/midea to ./deps/lib/python3.6/site-packages/midea

My configuration is:

- platform: midea
  app_key: 3742e9e5842d4ad59c2db887e12449f9
  username: '[email protected]'
  password: !secret midea_password

then I have the following errors:

2019-12-05 16:25:38 ERROR (MainThread) [homeassistant.helpers.entity] Update for climate.midea_16492674450766 fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 270, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 448, in async_device_update
    await self.async_update()
  File "/config/custom_components/climate/climate.py", line 107, 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/midea/device.py", line 168, in apply
    data = self._cloud_service.appliance_transparent_send(self.id, data)
  File "/usr/local/lib/python3.7/site-packages/midea/cloud.py", line 173, in appliance_transparent_send
    'applianceId': id
  File "/usr/local/lib/python3.7/site-packages/midea/cloud.py", line 95, in api_request
    raise RecursionError()
RecursionError

I hope someone can help me, and my steps also help others to understand where they are too :slight_smile:

My humble 2 cents on this everlasting issue:

  1. Checked all available repositories including not only Python but also written in Ruby- all end with the infamous error 3176 recursion :joy:. I started to wonder if it simply related to user’s equipment locale, language and/or time/date settings. So could people who have this component working (even sporadically) chime in and publish their system locale etc. settings?
  2. Despite of many negative reviews on Midea integration into Google Home/Assistant it works rather perfectly if set up correctly. Maybe with help of HA cloud and/or IFTTT we can script this component to be working as all things in separate DO WORK… or is it a bad idea?
    For those who are interested I attach my humble compilation of Midea voice commands for Google Home/Assistant.

Download Nethome Plus app, register and do all the stuff for app working :-)
If app works OK then:
In your Google Assistant/Home app link Nethome Plus -if OK do note 3 to sync devices.

Turn the Air Conditioning On or Off:
	• Turn on/off the Air Conditioning 
	• Switch on/off the Air Conditioning
	• Turn on/off the <Zone Name>
	• Switch on/off the <Zone Name> 
	• Turn on/off all <Zones>
	• Switch on/off all <Zones>

Change the Mode of your Air Conditioning:
	• Set <AC Unit Name> to cool/dry/fan/heat mode					Response: OK, changing <AC...> to <mode>
	• Change <AC Unit Name> to cool/dry/fan/heat mode

Change the Temperature Set Point:
	• Set <Zone Name> to <temperature value in °C>  				Response: sure, setting <AC> to <temperature> degrees
	• Change <Zone Name> to <temperature value in °C>

Increase/Decrease the Temperature: 
	• Cool down/Warm up <Zone Name> by (will change by 3°C)    
	• Increase/Decrease <Zone Name>(will change by 3°C) 
	• Cool down/Warm up <Zone Name> by<temperature value in °C> 
	• Increase/Decrease <Zone Name> by<temperature value in °C> 

Query the Temperature:
	• What is <AC Unit Name/Zone Name> set to?             			Response: <Mode> is set to <Temperature>
	• What is the temperature of <AC Unit Name/Zone Name>? 			Response: <Mode> is set to <Temperature> with the current temperature of <Room temperature>

Query the Status of the Air Conditioning:	
	• Is <AC Unit Name/Zone Name> on or off?						Response: <AC...> is on
	• Are <AC Unit Name/Zone Names> on or off?						Response: not understood

Query Fan speed:
	• What is the <AC Unit Name/Zone Name> speed?					Response: <AC> is set to <auto, speed>
	
Set Fan Speed:
	• Lower/raise the <AC...> speed									Response: Sure, decreasing/increasing the <AC> speed to <speed>
	• Make the <AC...> speed lower/higher						    Response: OK, decreasing/increasing <AC> speed to <speed>	
	• Set AC to <high/medium/low>									Response: OK, setting <AC> speed to <speed>

Query <mode>:
	• Did I set <AC...> to <mode>?									Response: <AC> is set to <heat, cool etc.>
	
	
1.  Note for iOS Users: You will need to open the Google Assistant App or use the App widget, when voicing these commands.
2.  <Zone name> would be something meaningful eg. Downstairs, Upstairs etc.
3.  After every change in Google Home/Assistant app issue: "OK Google, sync my devices"
4.  Somehow on my Midea Mission II R32 <increase/decrease> commands are swapped :-( so raise/lower is better...
5.  When you ask Google Assistant to set the temperature of your air conditioner, the following logic applies:
		If the air conditioner is currently OFF:
			Your request will turn on the air conditioner, set the temperature and adjust the mode to either heating or cooling according to your set temperature compared to the room temperature.
			For example, if you ask Google Assistant to set the temperature to 24 degrees, and the actual room temperature is 21 degrees, the air conditioner will adjust automatically to Heating Mode.
		If the air conditioner is currently ON:
			Your request will only adjust the temperature.
6.  Asking for Multiple Requests:
		Google Assistant does support asking some multiple requests in one question. I.e. if you want to set the heat to 21 degrees, you can ask, “Hey Google, set the heat to 21 in the <AC.../Zone>”.
		Otherwise you can ask individual questions like “Hey Google, set the <AC.../Zone> to 21 degrees”, and then “Hey Google, set the <AC/zone> to heat”.
7.  When you ask Google Assistant to turn on your air conditioner, it will switch on to the last setting it was set to (via voice/app/remote).		

Best, JR

1 Like

Hi people,
I have 4 Midea Blanc and one Carrier. I can see all in my hassio but when I try to control Midea blanc’s they enter in FP mode and I have to change it from Midea app.
Anyone who had this issue could make me a patch?

Anyone have problem after you set a temp in home assistant using this integration, it changes the unit display to Celsius? For instance, I set to 72F and now the display on the unit is now 22. I attempted to change TEMP_CELSIUS to TEMP_FAHRENHEIT, but that just resulted in home assistance’s display to also change to Celsius.

Yep, the reverse engineered protocol sets the display to Celsius. There’s probably a bit in the protocol which changes the display, but the hard part is figuring out what bit it is.

Any way to change the thermostat card and only show some of the hvac_modes?

Also, sometimes the AC WiFi will disconnect and stay offline forever, even if they go back online and the app shows it online, I need to restart Home Assistant for it to get back to online inside Home Assistant. Anyway to make it back online as within the app without a restart?

Can anyone confirm this plugin is broken in Home Assistant 0.107.7 ?
I keep getting Update for climate.midea_17123456789737 fails…RecursionError

2 Likes

I get the same error

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 474, in async_device_update
    await self.async_update()
  File "/config/custom_components/midea/climate.py", line 111, 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/midea/device.py", line 146, in refresh
    data = self._cloud_service.appliance_transparent_send(self.id, data)
  File "/usr/local/lib/python3.7/site-packages/midea/cloud.py", line 173, in appliance_transparent_send
    'applianceId': id
  File "/usr/local/lib/python3.7/site-packages/midea/cloud.py", line 93, in api_request
    return self.api_request(endpoint, args)
  File "/usr/local/lib/python3.7/site-packages/midea/cloud.py", line 95, in api_request
    raise RecursionError()
RecursionError
2 Likes

I also get the same error

i had this problem also, removed and added the airco again. It worked for 30 minutes, than broke again with above error message.

BUT this did not came with 107.7, because my older home assistant 105 has the same problem.
Probably there is more wrong at the side of midea, (btw, checking status in the carrier/midea app gives me also an error message)

this plugin also works for my Qlima SC5225 A/C, with the

use_fan_only_workaround: true

option. its a bit slow though(3-4 sec response time).

1 Like

I have the same problem. Can’t control my AC from HA. Android apps (NetHome Plus and Midea Air) works locally only if I am connected to home WiFi

Same error here.

how do I get the api key? is it generic? reading is fundamental

1 Like

I got tired of their server going down so I replaced the WiFi dongle with a Zigbee CC2531 dongle from China.

It’s pretty hacky but if there is interest I could try to get it up on GitHub.

4 Likes

Yes, yes please! :slight_smile:

I have an OlympiaSplendid system from Italy that is basically a Media A/C. Apps are the same and IIRC correctly, somewhere inside I saw a sign from Media.

Long story short, I don’t like it to need the Internet to control my a/c, so I want to do that local. I haven’t investigated myself, because my idea was to simulate something like the Midea server.

But if it works with a CC2531, that would be AWESOME! :smiley:

hello everyone, you can try my project.
This is a library to allow communicating to a Midea AC via the Local area network.


and This is a custom component for Home Assistant to integrate the Midea Air Conditioners via the Local area network.
4 Likes

YOU @mac_zhou , are my official hero of the month! :slight_smile: Thank you so much, this is exactly what I needed! :slight_smile: I installed it, works great, not one hickup during installation or first tries!

Thanks a lot, really, you made my day (and my wifes and dogs)! I just made a small donation via PayPal, I’m sorry it’s not more, I hope situation gets more comforting over the year, than I’ll def. make another one! :slight_smile:

Thank you! :slight_smile:

1 Like