I have a Midea ac and use a broadlink rm mini 3 to control it I used the following custom component. I Purchased the broadlink ir rm3 mini. $25AUD. It works great to control all your ir remotes. It will capture the commands so u can use them as switches. Great device it really made my smart home complete. ( sound like an advert ha )
I’m fairly new to Home Assistant, can you tell how you configured for it to work with the AC?
Did the Broadlink had to “learn” the commands or just setting up as mentioned in the github is enough?
I’m thinking about buying a couple of broadlinks if they’re not that hard to setup
Documented and explained. Shows how to interact with Midea’s server (https://mapp.appsmb.com/v1) and the way the the ar condictioner midea commands are generated and how they are encrypted as if we had a known API.
I would be seeking advice on how to convert this to Python.
I’ve had limited success making a ruby “server” app from the midea-air-condition gem. I made a new app that would listen to commands from Home Assistant over MQTT using the MQTT-HVAC component. It worked well, until a change in the Midea cloud service messed with it and on top of that it was quite difficult to manage, I had to run the server on a separate machine due to the lack of ruby on Hassio (And adding Ruby to Hassio is beyond my skillset).
After a long time of fiddling with ruby and this API, I started porting the code to Python, and in the last week I got pretty far.
Currently I have the following parts working:
Logging in
Listing devices
Sending a transparent status request to the device (Air Conditioner) and receiving the response
What’s remaining is the parts to decode the raw data from the AC into a nice usable class object and the classes to build the “Set” commands in order to change the operation of the AC.
The whole protocol and the way encryption works is particularly horrible, but it is working!
Its not very pretty yet, but I’m still working on it, and I will be converting the code into a home assistant plugin once it’s all there.
I just added the device data decoding class. It was quite simple to convert to Python, and I made it part of the main example. I will see if I can do the rest in this week, and feedback here if there is success.
Yes, it works with the OSK102 module. I have a Carrier AC with the module in, and it works with the Nethome Plus app, the Carrier app, and a whole bunch of other rebranded apps for vendors that use the same WiFi module.
I’m in the process of neatening things up, if things go well I will push it tonight and have a component ready for Home Assistant tomorrow evening.
I’m going to need a list of supported AC vendors (and possibly models) in order to make decent documentation once its working in HA.
On a side note, I’ve been trying to capture local packet data when the Carrier app communicates locally, but without success. I wouldn’t mind some help there, my router is not allowing me to capture the packets I need to decode that local protocol. It would make the set up a lot faster, the cloud services are horribly slow.
It’s noticeably faster than the cloud API when selecting a temperature or a mode. It was updated recently, I think that faster control was added recently, it used to be as slow as the cloud service. I did see UDP broadcasts made by the app to port 6445, but I wasn’t able to decipher them. There has to be something I’m not seeing.
In the meantime, I’m busy creating the component for HA. It’s the first time I’m creating one, and my internet connection is limited at the moment due to a fibre break in the area, so things are going more slowly than I would have hoped…
Great news, I have a working component in Home Assistant with full control via my library. You can get instruction on how to use it at the moment.
I’m going to need some advice on the dependency resolution in HA, its weird and doesn’t seem to be working for me. I’m missing something, and its not clear what.
As a workaround though, simply copying the dependencies into the config/deps/ directory, seems to do the trick.
Please let me know your thoughts! Its been a busy few days, but I think it has paid off!
I am seeing an error. I think I set it up properly, but maybe not.
2018-12-02 13:05:55 ERROR (MainThread) [homeassistant.components.climate] Error while setting up platform midea
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/homeassistant-0.84.0.dev0- py3.5.egg/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File "/usr/lib/python3.5/asyncio/tasks.py", line 400, in wait_for
return fut.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
raise self._exception
File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
result = coro.send(None)
File "/root/.homeassistant/custom_components/climate/midea.py", line 41, in async_setup_platform
from midea.client import client
File "/root/.homeassistant/deps/lib/python3.5/site-packages/midea/client.py", line 16
self._devices: Dict[str, device] = {}
^
SyntaxError: invalid syntax
Thank you for your efforts to create this component, Hi tested this using hassio 0.83.2 , i get the following error :
Error while setting up platform midea
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py”, line 128, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File “/usr/local/lib/python3.6/asyncio/tasks.py”, line 358, in wait_for
return fut.result()
File “/config/custom_components/climate/midea.py”, line 50, in async_setup_platform
entities = [MideaClimateDevice(device, temp_step) for device in devices]
File “/config/custom_components/climate/midea.py”, line 50, in
entities = [MideaClimateDevice(device, temp_step) for device in devices]
File “/config/custom_components/climate/midea.py”, line 66, in init
device.refresh()
File “/config/deps/lib/python3.6/site-packages/midea/device.py”, line 82, in refresh
self.update(response)
File “/config/deps/lib/python3.6/site-packages/midea/device.py”, line 108, in update
self._swing_mode = swing_mode_enum(res.swing_mode)
File “/usr/local/lib/python3.6/enum.py”, line 291, in call
return cls.new(cls, value)
File “/usr/local/lib/python3.6/enum.py”, line 533, in new
return cls.missing(value)
File “/usr/local/lib/python3.6/enum.py”, line 546, in missing
raise ValueError(“%r is not a valid %s” % (value, cls.name))
ValueError: 48 is not a valid swing_mode_enum
i figured this out , the app and the aircon i am using (invmate ii) has a button for horizontal swing i will look how can i circumvent this, thank you for your great work.