homeassistant-midea-air-appliances-lan
homeassistant-midea-air-appliances-lan copied to clipboard
Failed to perform handshake and fetching data errors
Version of the custom_component
Running the latest version available in HACS v0.8.2
Configuration
Config done via UI
Describe the bug
I have two Cooper and Hunter ACs that are connected via the USB plug. I have connected them to my Midea Air app and can control both units without issues. When I go through the UI setup for the configuration, it does not find any devices. Only when I specify the IP for one of the ACs, then the integration finds both ACs. However, while both ACs are correctly found and added, as soon as I try to control them, they become unavailable.
Debug log
This error originated from a custom integration.
Logger: custom_components.midea_dehumidifier_lan.hub
Source: custom_components/midea_dehumidifier_lan/util.py:208
Integration: Midea Air Appliances (LAN) (documentation, issues)
First occurred: 5:50:43 PM (1 occurrences)
Last logged: 5:50:43 PM
Error 'Failed to perform handshake for 000000P0000000Q130B23747********' while setting up appliance 000000P0000000Q130B23747********, full configuration {'username': '****************', 'password': '****************', 'mobile_app': 'NetHome Plus', 'include': ['0xac'], 'scan_interval': 15, 'debug': False, 'broadcast_address': ['255.255.255.255', '10.30.30.120'], 'devices': [{'api_version': 3, 'id': '14733455814****', 'ip_address': '10.30.30.120', 'name': 'Front', 'token_key': '****************************************************************', 'token': '********************************************************************************************************************************', 'type': '0xac', 'unique_id': '000000P0000000Q130B23747********', 'discovery': 'LAN'}, {'discovery': 'LAN', 'ttl': 5, 'api_version': 3, 'id': '14733455814****', 'ip_address': '10.30.30.121', 'name': 'Master bedroom', 'token_key': '****************************************************************', 'token': '********************************************************************************************************************************', 'type': '0xAC', 'unique_id': '000000P0000000Q130B23748********'}]}
Traceback (most recent call last):
File "/config/custom_components/midea_dehumidifier_lan/hub.py", line 217, in async_discover_device
appliance = await self.hass.async_add_executor_job(
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/midea_dehumidifier_lan/util.py", line 208, in appliance_state
return midea_beautiful_api.appliance_state(
File "/usr/local/lib/python3.9/site-packages/midea_beautiful/lan.py", line 1025, in appliance_state
appliance.identify(cloud, use_cloud)
File "/usr/local/lib/python3.9/site-packages/midea_beautiful/lan.py", line 777, in identify
self.valid_token(cloud)
File "/usr/local/lib/python3.9/site-packages/midea_beautiful/lan.py", line 760, in valid_token
self._authenticate()
File "/usr/local/lib/python3.9/site-packages/midea_beautiful/lan.py", line 505, in _authenticate
raise AuthenticationError(
midea_beautiful.exceptions.AuthenticationError: Failed to perform handshake for 000000P0000000Q130B23748********
This error originated from a custom integration.
Logger: custom_components.midea_dehumidifier_lan.appliance_coordinator
Source: custom_components/midea_dehumidifier_lan/appliance_coordinator.py:119
Integration: Midea Air Appliances (LAN) (documentation, issues)
First occurred: 1:26:05 AM (48 occurrences)
Last logged: 7:22:03 PM
Error fetching Front data: Unable to send data after 5 retries, last error [Errno 104] Connection reset by peer for 000000P0000000Q130B23747******** (14733455814****), will be trying again.
Error fetching Master bedroom data: Unable to send data after 5 retries, last error [Errno 32] Broken pipe for 000000P0000000Q130B23748******** (14733455814****), will be trying again.
Error fetching Master bedroom data: Unable to send data after 5 retries, last error timed out for 000000P0000000Q130B23748******** (14733455814****), will be trying again.
Error fetching Master bedroom data: Unable to send data after 5 retries, last error [Errno 104] Connection reset by peer for 000000P0000000Q130B23748******** (14733455814****), will be trying again.
Error fetching Master bedroom data: Failed to perform handshake for 000000P0000000Q130B23748********, will be trying again.
This error originated from a custom integration.
Logger: custom_components.midea_dehumidifier_lan.appliance_coordinator
Source: custom_components/midea_dehumidifier_lan/appliance_coordinator.py:130
Integration: Midea Air Appliances (LAN) (documentation, issues)
First occurred: 5:39:15 PM (3 occurrences)
Last logged: 7:27:21 PM
Unexpected error fetching Master bedroom data: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 191, in _async_refresh
self.data = await self._async_update_data()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 150, in _async_update_data
return await self.update_method()
File "/config/custom_components/midea_dehumidifier_lan/appliance_coordinator.py", line 107, in _async_appliance_refresh
await self._async_do_update()
File "/config/custom_components/midea_dehumidifier_lan/appliance_coordinator.py", line 130, in _async_do_update
setattr(self.appliance.state, attr, self.updating[attr])
File "/usr/local/lib/python3.9/site-packages/midea_beautiful/appliance.py", line 657, in mode
mode = int(mode)
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
@poldim can you check if problem persists in version 0.8.10?
@poldim can you check if problem persists in version 0.8.10?
Hey, just tried to see if this works this weekend and it appeared to bring in my two mini-splits on v8.12.
Unfortunately, looking at the devices from the past day it does not appear to be communicating reliably. Are you aware if anything can be done to improve the stability of these devices? In parallel, I will do some checking to make sure it's not falling off of my WiFi network this week.


The mini split was roaming to an AP two floors away. I've locked it to the local AP and this solved the AP going unavailable.