New OH3 Binding - Midea Air Conditioning (LAN)

It would be great to get this binding working on OH 4.x
In case you need (beta) testers to get it work under 4.x I would be very happy to help.

Currently I’m running OH 4.0.4 and I have 2 Senville mini splits both with OSK102 WiFi sticks (no security). One mini split has a typical ductless indoor wall unit with swing function (24,000BTU) and the other has a concealed ducted indoor unit (9,000 BTU).

The (old) binding worked great on OH 3.4.5 with both mini splits.

Hey everyone, did someone get this working in oh 4?

I hope @zdanhauser will find time some day to port the binding to OH4. Until this happens I’ve installed an additional OH version 3.4.5 as a separate docker instance for just using this binding and connect this instance via the “Remote openHAB Server” binding to my current OH 4.1.0 production instance. This works without any issues.

edit to allow folks to get clean version download.from binding devs

Hey guys, unfortunately, due to family reasons, I didn’t have time to refactor the entire code as I promised earlier. There was enough time to port it to version 4.1. The code is mostly unchanged but works on both 4.0 and 4.1

3 Likes

Thanks a lot Zoltán for your great work on this binding!

Discovery through the new SmartHome Cloud Provider does not work. :frowning:

I’ve migrated from the Midea Air application to the new SmartHome (formerly MSmartHome). And now I cannot add new Thing because when I try to get the token-key using the binding and the CloudProvider it fails. :frowning:

CloudProvider: MSmartHome:
It fails as some value is illegal.

01:06:49.846 [INFO ] [dler.MideaACHandler$ConnectionManager] - Connected to mideaac:ac:7c86276bb4 at 192.168.0.170
01:06:49.847 [DEBUG] [deaac.internal.handler.MideaACHandler] - Changing status of mideaac:ac:7c86276bb4 from UNKNOWN(NONE) to ONLINE
01:06:49.848 [DEBUG] [dler.MideaACHandler$ConnectionManager] - Device mideaac:ac:7c86276bb4@192.168.0.170 require authentication, going to authenticate
01:06:49.848 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'mideaac:ac:7c86276bb4' changed from UNKNOWN to ONLINE
01:06:49.848 [TRACE] [dler.MideaACHandler$ConnectionManager] - Version: 3
01:06:49.849 [TRACE] [dler.MideaACHandler$ConnectionManager] - Key:
01:06:49.850 [TRACE] [dler.MideaACHandler$ConnectionManager] - Token:
01:06:49.850 [INFO ] [dler.MideaACHandler$ConnectionManager] - Retrieving Token and Key from cloud
01:06:49.851 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'mideaac:ac:7c86276bb4' changed from ONLINE to OFFLINE (CONFIGURATION_PENDING): Retrieving Token and Key from cloud.
01:06:49.852 [DEBUG] [nding.mideaac.internal.security.Cloud] - Request json: {"appId":"1010","format":2,"clientType":1,"language":"en_US","src":"1010","stamp":"20240106010649","loginAccount":"my@email.com","reqId":"83db36fe24b1ba44"}
01:06:49.853 [DEBUG] [nding.mideaac.internal.security.Cloud] - Request headers: Accept-Encoding: gzip
User-Agent: Dalvik/2.1.0 (Linux; U; Android 7.0; SM-G935F Build/NRD90M)
Content-Type: application/json
secretVersion: 1
sign: 6bdf22b71829048959a8034d41428976f301adca577475bc9ec2cb414fa9b32e7
random: 1724499609
accessToken:


01:06:50.521 [DEBUG] [nding.mideaac.internal.security.Cloud] - Response json: {"code":"3004","msg":"value is illegal."}
01:06:50.521 [WARN ] [nding.mideaac.internal.security.Cloud] - Error logging to Cloud: value is illegal.
01:06:50.522 [WARN ] [dler.MideaACHandler$ConnectionManager] - Can't retrieve Token and Key from Cloud (value is illegal.)

CloudProvider: Midea Air
It fails because my account does not exists anymore. And I cannot return after the migration.

