New OH3 Binding - Midea Air Conditioning (LAN)

Has anyone communicated with the heat pump using this plug (Rotenso Aquami multisplit, but it’s identical to Midea)? When I search for devices using Autoscan, I find my device and I can add it, I download KEY and Token from NetHome Plus provider. Instance goes Online but immediately switches to Offline and reports “COMMUNICATION_ERROR. Device not responding with its status.”
Appliance type “C3” version 3. Communication via NetHome Plus works properly. My air conditioning communicates via this plug without problems. I use OH v3.3.0 and MideaAC LAN v3.3.0.202205311943.

Hi @zulus,
The current version of this binding is based on python script which sets a limitation of only supporting device that return a type of ac if your device is returning C3 as the type it will not work with this current version of the code base. You may be able to crack open the jar and add the correct byte value for C3 as a valid type to return but no one that has worked in this code had a heat pump to test the code with that kind of device.

Hi,
With the NetHome Plus and only one V3 device, it is not possible to get the right Token…
I’ll always receive
Authentication reponse unexpected data length (13 instead of 72)!
Invalid Token. Correct Token in configuration
regards,
Walter

Is anyone also having problem with the outdoor temperature? Its always showing -25 C or 102.5 C?

@zdanhauser
I got the same issues running 2 V3 devices.
I would be verry happy, if you could explain to me, what exactly I have to change on my running binding.
Thanks in advance.

It is not uncommon at all that I receive this kind of messages in the log after sending some item changes:

13:06:25.304 [WARN ] [dler.MideaACHandler$ConnectionManager] - Error processing response: null
13:06:35.310 [WARN ] [ng.mideaac.internal.security.Security] - Not an 8370 message
13:07:37.707 [WARN ] [ng.mideaac.internal.security.Security] - Sign does not match

What do that mean?

Circumstances:

  • Mac OS X 10.13.6, Java 11.0.16, Karaf 4.3.7
  • 4 pieces os version 3 Midea Air Conditioners (Firmware: 150029092122 x 3 and 150029082115 x 1)
  • All four things are online.
  • Using @zdanhauser 's widget (Thanks a lot)

Issue:
Most of the times the Air Conditioner does not turn on or turn off, but the UI changes (“preticted to become” ?). Same with all the other channels. For example the indoorTemperature sometimes updated, but not stable at all. (Sometimes OH receives the old value back from the AC and chanhes back to UI. Sometimes not. Sometimes Indoortemperature of one of the ACs begins to send temperature data.

Possible other/related reason:
UI throws java.util.concurrent.TimeoutException every few seconds with a bunch of [org.eclipse.jetty.util.Scanner ] - scan accepted debug lines. Again and again.
See: Does this debug log entry look correct? (appears every few seconds) - #2 by borazslo

Hi there! Some months ago I looked through the code and found a lot of variables defined in the wrong place. Then I compiled my own plugin and sent the modified source and all my suggessions to Jacek. Mine works fine since then.

Is there a link to the PR for these modifications?

I’ve published @zdanhauser 's new code on github. (I know that it should be PR sometime.) (Tested on OH 3.4.0, with 4 pieces of MideaAC v3, firmware 150029092122 )

@SmartHomeFriend , @liko : Please try that out.

@Vanja_Vrsic: I have the some problem. It can be related to the frequent changing of data.length of the response.

Hi,

For me it always resets itself to default value (unkown mode, 16° target temp, etc) the original and zdanhauser version as well.
I use a Fisher AC, which is the same as Midea Oasis Plus, it is working with msmarthome app.

With JacekDob version:
2023-01-16 21:16:22.256 [WARN ] [ler.MideaACHandler$ConnectionManager] - Error processing response: null
2023-01-16 21:16:22.257 [WARN ] [ler.MideaACHandler$ConnectionManager] - Error processing response: null
2023-01-16 21:16:32.258 [WARN ] [g.mideaac.internal.security.Security] - Not an 8370 message
2023-01-16 21:16:32.286 [WARN ] [g.mideaac.internal.security.Security] - Not an 8370 message

With zdanhauser version:
2023-01-16 21:27:32.271 [ERROR] [ler.MideaACHandler$ConnectionManager] - Response data is 26 long instead of 25!
2023-01-16 21:27:42.412 [ERROR] [ler.MideaACHandler$ConnectionManager] - Response data is 26 long instead of 25!
2023-01-16 21:27:52.552 [ERROR] [ler.MideaACHandler$ConnectionManager] - Response data is 26 long instead of 25!

For humidifier I use midea-beautiful-air, I will try to use that with my AC. At least I can set target temp with that.

(btw lof of hungarian guys here :slight_smile:)

I’ve experinced this issue. With zdanhauser’s version usually it resets to default value after switching on / off, but not always. And I can change the tartget temp, etc. after these resets. It is the problem of the data processor script. That script demands data of length 25, but it is very common to receive other lengths. :frowning: zdanhauser’s version tries to process the too long/short messages as well (after the error message), but makes mistakes.

Please check (and show us) the detailed log with: log:set TRACE org.openhab.binding.mideaac

Sorry, I removed the binding, because I started to work with the same items but values come from python script.

It seems ok with midea-beautiful-air, just slow, because of this.

Thanks, it works for me bro! Did try the new version, the reported logs are changed.

Got the new version installed, and it can see and talk to the unit. But I can’t reliably control it. Pulling the logs shows “Response data is 26 long instead of 25!” Related log entries: 2023-02-05 11:36:52.390 [TRACE] [ler.MideaACHandler$ConnectionManager] - Perform - Pastebin.com

Hey there,

I’ve successfully installed my air conditioning, → thanks for the python script → I’ve had to manually check the token and key (they were wrong at first)

I’ve noticed, that my humidifier is also discovered from the python script.
Is there an option to add those devices too?
I’ve already tried, but since there is no token and key delivered it’s not possible at the moment for me.
I think the binding is “just” for the air conditioning and cant be used differently for midea humidifier.

Release 3.4.1_202301081451 based on @zdanhauser’s code is not working for me. Seems to be related to the used locale. Mine is set to ‘de_AT’.
Release 3.3.0_202205312143 by @JacekDob does not have this issue.

Trace:

openhab.log-2023-02-18 01:29:47.640 [TRACE] [ng.mideaac.internal.handler.Response] - NaturalFan: false
openhab.log-2023-02-18 01:29:47.640 [TRACE] [ng.mideaac.internal.handler.Response] - IndoorTemperature: 24.0
openhab.log-2023-02-18 01:29:47.640 [TRACE] [ng.mideaac.internal.handler.Response] - OutdoorTemperature: 6.5
openhab.log-2023-02-18 01:29:47.640 [TRACE] [ng.mideaac.internal.handler.Response] - Humidity: 0
openhab.log-2023-02-18 01:29:47.641 [TRACE] [ng.mideaac.internal.handler.Response] - FanSpeed byte: 66
openhab.log-2023-02-18 01:29:47.641 [TRACE] [ng.mideaac.internal.handler.Response] - FanSpeed byte masked: 66
openhab.log-2023-02-18 01:29:47.641 [TRACE] [ng.mideaac.internal.handler.Response] - FanSpeed value: 102
openhab.log-2023-02-18 01:29:47.641 [TRACE] [ng.mideaac.internal.handler.Response] - SwingMode byte: 00
openhab.log-2023-02-18 01:29:47.641 [TRACE] [ng.mideaac.internal.handler.Response] - SwingMode byte masked: 00
openhab.log-2023-02-18 01:29:47.641 [TRACE] [ng.mideaac.internal.handler.Response] - SwingMode value: 0
openhab.log:2023-02-18 01:29:47.642 [WARN ] [ler.MideaACHandler$ConnectionManager] - Error processing response: For input string: "24,0"

I had the same problem. Tried NetHome Plus and MSmartHome.
I worked around the issue by getting the token using the GitHub - nbogojevic/midea-beautiful-air: Python client for accessing Midea air conditioners and dehumidifiers (Midea, Comfee, Inventor EVO) via local network library.

Short howto:

  1. Make sure you have python3.8 or newer installed and active. Won’t work with older versions.

  2. Install the library:

pip install --upgrade midea-beautiful-air
  1. Get the token and the key:
midea-beautiful-air-cli --no-redact discover --account '<e-mail>' --password '<password>' --address <ip-address of the ac> --credentials

–address should be optional, if the ac is in the same subnet as the computer you run this command on.

  1. Copy/paste the token and the key into the thing configuration.

is there any fix to get this binding working with OH4 ?

2023-02-24 14:24:04.490 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'Midea.items'
2023-02-24 14:24:43.624 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'mideaac:ac:mideaac__192_168_1_52__16492674433370__net_ac_c018' changed from UNINITIALIZED (NOT_YET_READY) to INITIALIZING
2023-02-24 14:24:43.638 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'mideaac:ac:mideaac__192_168_1_52__16492674433370__net_ac_c018' changed from INITIALIZING to UNKNOWN
2023-02-24 14:24:43.744 [INFO ] [ler.MideaACHandler$ConnectionManager] - Connected to mideaac:ac:mideaac__192_168_1_52__16492674433370__net_ac_c018 at 192.168.1.52
2023-02-24 14:24:43.745 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'mideaac:ac:mideaac__192_168_1_52__16492674433370__net_ac_c018' changed from UNKNOWN to ONLINE
2023-02-24 14:24:46.086 [ERROR] [mideaac.internal.handler.CommandBase] - SSWING id 0
2023-02-24 14:24:46.088 [ERROR] [mideaac.internal.handler.CommandBase] - SSWING id 0
2023-02-24 14:24:46.089 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.initialize()' on 'org.openhab.binding.mideaac.internal.handler.MideaACHandler@29d34959': 'void org.openhab.core.library.types.DecimalType.<init>(long)'
	at org.openhab.binding.mideaac.internal.handler.MideaACHandler$ConnectionManager.processMessage(MideaACHandler.java:1024) ~[?:?]
	at org.openhab.binding.mideaac.internal.handler.MideaACHandler$ConnectionManager.sendCommand(MideaACHandler.java:943) ~[?:?]
	at org.openhab.binding.mideaac.internal.handler.MideaACHandler$ConnectionManager.sendCommandAndMonitor(MideaACHandler.java:871) ~[?:?]
	at org.openhab.binding.mideaac.internal.handler.MideaACHandler$ConnectionManager.requestStatus(MideaACHandler.java:863) ~[?:?]
	at org.openhab.binding.mideaac.internal.handler.MideaACHandler$ConnectionManager.connect(MideaACHandler.java:729) ~[?:?]
	at org.openhab.binding.mideaac.internal.handler.MideaACHandler.initialize(MideaACHandler.java:514) ~[?:?]
2023-02-24 14:24:46.091 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'mideaac:ac:mideaac__192_168_1_52__16492674433370__net_ac_c018' changed from ONLINE to UNINITIALIZED (HANDLER_INITIALIZING_ERROR): 'void org.openhab.core.library.types.DecimalType.<init>(long)'
2023-02-24 14:24:46.091 [ERROR] [core.thing.internal.ThingManagerImpl] - Exception occurred while initializing handler of thing 'mideaac:ac:mideaac__192_168_1_52__16492674433370__net_ac_c018': 'void org.openhab.core.library.types.DecimalType.<init>(long)'
	at org.openhab.binding.mideaac.internal.handler.MideaACHandler$ConnectionManager.processMessage(MideaACHandler.java:1024) ~[?:?]
	at org.openhab.binding.mideaac.internal.handler.MideaACHandler$ConnectionManager.sendCommand(MideaACHandler.java:943) ~[?:?]
	at org.openhab.binding.mideaac.internal.handler.MideaACHandler$ConnectionManager.sendCommandAndMonitor(MideaACHandler.java:871) ~[?:?]
	at org.openhab.binding.mideaac.internal.handler.MideaACHandler$ConnectionManager.requestStatus(MideaACHandler.java:863) ~[?:?]
	at org.openhab.binding.mideaac.internal.handler.MideaACHandler$ConnectionManager.connect(MideaACHandler.java:729) ~[?:?]
	at org.openhab.binding.mideaac.internal.handler.MideaACHandler.initialize(MideaACHandler.java:514) ~[?:?]

Status:
UNINITIALIZED
HANDLER_INITIALIZING_ERROR
‘void org.openhab.core.library.types.DecimalType.(long)’

thanks
Thomas

1 Like

This is awesome. Installed version 3.4.1 from borazslo. This one works much quicker. Power on/off trigger immediately. 3.3.0 did not work everytime.

Were you able to fix that data length issue

ler.MideaACHandler$ConnectionManager] - Response data is 21 long instead of 25!

I am on openhab 3.4.1

Keep up the good work

Your binding works well, sometimes it doesn’t respond the first time something is pressed in the BasicUI, but a second time it usually will, though I do get a heap of the response data errors.

2023-04-29 16:09:32.609 [ERROR] [ler.MideaACHandler$ConnectionManager] - Response data is 26 long instead of 25!
2023-04-29 16:10:03.064 [ERROR] [ler.MideaACHandler$ConnectionManager] - Response data is 35 long instead of 25!
2023-04-29 16:10:03.065 [ERROR] [ler.MideaACHandler$ConnectionManager] - Response data is 35 long instead of 25!
2023-04-29 16:11:02.084 [ERROR] [ler.MideaACHandler$ConnectionManager] - Response data is 26 long instead of 25!
2023-04-29 16:11:32.085 [ERROR] [ler.MideaACHandler$ConnectionManager] - Response data is 26 long instead of 25!
2023-04-29 16:11:52.445 [ERROR] [ler.MideaACHandler$ConnectionManager] - Response data is 35 long instead of 25!
2023-04-29 16:11:52.447 [ERROR] [ler.MideaACHandler$ConnectionManager] - Response data is 35 long instead of 25!
2023-04-29 16:12:36.763 [ERROR] [ler.MideaACHandler$ConnectionManager] - Response data is 26 long instead of 25!
2023-04-29 16:13:07.193 [ERROR] [ler.MideaACHandler$ConnectionManager] - Response data is 26 long instead of 25!
2023-04-29 16:13:07.195 [ERROR] [ler.MideaACHandler$ConnectionManager] - Response data is 35 long instead of 25!
2023-04-29 16:13:07.196 [ERROR] [ler.MideaACHandler$ConnectionManager] - Response data is 35 long instead of 25!
2023-04-29 16:13:50.888 [ERROR] [ler.MideaACHandler$ConnectionManager] - Response data is 26 long instead of 25!

I’ve set the log level for it now to “Fatal” to stop my logs from filling up with them, although I did generate a Trace log that I can send to you if you’d like if it would help to debug what’s causing it.

Thanks!