[MIDEA] SmartHome cloud provides valid keys, but local connection fails (Connect device using method 1/2/99 failed)
The problem
I cannot complete the setup for a Midea Air Conditioner (Model: 00000Q18, Type: 0xAC, Subtype: 5120) using the core Midea integration. I switched from the HACS LAN integration to this official one after that had issues. This worked with NetHome at first. Then like the others above. Started having issues.
When attempting the setup via the SmartHome server, the cloud login succeeds perfectly, and the integration successfully fetches the valid local token and key (get_keys() returned 1 token entries).
However, immediately after the cloud provides the keys, Home Assistant fails to connect to the appliance over the local network. It exhausts all connection methods (method 1, method 2, and method 99) before throwing an "Unable to connect device with all the token/key" error. After the local handshake fails, the integration automatically attempts to fall back to the NetHome Plus server, which then instantly hits an errorCode: 9999 API block.
Even when attempting Manual Configuration (specifying the exact IP, Port 6444, Protocol 3, and the valid Token/Key generated by the SmartHome cloud), it still fails with "Could not connect with the provided configuration."
Steps taken:
- Fully removed the custom midea_ac_lan HACS integration.
- Restarted Home Assistant and updated to the latest stable release (2026.9.0).
- Power-cycled the AC for 60 seconds to ensure no hung TCP ports were blocking the connection.
- Verified the IP address is correct and reserved.
Linked Issue: https://github.com/home-assistant/core/issues/180429#issuecomment-5515075629
Source: home-assistant/core