01:10:43.242 [TRACE] [dler.MideaACHandler$ConnectionManager] - Connecting to mideaac:ac:7c86276bb4 at 192.168.0.170:6444
01:10:43.242 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'mideaac:ac:7c86276bb4' changed from UNKNOWN (CONFIGURATION_PENDING): Configuration missing, discovery needed. Discovering... to UNKNOWN
01:10:43.250 [INFO ] [dler.MideaACHandler$ConnectionManager] - Connected to mideaac:ac:7c86276bb4 at 192.168.0.170
01:10:43.250 [DEBUG] [deaac.internal.handler.MideaACHandler] - Changing status of mideaac:ac:7c86276bb4 from UNKNOWN(NONE) to ONLINE
01:10:43.251 [DEBUG] [dler.MideaACHandler$ConnectionManager] - Device mideaac:ac:7c86276bb4@192.168.0.170 require authentication, going to authenticate
01:10:43.251 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'mideaac:ac:7c86276bb4' changed from UNKNOWN to ONLINE
01:10:43.252 [TRACE] [dler.MideaACHandler$ConnectionManager] - Version: 3
01:10:43.252 [TRACE] [dler.MideaACHandler$ConnectionManager] - Key:
01:10:43.253 [TRACE] [dler.MideaACHandler$ConnectionManager] - Token:
01:10:43.254 [INFO ] [dler.MideaACHandler$ConnectionManager] - Retrieving Token and Key from cloud
01:10:43.254 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'mideaac:ac:7c86276bb4' changed from ONLINE to OFFLINE (CONFIGURATION_PENDING): Retrieving Token and Key from cloud.
01:10:43.255 [DEBUG] [nding.mideaac.internal.security.Cloud] - Request json: {"appId":"1117","format":2,"clientType":1,"language":"en_US","src":"1117","stamp":"20240106011043","loginAccount":"my@email.com"}
01:10:43.256 [TRACE] [ng.mideaac.internal.security.Security] - url: https://mapp.appsmb.com/v1/user/login/id/get
01:10:43.257 [TRACE] [ng.mideaac.internal.security.Security] - sign: /v1/user/login/id/getappId=1117&clientType=1&format=2&language=en_US&loginAccount=my@email.com&src=1117&stamp=20240106011043ff0cf6f5f0c3471de36341cab3f7a9af
01:10:43.258 [DEBUG] [nding.mideaac.internal.security.Cloud] - Request headers: Accept-Encoding: gzip
User-Agent: Dalvik/2.1.0 (Linux; U; Android 7.0; SM-G935F Build/NRD90M)
Content-Type: application/x-www-form-urlencoded
secretVersion: 1
sign: ed12088b4c4ac9c62dff90c07ee3d1dd3e74e58b286a48332fed0734bac3b449ce3
random: 1704499843
accessToken:


01:10:43.258 [DEBUG] [nding.mideaac.internal.security.Cloud] - Request body: appId=1117&clientType=1&format=2&language=en_US&loginAccount=eleklaszlosj@gmail.com&sign=ed12088b4c4ac9c62dff90c07d1dd3e7ee34e58b286a48332fed0734bac3b449ce3&src=1117&stamp=20240106011043
01:10:43.788 [DEBUG] [nding.mideaac.internal.security.Cloud] - Response json: {"msg":"this account does not exist","errorCode":"3102"}
01:10:43.788 [WARN ] [nding.mideaac.internal.security.Cloud] - Error logging to Cloud: this account does not exist
01:10:43.789 [WARN ] [dler.MideaACHandler$ConnectionManager] - Can't retrieve Token and Key from Cloud (this account does not exist)
01:10:43.790 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'mideaac:ac:7c86276bb4' changed from OFFLINE (CONFIGURATION_PENDING): Retrieving Token and Key from cloud. to OFFLINE (CONFIGURATION_ERROR): Can't retrieve Token and Key from Cloud (this account does not exist).

I should not migrate to the new Smart Home application. My fault.
(It is the 4.0.1 version)

I could retrieve a key-token pair with python:

pip3 install msmart-ng
msmart-ng query 192.168.0.170 --auto

See: GitHub - mill1000/midea-msmart: Python library for local control of Midea (and associated brands) smart air conditioners.

For me this worked as well, thnx!

Situation:
Midea V3 AC migrated to the new Smart Home application.

Steps:

  • Add new jar file to addon folder
  • use python code to retrieve the key and token
  • Copy key and token and paste in manual added thing. Leave ID and cloud information empty (First I filled ID as well, but then I got the error (HANDLER_INITIALIZING_ERROR): Cannot invoke "String.toString()" because the return value of "java.util.Map.get(Object)" is null)’
  • save Thing, let it discovery and it works :slight_smile:

@zdanhauser thnx!

1 Like

There is only an issue, every ~2 minutes for a short period to Offline

The debug log shows the following:


2024-01-06 11:40:14.287 [DEBUG] [ler.MideaACHandler$ConnectionManager] - Connection check OK for mideaac:ac:xxxxxxxxxxx at 192.168.0.xxx

2024-01-06 11:40:14.289 [DEBUG] [ler.MideaACHandler$ConnectionManager] - Requesting status update from mideaac:ac:xxxxxxxxxxx at 192.168.0.xxx

2024-01-06 11:40:14.290 [DEBUG] [ler.MideaACHandler$ConnectionManager] - Writing to mideaac:ac:xxxxxxxxxxx at 192.168.0.xxx bytes.length: 104, bytes: 5A5A01116800200000000000011800060B280E008F7A0000001200000000000000000000000000006B000A76E27EED2C3647E57D8602DF8B3F4EE2ECC7958BEB7CDE1C8E4D35B902A8F076B4772087D783B4E55608F449D034F4D76DEE0FFA6EC2C1DCF0F8A6B5BF

2024-01-06 11:40:24.300 [DEBUG] [ler.MideaACHandler$ConnectionManager] - Disconnecting from mideaac:ac:xxxxxxxxxxx at 192.168.0.xxx

2024-01-06 11:40:24.301 [DEBUG] [eaac.internal.handler.MideaACHandler] - Changing status of mideaac:ac:xxxxxxxxxxx from ONLINE(NONE) to OFFLINE

2024-01-06 11:40:24.302 [DEBUG] [eaac.internal.handler.MideaACHandler] - Changing status of mideaac:ac:xxxxxxxxxxx from OFFLINE(NONE) to OFFLINE class="highlight commError">(COMMUNICATION_ERROR)

==> /var/log/openhab/events.log <==

2024-01-06 11:40:24.305 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'mideaac:ac:xxxxxxxxxxx' changed from ONLINE to OFFLINE

2024-01-06 11:40:24.306 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'mideaac:ac:xxxxxxxxxxx' changed from OFFLINE to UNKNOWN

==> /var/log/openhab/openhab.log <==

2024-01-06 11:40:24.553 [DEBUG] [eaac.internal.handler.MideaACHandler] - Changing status of mideaac:ac:xxxxxxxxxxx from OFFLINE class="highlight commError">(COMMUNICATION_ERROR) to OFFLINE class="highlight commError">(COMMUNICATION_ERROR)

==> /var/log/openhab/events.log <==

2024-01-06 11:40:24.554 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'mideaac:ac:xxxxxxxxxxx' changed from UNKNOWN to OFFLINE (COMMUNICATION_ERROR): Read timed out

2024-01-06 11:40:24.558 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'mideaac:ac:xxxxxxxxxxx' changed from OFFLINE (COMMUNICATION_ERROR): Read timed out to UNKNOWN

2024-01-06 11:40:24.808 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'mideaac:ac:xxxxxxxxxxx' changed from UNKNOWN to OFFLINE (COMMUNICATION_ERROR): Device not responding with its status.

2024-01-06 11:40:30.471 [INFO ] [openhab.event.ItemStateUpdatedEvent ] - Item 'MasterBedroombedsidelamp_Bedsidelampswitch' updated to OFF

==> /var/log/openhab/openhab.log <==

2024-01-06 11:40:34.808 [DEBUG] [ler.MideaACHandler$ConnectionManager] - Connection check FAILED for mideaac:ac:xxxxxxxxxxx at 192.168.0.xxx

2024-01-06 11:40:34.813 [INFO ] [ler.MideaACHandler$ConnectionManager] - Connected to mideaac:ac:xxxxxxxxxxx at 192.168.0.xxx

2024-01-06 11:40:34.814 [DEBUG] [eaac.internal.handler.MideaACHandler] - Changing status of mideaac:ac:xxxxxxxxxxx from OFFLINE class="highlight commError">(COMMUNICATION_ERROR) to ONLINE

2024-01-06 11:40:34.815 [DEBUG] [ler.MideaACHandler$ConnectionManager] - Device mideaac:ac:xxxxxxxxxxx@192.168.0.xxx require authentication, going to authenticate

==> /var/log/openhab/events.log <==

