georgezhao2010 / midea_ac_lan

Auto-configure and then control your Midea M-Smart devices (Air conditioner, Fan, Water heater, Washer, etc) via local area network.
MIT License
1.4k stars 231 forks source link

Is it possible to support midea heat pump controller KJRH-120F (device type C3)? #79

Closed Hendrik212 closed 2 years ago

Hendrik212 commented 2 years ago

It is recognized by midea discover as type 'C3': {'name': 'net_c3_0074', 'ssid': 'net_c3_0074', 'ip': '192.168.1.173', 'port': 6444, 'id': '...', 'version': 3, 'token': '...', 'key': '...', 'type': 'c3', 'sn': '0C3310171H120F22214100074WC9N', 'model': 'H120F', 'support': False, 'run_test': True}

It already partially works with your integration when I select type "CF" heat pump. On/Off works but setting the temperature doesn't work, so I guess the attributes are different for type C3.

georgezhao2010 commented 2 years ago

It is recognized by midea discover as type 'C3': {'name': 'net_c3_0074', 'ssid': 'net_c3_0074', 'ip': '192.168.1.173', 'port': 6444, 'id': '...', 'version': 3, 'token': '...', 'key': '...', 'type': 'c3', 'sn': '0C3310171H120F22214100074WC9N', 'model': 'H120F', 'support': False, 'run_test': True}

It already partially works with your integration when I select type "CF" heat pump. On/Off works but setting the temperature doesn't work, so I guess the attributes are different for type C3.

Could you send your username and password of MSmartHome (or NetHome Plus?) to georgezhao75@gmail.com so that to get the protocol plugins for that device.

Hendrik212 commented 2 years ago

Thanks for your help, I'll send you my credentials. I have a relabled midea device by another distributor, so you have to use a different app Comfort Home. But it's essentially a MSmartHome clone and seems to communicate via the midea cloud. So I hope it's sufficient to get the protocol plugins you need. MSmartHome doesn't work because it expects a different ssid "midea_c3_xxxx" instead of "net_c3_xxxx". NetHome Plus doesn't work because it doesn't support the device H120F.

georgezhao2010 commented 2 years ago

Thanks for your help, I'll send you my credentials. I have a relabled midea device by another distributor, so you have to use a different app Comfort Home. But it's essentially a MSmartHome clone and seems to communicate via the midea cloud. So I hope it's sufficient to get the protocol plugins you need. MSmartHome doesn't work because it expects a different ssid "midea_c3_xxxx" instead of "net_c3_xxxx". NetHome Plus doesn't work because it doesn't support the device H120F.

Comfort Home does not work in my Android emulator, I'll find another way.

georgezhao2010 commented 2 years ago

Thanks for your help, I'll send you my credentials. I have a relabled midea device by another distributor, so you have to use a different app Comfort Home. But it's essentially a MSmartHome clone and seems to communicate via the midea cloud. So I hope it's sufficient to get the protocol plugins you need. MSmartHome doesn't work because it expects a different ssid "midea_c3_xxxx" instead of "net_c3_xxxx". NetHome Plus doesn't work because it doesn't support the device H120F.

It's weird, I did't found any device bound to your account, but the captured message says you have a device. Maybe this device does not support Comfort Home for iOS?

20220830015940

20220830015927

{
    "msg": "ok",
    "result": {
        "list": [{
            "registerTime": "",
            "onlineStatus": "1",
            "type": "0xC3",
            "homegroupId": "",
            "userId": "692XXXXX",
            "tsn": "",
            "mac": "",
            "des": "",
            "activeStatus": "1",
            "homegroupCreateUserId": "",
            "wifiVersion": "056XXXXXX",
            "name": "Wärmepumpe",
            "modelNumber": "",
            "homegroupNumber": "",
            "id": "146235XXXXXXXXX",
            "sn": "3813a695541c4bc2162c88a38XXXXXXXXXXXXXXX00c911abd6a47aff31950b0f8e86715e6fc728089f70b5a",
            "userType": "1"
        }]
    },
    "errorCode": "0"
}
Hendrik212 commented 2 years ago

The device should be supported by Comfort Home IOS. In fact this app only supports one device type, C3. However, I also had this "no device" behaviour once on android. Maybe I messed something up in the backend because tried different versions (also downgrade) of the app while experimenting. I'll try to delete the device and pair it again.

Or if the steps are easy to follow maybe I can get you the information you need from the android app?

Hendrik212 commented 2 years ago

Okay, I have now re-paired the device and also changed the name from "Wärmepumpe" to "Heatpump". Maybe the app has problems with German non ascii characters. Hopefully it's now visible in the iOS app.

georgezhao2010 commented 2 years ago

Okay, I have now re-paired the device and also changed the name from "Wärmepumpe" to "Heatpump". Maybe the app has problems with German non ascii characters. Hopefully it's now visible in the iOS app.

Nothing changed, even I can't found any devices in captured message.

20220830182311

Hendrik212 commented 2 years ago

That's weird, the android app works just fine. Can I somehow extract the info you need or are there too many steps?

georgezhao2010 commented 2 years ago

That's weird, the android app works just fine. Can I somehow extract the info you need or are there too many steps?

Comfort Home app control your device via HTTPS, I guess it detects your device model and downloads a protocol plugin for device, just like MSmartHome and NetHome Plus app, I need to find out the download-url of plugin. Maybe you need to capture the app's message if you can.

Hendrik212 commented 2 years ago

I managed to decrypt the traffic, is this the url you are looking for? image

https://hbtapp-prod.midea.com/pluginInfo/download?appVersion=2.0.0&appClientType=android&deviceType=0xC3&deviceSn8=171H120F

georgezhao2010 commented 2 years ago

I managed to decrypt the traffic, is this the url you are looking for? image

https://hbtapp-prod.midea.com/pluginInfo/download?appVersion=2.0.0&appClientType=android&deviceType=0xC3&deviceSn8=171H120F

Great!

I'll have a look at that and see what I can do.

TBomek commented 2 years ago

Hello, I have the same heat pump model : H120F. I was able to install the integration. Unfortunately, it does not read the heat pump correctly. Has anything changed in the topic?

2022-09-03 15:24:50.770 DEBUG (PC Midea) [custom_components.midea_ac_lan.midea.core.device] [1] Status update: {'available': False} 2022-09-03 15:24:55.837 DEBUG (PC Midea) [custom_components.midea_ac_lan.midea.core.device] [1] Connected 2022-09-03 15:24:55.838 DEBUG (PC Midea) [custom_components.midea_ac_lan.midea.core.device] [1] Handshaking 2022-09-03 15:24:55.914 DEBUG (PC Midea) [custom_components.midea_ac_lan.midea.core.device] [1] Authentication success 2022-09-03 15:24:55.915 DEBUG (PC Midea) [custom_components.midea_ac_lan.midea.core.device] [1] Sending: {'header': 'aa1dcf000000000000a0', 'body': '00000000000000000000000000000000000000', 'message type': 'a0', 'body type': 'None'} 2022-09-03 15:25:05.931 DEBUG (PC Midea) [custom_components.midea_ac_lan.midea.core.device] [1] Sending: {'header': 'aa0bcf00000000000003', 'body': '01', 'message type': '03', 'body type': '01'} 2022-09-03 15:25:15.948 DEBUG (PC Midea) [custom_components.midea_ac_lan.midea.core.device] [1] Does not supports the protocol MessageQuery, ignored 2022-09-03 15:25:15.949 DEBUG (PC Midea) [custom_components.midea_ac_lan.midea.core.device] [1] Refresh status is timed out

georgezhao2010 commented 2 years ago

Supported in v0.3.15