Closed jianyun8023 closed 3 years ago
Hi,
I am wondering myself how this actually works that outlets can be air conditioners?š
Anyway, yes adding support for the device should be straight forward, the only thing which we will need to find out if this is actually a miio or miot device. From the issue you linked I saw that they use miio commands. When you right now add the device when you try to use the switch, does it actually do anything? Could you post debug log when you use the switch so we can check out if the device accepts the command?
If the device does not accept miot commands locally then I can use the MiCloud to make it work. So we just need to figure out if the device can be controlled locally using miot or if it requires MiCloud...
The air conditioner on the socket, I researched some time ago, it should be a miot device.
The following is the desensitization log of homebridge: hb.log
What i can see from the log is that the property fetch call times out and this is a strong indicator that the device is not a miot device. Older devices use the old miio protocol but xiaomi built in a translator in the cloud to convert the miot commands from the specs which you posted here to local miio commands. So yes, i can add support for the device but it will require a MiCloud connection. You can also already check out now if the device will work with MiCloud by adding the following lines to your device config in the config.json:
"micloud":
{
"username": "email",
"password": "pwd",
"country": "cn",
"forceMiCloud": true
},
Add your username and password and also the cloud country where your devices are located. That should make the device successfully sync the power property. Let me know if that is the case, and then i will add it.
@merdok Thanks for your help~ I use micloud to successfully control the power switch.
[7/2/2021, 12:36:20 AM] [miot] [lumi.acpartner.mcn02] Splitting properties into chunks. Number of chunks: 1. Chunk size: 14
[7/2/2021, 12:36:20 AM] [miot] [lumi.acpartner.mcn02] Chunks: [
[
"power"
]
]
[7/2/2021, 12:36:20 AM] [miot] [lumi.acpartner.mcn02] MiCloud request https://api.io.mi.com/app/miotspec/prop/get - {"_nonce":"oFnyPHZXxsIBnUyE","data":"{\"params\":[{\"did\":\"333641900\",\"siid\":2,\"piid\":1}]}","signature":"Sg+tJCHFHghc/v4MAw5b+PmXf8in3bV5850z+3/2MBA="}
[7/2/2021, 12:36:20 AM] [miot] [lumi.acpartner.mcn02] Device properties updated:
[
{
"name": "power",
"value": true
}
]
[7/2/2021, 12:38:01 AM] [miot] [lumi.acpartner.mcn02] Set power property request! RAW: {"did":"333641900","siid":2,"piid":1,"value":false}
[7/2/2021, 12:38:01 AM] [miot] [lumi.acpartner.mcn02] MiCloud request https://api.io.mi.com/app/miotspec/prop/set - {"_nonce":"fksI9hG/ZPsBnUyG","data":"{\"params\":[{\"did\":\"333641900\",\"siid\":2,\"piid\":1,\"value\":false}]}","signature":"ja9ky0UA/1LBaw0TFzb6iZYspc/9OyxrTl1XaCtDDYE="}
[7/2/2021, 12:38:01 AM] [miot] [lumi.acpartner.mcn02] Successfully set property power to value false! Response: [{"did":"333641900","siid":2,"piid":1,"code":0}]
[7/2/2021, 12:38:02 AM] [miot] [lumi.acpartner.mcn02] Set power property request! RAW: {"did":"333641900","siid":2,"piid":1,"value":true}
[7/2/2021, 12:38:02 AM] [miot] [lumi.acpartner.mcn02] MiCloud request https://api.io.mi.com/app/miotspec/prop/set - {"_nonce":"M2r43PuZa+MBnUyG","data":"{\"params\":[{\"did\":\"333641900\",\"siid\":2,\"piid\":1,\"value\":true}]}","signature":"F435MotsgSn+t/+VryCDV9bgz5QpS6y/PwSuS6W+wxo="}
[7/2/2021, 12:38:02 AM] [miot] [lumi.acpartner.mcn02] Successfully set property power to value true! Response: [{"did":"333641900","siid":2,"piid":1,"code":0}]
Perfect! So as expected this is a miio device. I will add full support for it in the next update! Will let you know when the update is ready!
@merdok Wow, thatās great~ Thank you very much.
Version 0.9.7 is now online with support for the device. Please try it and let me know!
Hi,
Works great. However, when trying to tap and hold the tile in the Home app, it defaults to OFF thus turning it back off everytime I wanted to adjust the temperature. Also, the temperature meter stated 0.0 all the time.
Here's the log on the dashboard:
[18/07/2021, 10:26:53] [homebridge-miot] [Aircond] Poll failed 4 times in a row! Stopping polling and trying to reconnect!
(node:11151) UnhandledPromiseRejectionWarning: TypeError: this.getDevice(...).supportsSwingModes is not a function
at AirConditionerAccessory.updateDeviceStatus (/usr/local/lib/node_modules/homebridge-miot/lib/modules/airconditioner/AirConditionerAccessory.js:245:56)
at LumiAcpartnerMcn02.--unhandled-rejections=strict
(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 27)
[18/07/2021, 10:26:53] [homebridge-miot] [Aircond] Connected to device: lumi.acpartner.mcn02
[18/07/2021, 10:26:53] [homebridge-miot] [Aircond] Setting up device!
[18/07/2021, 10:26:53] [homebridge-miot] [Aircond] Doing device specific setup
[18/07/2021, 10:26:53] [homebridge-miot] [Aircond] Device requires MiCloud! Trying to connect!
[18/07/2021, 10:26:53] [homebridge-miot] [Aircond] Successfully connected to MiCloud!
[18/07/2021, 10:26:53] [homebridge-miot] [Aircond] Doing initial property fetch
[18/07/2021, 10:26:53] [homebridge-miot] [Aircond] Device setup finished! Device ready, you can now control your device!
[18/07/2021, 10:27:14] [homebridge-miot] [Aircond] Poll failed 4 times in a row! Stopping polling and trying to reconnect!
(node:11151) UnhandledPromiseRejectionWarning: TypeError: this.getDevice(...).supportsSwingModes is not a function
at AirConditionerAccessory.updateDeviceStatus (/usr/local/lib/node_modules/homebridge-miot/lib/modules/airconditioner/AirConditionerAccessory.js:245:56)
at LumiAcpartnerMcn02.--unhandled-rejections=strict
(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 28)
[18/07/2021, 10:27:14] [homebridge-miot] [Aircond] Connected to device: lumi.acpartner.mcn02
[18/07/2021, 10:27:14] [homebridge-miot] [Aircond] Setting up device!
[18/07/2021, 10:27:14] [homebridge-miot] [Aircond] Doing device specific setup
[18/07/2021, 10:27:14] [homebridge-miot] [Aircond] Device requires MiCloud! Trying to connect!
[18/07/2021, 10:27:15] [homebridge-miot] [Aircond] Successfully connected to MiCloud!
[18/07/2021, 10:27:15] [homebridge-miot] [Aircond] Doing initial property fetch
[18/07/2021, 10:27:15] [homebridge-miot] [Aircond] Device setup finished! Device ready, you can now control your device!
I think you do not have the latest version of the plugin hece there is the the error in the console. Please update to the latest version.
The temperature will be reported as 0.0 by the accessory since the device does not support temperature reporting
Hi,
Appreciate your response. The plugin runs on the latest version tho, which is 0.9.7.
As for the temperature report, maybe if it could follow the temperature we manually adjust in the tile? Iām using a separate āMi Heatercoolerā plugin for the the old version of Mi Air Conditioner Controller and it does that.
Ah, you are right, it will be fixed in the next update. Also after the update the tile will show the temperature which you set.
Thank you! You're awesome!
Should now be fixed in version 0.9.8
Hi,
I can confirmed that its fixed now. Works really well. Thank you!
Hello,
Would it be possible to add support for the Mi Air Conditioner Companion MCN?
Model:
lumi.acpartner.mcn02
SKU:KTBL03LM
Link: https://www.mi.com/buy/detail?product_id=9726When setup in the plugin, it seems to connect successfully and is seen as a switch, but there are no additional controls. I see that python-miio has his support, you can refer to python-miio#809. If there is anything I can provide (logs, testing, etc.), I would be happy to help the best I can.