2024-01-06 11:40:34.815 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'mideaac:ac:xxxxxxxxxxx' changed from OFFLINE (COMMUNICATION_ERROR): Device not responding with its status. to ONLINE

==> /var/log/openhab/openhab.log <==

2024-01-06 11:40:34.816 [DEBUG] [ler.MideaACHandler$ConnectionManager] - Device mideaac:ac:xxxxxxxxxxx@192.168.0.xxx authenticating

2024-01-06 11:40:35.132 [DEBUG] [ler.MideaACHandler$ConnectionManager] - Response received length: 72

2024-01-06 11:40:35.134 [DEBUG] [ler.MideaACHandler$ConnectionManager] - Response bytes: 83700040200100008E9A3D05C682FBF275CD5ECBAFA8CA2030AD1C547B654EB9D9AA7DB675A225B44B87CE4F0EFBE289CBE8D0A5FDD0A968906001369150EAE208CF94860E90490A

2024-01-06 11:40:35.135 [DEBUG] [ler.MideaACHandler$ConnectionManager] - Authentication successufull

2024-01-06 11:40:36.137 [DEBUG] [ler.MideaACHandler$ConnectionManager] - Cancelling connection monitor job for mideaac:ac:xxxxxxxxxxx at 192.168.0.xxx

2024-01-06 11:40:36.138 [DEBUG] [ler.MideaACHandler$ConnectionManager] - Writing to mideaac:ac:xxxxxxxxxxx at 192.168.0.xxx bytes.length: 104, bytes: 5A5A01116800200000000000011800060B2824008F7A0000001200000000000000000000000000006B000A76E27EED2C3647E57D8602DF8B5E715882DE60DBA0E3796FE854DA3AF32D7ED3293C5031048410429AD538D2FB25E1D7C9CE2B9DD83A8C2D5B4480EC0A

2024-01-06 11:40:36.695 [DEBUG] [ler.MideaACHandler$ConnectionManager] - Response received length: 150

2024-01-06 11:40:36.697 [DEBUG] [ler.MideaACHandler$ConnectionManager] - Response bytes: 8370008E2063783911C953C74477671254B24DB052B359916CB460505E733F038603154C602D60EF9AB464BD95668C70C50EC9FF7B4B663BC6E0D9997F49C6C1BD94FB9D87C086EFA21E2B80B836A3686142672918D1322B14C2BCB363381AC0A3EFC9E13AB943D2536684AD069A5C072B5E11F61427E47D0266DC469F56FE4F295C0A9C4AC6880997E21F246BFF975E7D6CE42C3C31

2024-01-06 11:40:36.699 [DEBUG] [ler.MideaACHandler$ConnectionManager] - Response length: 104

I already changed the timeout to 10 seconds but this didn’t help. Any other options?

I also receive these error messages. Nevertheless, the plugin is still functional.

@lampy @borazslo

Somehow my configuration initializes ok and the Thing goes “Online” and I followed the steps how to add it

First of all it shows online but it does not show any temperature settings or actual temperatures.

If I try to turn the power on of the AC it only shows:

I am not sure where else to look, used the procedure of retreiving the key and token and also that worked…

Any further idea?

@zdanhauser thanks for upgrading the binding.

Solong
B

For more details about the problem you could look for the log.

  • Use the openhab console (see: docs/console )
  • log:set TRACE org.openhab.binding.mideaac (see: the binding’s readme)
  • log:tail (see: docs/Logging)
  • on the web ui disable and enable the thing or changes and save
  • check the logs in the console for further details

Somehow the binding seems to crash when I change a status for example on. Then I edit the Thing and save it and it comes back online.

This is the log:


> > 22:45:07.972 [DEBUG] [deaac.internal.handler.MideaACHandler] - Configuration valid for mideaac:ac:Heatpump_small
> > 22:45:07.973 [DEBUG] [deaac.internal.handler.MideaACHandler] - IPAddress: 192.168.2.90
> > 22:45:07.973 [DEBUG] [deaac.internal.handler.MideaACHandler] - IPPort: 6444
> > 22:45:07.981 [DEBUG] [deaac.internal.handler.MideaACHandler] - ID: -xxxxxxx930205742
> > 22:45:07.981 [DEBUG] [deaac.internal.handler.MideaACHandler] - Version: 3
> > 22:45:07.982 [TRACE] [dler.MideaACHandler$ConnectionManager] - Connecting to mideaac:ac:Heatpump_small at 192.168.2.90                               :6444
> > 22:45:08.014 [INFO ] [dler.MideaACHandler$ConnectionManager] - Connected to mideaac:ac:Heatpump_small at 192.168.2.90
> > 22:45:08.015 [DEBUG] [deaac.internal.handler.MideaACHandler] - Changing status of mideaac:ac:Heatpump_small from UNKNO                               WN(NONE) to ONLINE
> > 22:45:08.019 [DEBUG] [dler.MideaACHandler$ConnectionManager] - Device mideaac:ac:Heatpump_small@192.168.2.90 require a                               uthentication, going to authenticate
> > 22:45:08.021 [TRACE] [dler.MideaACHandler$ConnectionManager] - Version: 3
> > 22:45:08.022 [TRACE] [dler.MideaACHandler$ConnectionManager] - Key:  xxxxxxx2f7037452b860d7515b41c903da401d44ae7b64954a                               98bb6bd7bad768c
> > 22:45:08.023 [TRACE] [dler.MideaACHandler$ConnectionManager] - Token: xxxxxxx8fb848a11cdaf62033c285fe79cc5642d1dcd3f444                               0e45ec11923743f71780a1391cc1da07029764bbfacf65c006538a86f2d50d47840a7ae6edc072da
> > 22:45:08.024 [DEBUG] [dler.MideaACHandler$ConnectionManager] - Device mideaac:ac:Heatpump_small@192.168.2.90 authentic                               ating
> > 22:45:08.025 [TRACE] [ng.mideaac.internal.security.Security] - Size: 64
> > 22:45:08.026 [TRACE] [ng.mideaac.internal.security.Security] - Header:      837000402000
> > 22:45:08.026 [TRACE] [ng.mideaac.internal.security.Security] - Data:        00008723FD8FB848A11CDAF62033C285FE79CC5642                               D1DCD3F4440E45EC11923743F71780A1391CC1DA07029764BBFACF65C006538A86F2D50D47840A7AE6EDC072DA
> > 22:45:08.027 [TRACE] [ng.mideaac.internal.security.Security] - Result:      83700040200000008723FD8FB848A11CDAF62033C2                               85FE79CC5642D1DCD3F4440E45EC11923743F71780A1391CC1DA07029764BBFACF65C006538A86F2D50D47840A7AE6EDC072DA
> > 22:45:08.028 [TRACE] [dler.MideaACHandler$ConnectionManager] - Device mideaac:ac:Heatpump_small@192.168.2.90 writing h                               andshake_request: 83700040200000008723FD8FB848A11CDAF62033C285FE79CC5642D1DCD3F4440E45EC11923743F71780A1391CC1DA070297                               64BBFACF65C006538A86F2D50D47840A7AE6EDC072DA
> > 22:45:08.226 [DEBUG] [dler.MideaACHandler$ConnectionManager] - Response received length: 72
> > 22:45:08.227 [DEBUG] [dler.MideaACHandler$ConnectionManager] - Response bytes: 83700040200100004CED715A57DC4A49A3D625F                               BFCEDE5A76D9F9801D777DA486698D5CDE6640618F5F770F2FA68F9ED0D599940044282F194CEBB23A32AE1FF0157938772902129
> > 22:45:08.228 [TRACE] [dler.MideaACHandler$ConnectionManager] - Device mideaac:ac:Heatpump_small@192.168.2.90 response                                for handshake_request length: 72
> > 22:45:08.229 [TRACE] [dler.MideaACHandler$ConnectionManager] - Device mideaac:ac:Heatpump_small@192.168.2.90 response                                for handshake_request: 83700040200100004CED715A57DC4A49A3D625FBFCEDE5A76D9F9801D777DA486698D5CDE6640618F5F770F2FA68F9E                               D0D599940044282F194CEBB23A32AE1FF0157938772902129
> > ^C~                                                                                                                                                  openhab> 22:45:10.776 [TRACE] [dler.MideaACHandler$ConnectionManager] - Performing connection check for mideaac:ac:Hea                               tpump_Midea at IP 192.168.2.90
> > 22:45:10.778 [TRACE] [dler.MideaACHandler$ConnectionManager] - Checking status of connection for mideaac:ac:Heatpump_M                               idea at 192.168.2.90
> > 22:45:10.778 [DEBUG] [dler.MideaACHandler$ConnectionManager] - Connection check FAILED for mideaac:ac:Heatpump_Midea a                               t 192.168.2.90

Any further idea?
Solong
B

@zdanhauser can provide your latest source code some place accessible ? even if your just zip it all up and share the link would be great.
The only version I have of your changes to @JacekDob’s original binding is not on @borazslo git hub any longer nor is your latest version either.
@lampy @bandit7311 these are the behaviors I mentioned before that I have been chasing in my debug version of the binding.
This binding is a combination/adaptation of 3 different python scripts and handles both version 2 and version 3 devices it seems some of the methods step on each other.
It is still very much work in progress.
It is also the reason the binding never got submitted as official OH binding (it is still missing many requirements) and for same reason it has not been added to marketplace again it is still wip.

1 Like

I maybe have found an issue:

00:02:31.201 [WARN ] [ng.mideaac.internal.security.Security] - AES decryption error: InvalidKeyException: Illegal key size

I am using the msmart-ng tool to retrieve the key and token and my AC is registered and connect to Smarthome Cloud (formerly MSmarthome)

To where did you register your AC @borazslo and did you use msmart-ng? is it working for you now?

Thanks
B

you can use whatever cloud provider you have your A/C linked to and have an account with.
If your a/c authenticated and came on line and provided you with status as well as initial values then your already past the stage where the key/token would have failed and been a issue.

Yeah but no initial values are shown, it goes online and right after 2 seconds later the information about AESdecription error comes up, but Thing stays online.

Very strange
I was so happy to be able to control my AC / Heat pump now through OH
really would appreciate some more help / ideas…

Thanks
a lot
B

see here

2.242 [DEBUG] [deaac.internal.handler.MideaACHandler] - MideaACHandler config for mideaac:ac:Heatpump_small is org.openhab.binding.mideaac.internal.MideaACConfiguration@6de6de95
00:32:02.243 [DEBUG] [deaac.internal.handler.MideaACHandler] - Configuration valid for mideaac:ac:Heatpump_small
00:32:02.243 [DEBUG] [deaac.internal.handler.MideaACHandler] - IPAddress: 192.168.2.90
00:32:02.256 [DEBUG] [deaac.internal.handler.MideaACHandler] - IPPort: 6444
00:32:02.257 [DEBUG] [deaac.internal.handler.MideaACHandler] - ID: 146235046504914
00:32:02.258 [DEBUG] [deaac.internal.handler.MideaACHandler] - Version: 3
00:32:02.261 [TRACE] [dler.MideaACHandler$ConnectionManager] - Connecting to mideaac:ac:Heatpump_small at 192.168.2.90:6444
00:32:02.281 [INFO ] [dler.MideaACHandler$ConnectionManager] - Connected to mideaac:ac:Heatpump_small at 192.168.2.90
00:32:02.464 [DEBUG] [deaac.internal.handler.MideaACHandler] - Changing status of mideaac:ac:Heatpump_small from UNKNOWN(NONE) to ONLINE
00:32:02.465 [DEBUG] [dler.MideaACHandler$ConnectionManager] - Device mideaac:ac:Heatpump_small@192.168.2.90 require authentication, going to authenticate
00:32:02.466 [TRACE] [dler.MideaACHandler$ConnectionManager] - Version: 3
00:32:02.467 [TRACE] [dler.MideaACHandler$ConnectionManager] - Key: xxxxxxxfc41e4a7888985f2dc78d88b9e599b792959143058e6ae5f826df2b9b
00:32:02.472 [TRACE] [dler.MideaACHandler$ConnectionManager] - Token: xxxxxxx202329bf31ede7cfaede68f51ffba5d1c914abd7301069adc8d2b6dde31054dc8d236916fefda65c46af5e3ba4dde04071fb97e8706ae6b4daa52b349
00:32:02.473 [DEBUG] [dler.MideaACHandler$ConnectionManager] - Device mideaac:ac:Heatpump_small@192.168.2.90 authenticating
00:32:02.474 [TRACE] [ng.mideaac.internal.security.Security] - Size: 64
00:32:02.475 [TRACE] [ng.mideaac.internal.security.Security] - Header:      837000402000
00:32:02.476 [TRACE] [ng.mideaac.internal.security.Security] - Data:        00000F88B3E202329BF31EDE7CFAEDE68F51FFBA5D1C914ABD7301069ADC8D2B6DDE31054DC8D236916FEFDA65C46AF5E3BA4DDE04071FB97E8706AE6B4DAA52B349
00:32:02.476 [TRACE] [ng.mideaac.internal.security.Security] - Result:      83700040200000000F88B3E202329BF31EDE7CFAEDE68F51FFBA5D1C914ABD7301069ADC8D2B6DDE31054DC8D236916FEFDA65C46AF5E3BA4DDE04071FB97E8706AE6B4DAA52B349
00:32:02.477 [TRACE] [dler.MideaACHandler$ConnectionManager] - Device mideaac:ac:Heatpump_small@192.168.2.90 writing handshake_request: 83700040200000000F88B3E202329BF31EDE7CFAEDE68F51FFBA5D1C914ABD7301069ADC8D2B6DDE31054DC8D236916FEFDA65C46AF5E3BA4DDE04071FB97E8706AE6B4DAA52B349
00:32:02.483 [DEBUG] [dler.MideaACHandler$ConnectionManager] - Response received length: 72
00:32:02.489 [DEBUG] [dler.MideaACHandler$ConnectionManager] - Response bytes: 83700040200100003E233FF3328640E629B90ABD59039E10C5269AEF515954DA9CFB76DE70A5F6246A58A3600F3D3E46D23D487D86EE480E04548FB9FDDDD0544268525ACEAC6009
00:32:02.490 [TRACE] [dler.MideaACHandler$ConnectionManager] - Device mideaac:ac:Heatpump_small@192.168.2.90 response for handshake_request length: 72
00:32:02.495 [TRACE] [dler.MideaACHandler$ConnectionManager] - Device mideaac:ac:Heatpump_small@192.168.2.90 response for handshake_request: 83700040200100003E233FF3328640E629B90ABD59039E10C5269AEF515954DA9CFB76DE70A5F6246A58A3600F3D3E46D23D487D86EE480E04548FB9FDDDD0544268525ACEAC6009
00:32:02.496 [WARN ] [ng.mideaac.internal.security.Security] - AES decryption error: InvalidKeyException: Illegal key size

only thing I say when MSsmarthome migrated all of the midia air accounts over was you have to go back into the app and rejoin everything and then reaccept all the disclaimers then it worked fine till they tried to push firmware updates to your units and that would randomely fail and take your unit to fan only .
I still have all my units 4 of them different versions as well on the nethome plus account and it still auto discovers and provides me the valid key/token pairs every time same. I had my a/c joined to msmarthome and had constant issues with them going off line and switching to fan only got sick of that and reset them back and added them to nethome again since then I never have had key /token issues.

Unless @zdanhauser says he also changed the encrypt/decrypt methods if it worked before and does not work now then you may have cloud provider issues.
you could also pull down the midea beautiful air python and test it.
That was where the original developer @JacekDob pulled the auto discover for v3 versions appid and signkey from .

SUPPORTED_APPS: Final = {
    "NetHome Plus": {
        "appkey": "3742e9e5842d4ad59c2db887e12449f9",
        "appid": 1017,
        "apiurl": "https://mapp.appsmb.com",
        "signkey": "xhdiwjnchekd4d512chdjx5d8e4c394D2D7S",
        "proxied": None,
    },
    "Midea Air": {
        "appkey": "ff0cf6f5f0c3471de36341cab3f7a9af",
        "appid": 1117,
        "apiurl": "https://mapp.appsmb.com",
        "signkey": "xhdiwjnchekd4d512chdjx5d8e4c394D2D7S",
        "proxied": None,
    },
    "MSmartHome": {
        "appkey": "ac21b9f9cbfe4ca5a88562ef25e2b768",
        "appid": 1010,
        "apiurl": "https://mp-prod.appsmb.com/mas/v5/app/proxy?alias=",
        "signkey": "xhdiwjnchekd4d512chdjx5d8e4c394D2D7S",
        # meicloud
        "iotkey": decrypt_internal("f4dcd1511147af45775d7e680ac5312b"),  # noqa: E501
        # PROD_VnoClJI9aikS8dyy
        "hmackey": decrypt_internal(
            "5018e65c32bcec087e6c01631d8cf55398308fc19344d3e130734da81ac2e162"
        ),
        "proxied": "v5",
    },

for me as I said I got sick of Msmarthome breaking stuff all the time and disabling my a/c to try and force firmware updates on me that I did not want or need. So, I went to nethome plus and never played with msmarthome again.