New OH3 Binding - Midea Air Conditioning (LAN)

Hi,
I want to try first time this binding, and not working with my Midea MA-12NXD0-I.
I installed the binding, then configured, and the binding filled the device id, token and key.
But the thing is offline with COMMUNICATION_ERROR
The log is:

2022-07-20 14:11:27.210 [DEBUG] [ler.MideaACHandler$ConnectionManager] - Response received length: 72
2022-07-20 14:11:27.210 [DEBUG] [ler.MideaACHandler$ConnectionManager] - Response bytes: 8370004020010000A265...........
2022-07-20 14:11:27.211 [WARN ] [g.mideaac.internal.security.Security] - AES decryption error: InvalidKeyException: Illegal key size
2022-07-20 14:11:27.211 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.initialize()' on 'org.openhab.binding.mideaac.internal.handler.MideaACHandler@20ec5f2e': null

What can I do?

How do i connect with this plugin? I need the key and the token from midea but i don’t know how to get it. I don’t know the link. Can someone help me with this please?

How did you get the key and token?

The error you posted shows the token and key used are not valid incorrect Illegal key size
clear out the values for the id username and password for the online account you used for discovery and save and retry the configuration process also make sure what you used for the online account works and you can control your a/c from the online app and the device you discovered is actually controllable from that online account.

you need to use the credentials that you used when you first set up the a/c to connect to your online account either Nethome plus or Midea air or MSmartHome app then binding can connect to the online service for the one time retrial using any one of those 3 app accounts to obtain the token and key but you have to have a valid account able to log on to that online account and your A/C is set up in that online account.
This is only used 1 time to get the token and key pair after it is configured the binding only talks to the unit on your local network and that online account email(username) and that online account password are no longer used.

Where is the link?

Hi,
I tried it several times, but the key/token pair which is downloaded by the binding is not working.

