Midea Mini Split Wifi Support

This looks like a common issue. Maybe this alternate fork of the utility is worth a try: Looking for support? Try my fork! · Issue #109 · mac-zhou/midea-msmart · GitHub

Thanks for the response, I appreciate the help. Unfortunately, I'm getting this message when trying to install.

@LukeJWalker, could you help with tips on how you did this?

After encountering the error above, I followed all of the instructions listed here: GitHub - mill1000/midea-msmart: Python library for local control of Midea (and associated brands) smart air conditioners.

Basically:
pip uninstall msmart
pip install msmart-ng
midea-discover

I should note that this worked for me on Windows after I had done everything else I knew of to get the original working, so I may have inadvertently fixed something else in that process.

2 Likes

Unfortunately, that's exactly what I'm entering. It's just not working. Thanks for the reply.

Love this driver, thanks for supporting it! I succeeded with setup after finding this issue and finding the fork to discover the unit.

Two questions about the driver:

  • Can you add support for "Sound"/"LED"? I always want them off. I'm using a smart plug that the A/C is plugged into to see power consumption and kill the A/C. When I turn on the plug again, Sound/LED both are enabled on device/according to the Midea app. I have to disable in the Midea app. Would love to disable in Hubitat directly.
  • Has anyone gotten this working well with the Hubitat built-in app Thermostat Controller for use with external temperature sensors? The remote that came with my Midea Duo doesn't seem to work as a thermometer for the "ComfortSense" feature, so I'm trying to use Hubitat and Thermostat Controller to use other thermometers I have already. Issues for that described here.

I haven't seen any examples that figured out how to control the sound and LED. But wouldn't it be an option to turn the unit off via a driver command rather than pulling its power with the smart plug. It seems like that could potentially create other issues compared to a more orderly shutdown via the command.

We usually turn the LED off in our bedroom unit because it's pretty bright. This is just turning the display off and not the unit itself. You have this option in the Midea and nethome plus apps.
As for the sound option. Not sure about with this wifi module but the esp version has that option.

Which integration do you use with the ESP module?

I see you have successfully connected to Senville Aura units. I was hoping you could point me in the right direction.

I have a Senville Aura 24k BTU in my garage (which I love / will never have another house without one in the garage again). However, I can only get it to connect to Alexa directly. I put it in AP mode, but never see the unit's SSID to get it to connect to something like MSmart so as to get a unit ID for the hubitat integration via MSmart.

I also can see the IP of unit, but terminal commands to direct point the unit don't seem to work (e.g. midea-discover -i 1.2.3.4).

Any ideas how to get an Aura unit connected to Hubitat?

Many thanks,

You’ll need a different Wi-Fi adapter than the one Senville is currently shipping with their units. What you’ll want to look for is one that works with the NetHome Plus app. That one works with the Hubitat driver.

Here’s a lot more info on the adapter types: Reddit - Dive into anything

1 Like

Thank you.

After posting with you, I just sent an email to Senville. To my surprise, they responded within 5 mins and offered to send a different adapter that will connect in ways other than Alexa, for free. It's $99 on their website. Already on the way. Nice when things go smoothly.

I appreciate your quick feedback. Was feeling dumb that I couldn't get it to work....

Take care.

Edit: I see now they FedEx Overnighted it! I loved the unit immensely before this, even more now.

2 Likes

I've recently started to notice some of my midea units (I have four) not consistently adjusting based not he schedules I set. So, I took a look at the logs and, after they've been running flawlessly for months, all of a sudden they are throwing lots of errors. Any idea what could be causing this? My hub has also been unresponsive sometimes and I've had to reboot it. I'm also getting intermittent hub load notifications.




I got my new USB from Senville, MSmart saw it immediately, all connected fine.

However, when I run midea-discover, the Python script throws an exception when it hits the MiniSplit... If I give it an IP that's not the mini-split, it does not.

Any ideas how to get around this and get the ID, Token, Key?

Python exception:

NFO:msmart.cli:msmart version: 0.2.5 Currently only supports ac devices, only support MSmartHome and 美的美居 APP.
INFO:msmart.cloud:Using Midea cloud server: https://mp-prod.appsmb.com/mas/v5/app/proxy?alias= False
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.11/bin/midea-discover", line 8, in <module>
    sys.exit(discover())
             ^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/msmart/cli.py", line 51, in discover
    found_devices = loop.run_until_complete(discovery.get_all() if ip == '' else discovery.get(ip))
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py", line 650, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/msmart/scanner.py", line 193, in get_all
    await self._process_tasks(tasks)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/msmart/scanner.py", line 199, in _process_tasks
    [self.result.add(task.result()) for task in tasks]
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/msmart/scanner.py", line 199, in <listcomp>
    [self.result.add(task.result()) for task in tasks]
                     ^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/msmart/scanner.py", line 50, in support_test
    _device = await self.support_testv3(account, password)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/msmart/scanner.py", line 65, in support_testv3
    token, key = await loop.run_in_executor(None, gettoken, udpid, account, password)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/msmart/scanner.py", line 255, in gettoken
    Client.login()
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/msmart/cloud.py", line 143, in login
    self.get_login_id()
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/msmart/cloud.py", line 132, in get_login_id
    response = self.api_request(
               ^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/msmart/cloud.py", line 121, in api_request
    return self.api_request(endpoint, args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/msmart/cloud.py", line 121, in api_request
    return self.api_request(endpoint, args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/msmart/cloud.py", line 123, in api_request
    raise RecursionError()
RecursionError```

This error has been popping up for a lot of people, and it looks like a bug with the discovery utility. One possible workaround is discussed here: Midea Mini Split Wifi Support - #172 by LukeJWalker

Thank you... The MSmart uninstall/reinstall worked like a charm. I got the token, key, etc.

EDIT: I thought I had an issue as I could read the token,key,etc. but the Hubitat Driver would timeout... It was a Unifi Firewall rule that clamps down the IoT network. Allowed the midea packets to Hubitat and it worked.

1 Like

@tomw : Really dumb question: How do tell if the Midea AC Controller is on or off in a rule?

I looked at Thermostat > Thermostat State and see several states, except off.
I then look at Custom Attribute >ThermostatOperatingState, and too do not see off as option.

However, when I look at the device, I see under current states "themostatOperatingState: off".

The only RM5 thing I see that gets close is Thermostat Mode, which has an "off" choice, but it never evaluates to off regardless if the AC is running or not.

I appreciate the help / I know I am missing something really small.

image

I too have unifi Wi-Fi. Can you give any details on how you resolved the issue? I have my Hubitat hub on the same network as the Midea units.

1 Like

I have anything that doesn't need to access personal data off on seperated VLANs, home automation being just one. Then, for stuff like this Midea unit, our induction cooktop, Amazon, etc. I such devices again from the home automation network, so they can only respond to something initiated from Hubitat, etc. I didn't want someone to reachout from something like the Midea device, get into some automation hub, lock our doors, turning everything on, risking fire with the fireplace, cooktop, etc.

As a test with the Midea stuff when it would connect but give lots of timeouts, I placed it in the same VLAN as Hubitat to see if I could get it to work... It did. Also, I looked back through the logs just now and see no timeouts since I made the change... Not a one for days.

I have it on my to-do list to put it back in segregated VLAN away from Hubitat and other home automation hubs (Lutron, Phillips), and play with the rules until it works like it did in the same VLAN. If the change is allowing the Midea to initiate connections, I will seriously consider plugging in the Alexa USB, put it in the fully-untrusted VLAN, and not use Hubitat integration.

BTW, how do you tell in a rule if the unit is off (more details in my previous post)? I feel I am missing something really simple.

1 Like