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.
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.
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
Discovery through the new SmartHome Cloud Provider does not work.
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.
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)
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)’
@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.
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…
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 .
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.