2022-07-21 13:36:36.289 [DEBUG] [ding.mideaac.internal.security.Cloud] - Response json: {"msg":"ok","code":"0","data":{"tokenlist":[{"udpId":"4115aaa44874***","key":"5EDE6A524A1F435095B70D1083560FB1B54D*****","token":"9EB38AC6C53253BDA43240AA4E6B*****"}]}}
2022-07-21 13:36:36.291 [DEBUG] [ding.mideaac.internal.security.Cloud] - Api response ok: 0 (ok)
2022-07-21 13:36:36.306 [TRACE] [ler.MideaACHandler$ConnectionManager] - Token: 9EB38AC6C53253BDA43240AA4E6B*****
2022-07-21 13:36:36.306 [TRACE] [ler.MideaACHandler$ConnectionManager] - Key: 5EDE6A524A1F435095B70D1083560FB1B54D*****
2022-07-21 13:36:36.306 [WARN ] [ler.MideaACHandler$ConnectionManager] - Token and Key obtained from cloud, saving, initializing
2022-07-21 13:36:36.308 [DEBUG] [ler.MideaACHandler$ConnectionManager] - Disconnecting from mideaac:ac:5ee0f8d399 at 10.0.10.145
2022-07-21 13:36:36.314 [DEBUG] [eaac.internal.handler.MideaACHandler] - MideaACHandler config for mideaac:ac:5ee0f8d399 is org.openhab.binding.mideaac.internal.MideaACConfiguration@682a0535
2022-07-21 13:36:36.315 [DEBUG] [eaac.internal.handler.MideaACHandler] - Configuration valid for mideaac:ac:5ee0f8d399
2022-07-21 13:36:36.316 [DEBUG] [eaac.internal.handler.MideaACHandler] - IPAddress: 10.0.10.145
2022-07-21 13:36:36.316 [DEBUG] [eaac.internal.handler.MideaACHandler] - IPPort: 6444
2022-07-21 13:36:36.316 [DEBUG] [eaac.internal.handler.MideaACHandler] - ID: 19791209338720
2022-07-21 13:36:36.316 [DEBUG] [eaac.internal.handler.MideaACHandler] - Version: 3
2022-07-21 13:36:36.320 [TRACE] [ler.MideaACHandler$ConnectionManager] - Connecting to mideaac:ac:5ee0f8d399 at 10.0.10.145:6444
2022-07-21 13:36:36.324 [INFO ] [ler.MideaACHandler$ConnectionManager] - Connected to mideaac:ac:5ee0f8d399 at 10.0.10.145
2022-07-21 13:36:36.327 [DEBUG] [eaac.internal.handler.MideaACHandler] - Changing status of mideaac:ac:5ee0f8d399 from UNKNOWN(NONE) to ONLINE
2022-07-21 13:36:36.333 [DEBUG] [ler.MideaACHandler$ConnectionManager] - Device mideaac:ac:5ee0f8d399@10.0.10.145 require authentication, going to authenticate
2022-07-21 13:36:36.333 [TRACE] [ler.MideaACHandler$ConnectionManager] - Version: 3
2022-07-21 13:36:36.334 [TRACE] [ler.MideaACHandler$ConnectionManager] - Key: 5EDE6A524A1F435095B70D1083560FB1B54D****
2022-07-21 13:36:36.335 [TRACE] [ler.MideaACHandler$ConnectionManager] - Token: 9EB38AC6C53253BDA43240AA4E6B*****
2022-07-21 13:36:36.335 [DEBUG] [ler.MideaACHandler$ConnectionManager] - Device mideaac:ac:5ee0f8d399@10.0.10.145 authenticating
2022-07-21 13:36:36.335 [TRACE] [g.mideaac.internal.security.Security] - Size: 64
2022-07-21 13:36:36.336 [TRACE] [g.mideaac.internal.security.Security] - Header:      837000402000
2022-07-21 13:36:36.336 [TRACE] [g.mideaac.internal.security.Security] - Data:        00199EB38AC6C53253BDA43240AA4E6B****
2022-07-21 13:36:36.336 [TRACE] [g.mideaac.internal.security.Security] - Result:      83700040200000199EB38AC6C53253B****
2022-07-21 13:36:36.339 [TRACE] [ler.MideaACHandler$ConnectionManager] - Device mideaac:ac:5ee0f8d399@10.0.10.145 writing handshake_request: 83700040200000199EB38AC6C53253BDA43240AA4E6B****
2022-07-21 13:36:36.784 [DEBUG] [ler.MideaACHandler$ConnectionManager] - Response received length: 13
2022-07-21 13:36:36.784 [DEBUG] [ler.MideaACHandler$ConnectionManager] - Response bytes: 83700005200F00004552524F52
2022-07-21 13:36:36.785 [WARN ] [ler.MideaACHandler$ConnectionManager] - Authentication reponse unexpected data length (13 instead of 72)!
2022-07-21 13:36:36.786 [DEBUG] [ler.MideaACHandler$ConnectionManager] - Invalid Token. Correct Token in configuration

Then I tried to use the key/token with the nbogojevic/midea-beautiful-air script, still not working.
Then I tried to obtain the key/token with the mac-zhou/midea-msmart discovery tool, if I execute it with the AC ip or account/pass it receives a different key/token every time.
This key/token can be used with the nbogojevic/midea-beautiful-air script. It throws an exception, but the AC can be switched on/off or change the target temperature.
Then I removed the email and password from the binding and put these key/token.
And it is not working with the error in previous post.

The MsmartHome app working correctly with the email/password.

So I am in troube. How can I solve the errors?

the mac-zhou discover will pull a new token key pair every time you run it that is the normal however any matched set of token and key pair you get should work and can be reused.
Did you try using the example.py from mac-zhou to see if you could return the status and change values?
I have seen that same behavior of the nbogojevic script also it works but as you said it will return errors.
all of what you post still seem to indicate a bad token key pair populated in the thing remember spaces and carriage returns are also counted as a character so be sure you are not copying any unexpected hidden character values when you populate the fields in the a/c thing
Such as you placed the values in notepad and you had wordwrap on as one example or you direct copied the values from the return log from the discover and got a leading or trailing space

what link are you asking for?
Did you use an app to set up your a/c initially and to get the network configured? The most common used are one of the 3 listed in the thing after the binding is installed and you either scanned and found the thing or you manually added the thing so in the things drop down you chose cloud provider make sure you choose the correct one same as your preestablished and validated account with that provider is set up for.

Hi,

I tried the mac-zhou example.py with the binding downloaded key/token pair. It not working with authentication error.
Then I tried with a mac-zhou discovered token which is working, I can change the values correctly.
Then I removed the user/pass from the binding and put the key/token from the working example.py.
The thing now online but the errors remain same in my first comment. The items connected to channels can’t updated and all is NULL.

2022-07-21 15:02:29.926 [WARN ] [g.mideaac.internal.security.Security] - AES decryption error: InvalidKeyException: Illegal key size
2022-07-21 15:02:29.927 [ERROR] [st.core.internal.thing.ThingResource] - Exception during HTTP PUT request for update config at 'things/mideaac:ac:5ee0f8d399/config'
...
2022-07-21 15:03:03.679 [DEBUG] [eaac.internal.handler.MideaACHandler] - Handling channelUID operationalMode with command REFRESH
2022-07-21 15:03:03.680 [DEBUG] [ler.MideaACHandler$ConnectionManager] - Writing to mideaac:ac:5ee0f8d399 at 10.0.10.145 bytes.length: 104, bytes: 5A5A01116800200000000000011606150F0303**********
2022-07-21 15:03:03.681 [TRACE] [g.mideaac.internal.security.Security] - Size: 104
2022-07-21 15:03:03.682 [TRACE] [g.mideaac.internal.security.Security] - Padding size: 6, size: 142
2022-07-21 15:03:03.684 [TRACE] [g.mideaac.internal.security.Security] - Header:      8370008E2066
2022-07-21 15:03:03.684 [TRACE] [g.mideaac.internal.security.Security] - Data:        001B5A5A01116800200000000000011606150F0303*******
2022-07-21 15:03:03.684 [TRACE] [g.mideaac.internal.security.Security] - Sign:        F5F8C327D7905A11139E6662E1A********
2022-07-21 15:03:03.685 [ERROR] [ore.common.registry.AbstractRegistry] - Cannot inform the listener "org.openhab.core.thing.internal.ChannelLinkNotifier@2879de7f" about the "ADDED" event: null
java.lang.NullPointerException: null

Hi Jacek, it was just an idea. I tried to figure out what the problem could be, but I couldn’t get any further. I have come to the point that as long as only one device is configured, it works without any problems. As soon as I set up the second device and saved its settings, the previous one stops working. Although the device set as the second device works for a while, it can no longer be controlled after a while. According to tcpdump, there is an error in the communication. Even i set the Openhab log level to TRACE, I did not get any meaningful information. I think i will install a new instance of Openhab from stratch then start playing with it. Anyone else has encountered any similar problem?

Thanks

Normal dump:

10:23:21.440182 eno1 In IP 192.168.2.140.6444 > 192.168.2.200.47852: Flags [.], ack 223, win 2698, length 0
0x0000: 0800 0000 0000 0002 0001 0006 c439 60c1 …9. 0x0010: e738 0000 4500 0028 f5f0 0000 ff06 3f3a .8..E..(......?: 0x0020: c0a8 028c c0a8 02c8 192c baec 24a9 56e2 .........,..$.V. 0x0030: 5b31 9f0e 5010 0a8a d4c1 0000 0000 0000 [1..P........... 0x0040: 0000 .. 10:23:21.907982 eno1 In IP 192.168.2.140.6444 > 192.168.2.200.47852: Flags [P.], seq 73:223, ack 223, win 2698, length 150 0x0000: 0800 0000 0000 0002 0001 0006 c439 60c1 .............9.
0x0010: e738 0000 4500 00be f5f1 0000 ff06 3ea3 .8…E…>.
0x0020: c0a8 028c c0a8 02c8 192c baec 24a9 56e2 …,…$.V.
0x0030: 5b31 9f0e 5018 0a8a 4aa9 0000 8370 008e [1…P…J…p…
0x0040: 2063 25d0 b93f 18cb d69e a280 733b abb8 .c%…?..s;…
0x0050: 27d8 3f69 d5b5 6fdb 1ae0 e04b fd89 a373 '.?i…o…K…s
0x0060: 2524 36f4 9d03 8feb 4679 bf43 edc4 633d %$6…Fy.C…c=
0x0070: dabb 22aa 2e42 9d22 280f b142 2e8c 81c0 …“…B.”(…B…
0x0080: d591 9fd7 9b35 3078 c933 d219 85ab 2276 …50x.3…“v
0x0090: a225 c251 756f 629c 775d ba02 1443 8c82 .%.Quob.w]…C…
0x00a0: 0ed7 5f6e d488 54b7 84d2 95ea 7bcc e4c1 …n…T…{…
0x00b0: eced 825f 9940 4354 aba2 306f 8bd3 4819 …
.@CT…0o…H.
0x00c0: 8735 3342 e7a3 251a 595b 8c61 dbbb b022 .53B…%.Y[.a…”
0x00d0: ff4a .J
10:23:21.908010 eno1 Out IP 192.168.2.200.47852 > 192.168.2.140.6444: Flags [.], ack 223, win 64018, length 0
0x0000: 0800 0000 0000 0002 0001 0406 f8bc 1240 …@
0x0010: a786 0000 4500 0028 f4fe 4000 4006 bf2c …E…(…@.@…,
0x0020: c0a8 02c8 c0a8 028c baec 192c 5b31 9f0e …,[1…
0x0030: 24a9 5778 5010 fa12 86bf 0000 $.WxP…

Problematic dump:

10:24:03.601200 eno1 Out IP 192.168.2.200.47852 > 192.168.2.140.6444: Flags [P.], seq 673:823, ack 673, win 64018, length 150
0x0000: 0800 0000 0000 0002 0001 0406 f8bc 1240 …@
0x0010: a786 0000 4500 00be f505 4000 4006 be8f …E…@.@…
0x0020: c0a8 02c8 c0a8 028c baec 192c 5b31 a0d0 …,[1…
0x0030: 24a9 593a 5018 fa12 8755 0000 8370 008e $.Y:P…U…p…
0x0040: 2066 41c8 bd44 f772 0eec 8000 fbe2 bbdf .fA…D.r…
0x0050: 8aed 7faf 0899 d749 015b 407a 80cc 82b5 …I.[@z
0x0060: df92 9d8d 07e5 b247 d9d6 5cd9 2d22 1cb8 …G….-"…
0x0070: db58 0a9f e7d0 168d 3cfe 1e91 d90c 4d01 .X…<…M.
0x0080: 97fa 04db 7994 33c9 edb4 fd1e 184f 961a …y.3…O…
0x0090: fb99 6c30 807a 260a 69b0 3b02 cef7 cff1 …l0.z&.i.;…
0x00a0: 20d6 2738 6ad7 fab4 b9d7 d912 21c9 2dd9 …'8j…!.-.
0x00b0: 548e eef5 2d43 2468 c49e f92f 6f33 3876 T…-C$h…/o38v
0x00c0: e683 811e b787 f8f6 94ec f41c 7f73 6b18 …sk.
0x00d0: 4038 @8
10:24:03.606545 eno1 In IP 192.168.2.140.6444 > 192.168.2.200.47852: Flags [P.], seq 673:686, ack 823, win 2098, length 13
0x0000: 0800 0000 0000 0002 0001 0006 c439 60c1 …9`.
0x0010: e738 0000 4500 0035 f5fa 0000 ff06 3f23 .8…E…5…?#
0x0020: c0a8 028c c0a8 02c8 192c baec 24a9 593a …,…$.Y:
0x0030: 5b31 a166 5018 0832 450e 0000 8370 0005 [1.fP…2E…p…
0x0040: 200f 0020 4552 524f 52 …ERROR
10:24:03.606587 eno1 Out IP 192.168.2.200.47852 > 192.168.2.140.6444: Flags [.], ack 686, win 64018, length 0
0x0000: 0800 0000 0000 0002 0001 0406 f8bc 1240 …@
0x0010: a786 0000 4500 0028 f506 4000 4006 bf24 …E…(…@.@…$
0x0020: c0a8 02c8 c0a8 028c baec 192c 5b31 a166 …,[1.f
0x0030: 24a9 5947 5010 fa12 86bf 0000 $.YGP…

Hi,

First, generally each device is independant in logic so it should not interfere.

Second, I have 3 devices v2 and it works well.
Which version do you have 2 or 3?

Third, what comes to my mind that if have v3 please check whether openhab device source TCP/IP port is different for each device.

Jacek

Hi, actually i have 7 devices. All devices are v3 and according to tcpdump it seems Openhab uses random/different source ports for all devices. Any idea further idea would be appriciated. Thank You, Zoltan

Log says when i am powering it on, maybe it could help:

> 13:58:09.101 [INFO ] [openhab.event.ItemCommandEvent       ] - Item 'MideaAC192168214042880953498967netacE738_Power                                                                            ' received command ON
> 13:58:09.103 [INFO ] [openhab.event.ItemStatePredictedEvent] - Item 'MideaAC192168214042880953498967netacE738_Power                                                                            ' predicted to become ON
> 13:58:09.104 [INFO ] [openhab.event.ItemStateChangedEvent  ] - Item 'MideaAC192168214042880953498967netacE738_Power                                                                            ' changed from OFF to ON
> 13:58:09.107 [DEBUG] [deaac.internal.handler.MideaACHandler] - Handling channelUID power with command ON
> 13:58:09.108 [DEBUG] [dler.MideaACHandler$ConnectionManager] - Cancelling connection monitor job for mideaac:ac:mid                                                                            eaac__192_168_2_140__42880953498967__net_ac_e738 at 192.168.2.140
> 13:58:09.108 [DEBUG] [dler.MideaACHandler$ConnectionManager] - Writing to mideaac:ac:mideaac__192_168_2_140__428809                                                                            53498967__net_ac_e738 at 192.168.2.140 bytes.length: 104, bytes: 5A5A011168002000000000000116080E0D3A0900573D000000                                                                            270000000000000000000000000000AD2EEE014C481C40D7F9CE501777A08F0F93EC432FE473811B5289D821B436A684FFEE5138BD1860A3EBE                                                                            F4E4A4D65BE1BFD150E1C979306005EFD80CE4589EB
> 13:58:09.122 [DEBUG] [dler.MideaACHandler$ConnectionManager] - Response received length: 13
> 13:58:09.123 [DEBUG] [dler.MideaACHandler$ConnectionManager] - Response bytes: 83700005200F20004552524F52
> 13:58:09.123 [DEBUG] [dler.MideaACHandler$ConnectionManager] - Starting connection monitor job in 10 seconds for mi                                                                            deaac:ac:mideaac__192_168_2_140__42880953498967__net_ac_e738 at 192.168.2.140

And here is the TRACE log (actually it was powered off ):

14:09:55.080 [INFO ] [openhab.event.ItemCommandEvent       ] - Item 'MideaAC192168214042880953498967netacE738_Power' received command OFF
14:09:55.085 [INFO ] [openhab.event.ItemStatePredictedEvent] - Item 'MideaAC192168214042880953498967netacE738_Power' predicted to become OFF
14:09:55.088 [INFO ] [openhab.event.ItemStateChangedEvent  ] - Item 'MideaAC192168214042880953498967netacE738_Power' changed from ON to OFF
14:09:55.089 [DEBUG] [deaac.internal.handler.MideaACHandler] - Handling channelUID power with command OFF
14:09:55.089 [TRACE] [ing.mideaac.internal.handler.Response] - FanSpeed byte: 66
14:09:55.090 [TRACE] [ing.mideaac.internal.handler.Response] - FanSpeed byte masked: 66
14:09:55.090 [TRACE] [ing.mideaac.internal.handler.Response] - FanSpeed value: 102
14:09:55.091 [DEBUG] [dler.MideaACHandler$ConnectionManager] - Cancelling connection monitor job for mideaac:ac:mideaac__192_168_2_140__42880953498967__net_ac_e738 at 192.168.2.140
14:09:55.091 [DEBUG] [dler.MideaACHandler$ConnectionManager] - Writing to mideaac:ac:mideaac__192_168_2_140__42880953498967__net_ac_e738 at 192.168.2.140 bytes.length: 104, bytes: 5A5A011168002000000000000116080E0E093700573D00000027000000000000000000000000000057F565782D018183AC603D7B1FB32E422543B8257D3E418E89A838809B6CEA0CC02C5ADFC00D78882E955D6481393832BFAD38FB71DAF5B3916CFC23099728B5
14:09:55.092 [TRACE] [ng.mideaac.internal.security.Security] - Size: 104
14:09:55.092 [TRACE] [ng.mideaac.internal.security.Security] - Padding size: 6, size: 142
14:09:55.093 [TRACE] [ng.mideaac.internal.security.Security] - Header:      8370008E2066
14:09:55.093 [TRACE] [ng.mideaac.internal.security.Security] - Data:        03025A5A011168002000000000000116080E0E093700573D00000027000000000000000000000000000057F565782D018183AC603D7B1FB32E422543B8257D3E418E89A838809B6CEA0CC02C5ADFC00D78882E955D6481393832BFAD38FB71DAF5B3916CFC23099728B552539EBD8A1C
14:09:55.093 [TRACE] [ng.mideaac.internal.security.Security] - Sign:        4036E18E9DF34D9F1F106D07ADC599E3FF37AED83C7192425C3E73F042DBE876
14:09:55.094 [TRACE] [ng.mideaac.internal.security.Security] - TcpKey:      F1D824C022D1592F12B4485AF8D07628A0C5E96AD7735D7C6AB665C265CF0513
14:09:55.094 [TRACE] [ng.mideaac.internal.security.Security] - EncSignData: 0A45DFE68B6E50C47DEBC836DFBC9347ECF01173453DBFB2F96BD558276600DC1C1D44395B05E5696A9CFEB2F025835AAEB333D428CA1A037E25A3CB027E1EC76E59BCB3D3BBB6E0ABC6C2D6F2F49030648752EA052527C151B6063B0F7CE09A62A224BB59797BFD36A641CD1098ACD94036E18E9DF34D9F1F106D07ADC599E3FF37AED83C7192425C3E73F042DBE876
14:09:55.094 [TRACE] [ng.mideaac.internal.security.Security] - Result:      8370008E20660A45DFE68B6E50C47DEBC836DFBC9347ECF01173453DBFB2F96BD558276600DC1C1D44395B05E5696A9CFEB2F025835AAEB333D428CA1A037E25A3CB027E1EC76E59BCB3D3BBB6E0ABC6C2D6F2F49030648752EA052527C151B6063B0F7CE09A62A224BB59797BFD36A641CD1098ACD94036E18E9DF34D9F1F106D07ADC599E3FF37AED83C7192425C3E73F042DBE876
14:09:55.100 [DEBUG] [dler.MideaACHandler$ConnectionManager] - Response received length: 13
14:09:55.100 [DEBUG] [dler.MideaACHandler$ConnectionManager] - Response bytes: 83700005200F00204552524F52
14:09:55.100 [TRACE] [ng.mideaac.internal.security.Security] - Header:        83700005200F
14:09:55.101 [TRACE] [ng.mideaac.internal.security.Security] - Size: 13
14:09:55.101 [TRACE] [ng.mideaac.internal.security.Security] - Padding: 0
14:09:55.101 [TRACE] [ng.mideaac.internal.security.Security] - MsgType: MSGTYPE_TRANSPARENT
14:09:55.102 [TRACE] [ng.mideaac.internal.security.Security] - Response_count: 32
14:09:55.102 [TRACE] [dler.MideaACHandler$ConnectionManager] - Packet: 83700005200F00204552524F52
14:09:55.102 [DEBUG] [dler.MideaACHandler$ConnectionManager] - Starting connection monitor job in 10 seconds for mideaac:ac:mideaac__192_168_2_140__42880953498967__net_ac_e738 at 192.168.2.140

Good morning everyone, I tried to install the latest official version of this binding. Adding it to OpenHab 3.2.0 was no problem. OpenHab recognizes the binding and after specifying the IP address of my AC unit, I can also get more information. Since my AC unit has already installed version V3, I have to use the Token & Key method. Unfortunately I get the following error message.

2022-09-26 11:03:00.719 [INFO ] [ler.MideaACHandler$ConnectionManager] - Retrieving Token and Key from cloud

2022-09-26 11:03:06.868 [WARN ] [ler.MideaACHandler$ConnectionManager] - Token and Key obtained from cloud, saving, initializing

2022-09-26 11:03:06.873 [INFO ] [ler.MideaACHandler$ConnectionManager] - Connected to mideaac:ac:6h5f8s6d5f at XXX.XXX.XXX.XXX

2022-09-26 11:03:07.277 [WARN ] [ler.MideaACHandler$ConnectionManager] - Authentication reponse unexpected data length (13 instead of 72)!


(Binding Status)

A token and also a key are obtained from Midea Air and displayed… But unfortunately the binding does not start. Has anyone of you had this problem before or can give me a hint what I should do differently?

Do you have only one V3 device? What is the version of the firmware? Zoltan

Hello Zoltan,
Yes I have unfortunately only devices with V3 version, almost 3 months ago they all made an involuntary FW update :(. The firmware on the WLAN sticks which is installed in the indoor units is: V 3.0.8.

I have now also looked at the DEBUG information, but unfortunately this has not helped me.

kind regards

Frank

I have seven devices with 3 different firmwares (1.0.7, 150029082115 and 150029092122 but i have not any device with the mentioned FW. I use a modified plugin because this version did not work for me with multiple devices as the same time. If you want i can share it with you but i am not considered that will solve your problem.

I have also tested to control only one of the indoor units… But also without success. The binding complains that a returning payload is 13 instead of 72… Do you know what exactly this means? Is it possibly only because of the validation of the received data? Everything else that the plugin should do (logging in to the cloud to create the token… reading the device serial number USW… is running well…) I would almost guess that the whole thing fails because of an internal binding validation or am I seeing it wrong?

When plugin calls doAthentication method the code will build a request which is encoded with the token, send to the device then expects a non null and 72 long response. If it is not will throw the mentioned error.

private void doAuthentication() {
            byte[] request = Security.encode_8370(Utils.hexStringToByteArray(config.getToken()),
                    MsgType.MSGTYPE_HANDSHAKE_REQUEST);
            try {
                logger.trace("Device {}@{} writing handshake_request: {}", thing.getUID(), ipAddress,
                        Utils.bytesToHex(request));
                write(request);
                byte[] response = read();
                // logger.trace("Device {}@{} response for handshake_request length: {}", thing.getUID(), ipAddress,
                // response.length);
                if (response != null && response.length > 0) {
                    // logger.trace("Device {}@{} response for handshake_request: {}", thing.getUID(), ipAddress,
                    // Utils.bytesToHex(response));
                    if (response.length == 72) {
                        boolean success = Security.tcp_key(Arrays.copyOfRange(response, 8, 72),
                                Utils.hexStringToByteArray(config.getKey()));
                        if (success) {
                            logger.debug("Authentication successufull");
                            connectionIsAuthenticated = true;
                            try {
                                Thread.sleep(1000);
                            } catch (InterruptedException e) {
                                // TODO Auto-generated catch block
                                e.printStackTrace();
                            }
                            requestStatus(true);
                        } else {
                            logger.debug("Invalid Key. Correct Key in configuration");
                            updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
                                    "Invalid Key. Correct Key in configuration.");
                        }
                    } else if (new String("ERROR").getBytes().equals(response)) {
                        logger.warn("Authentication failed!");
                    } else {
                        logger.warn("Authentication reponse unexpected data length ({} instead of 72)!",
                                response.length);
                        logger.debug("Invalid Token. Correct Token in configuration");
                        updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
                                "Invalid Token. Correct Token in configuration.");
                    }

                }
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }