rytilahti / python-miio

Python library & console tool for controlling Xiaomi smart appliances
https://python-miio.readthedocs.io
GNU General Public License v3.0
3.83k stars 563 forks source link

Add support for lumi.acpartner.mcn02 please? #637

Closed ihaettypo closed 4 years ago

ihaettypo commented 4 years ago

The most affordable Xiaomi AC Companion right now. Please add support thanks.

tcwj2008 commented 4 years ago

@rytilahti I have this device, is there anything that I can do

wzhd commented 4 years ago

Mine just arrived and I did a little packet capturing.

It first did an HTTP request:

GET /gslb?dm=ots.io.mi.com HTTP/1.1 Host: dns.io.mi.com User-Agent: MIoT

The User-Agent is particularly concerning. The reply contains just a few IPs:

{"info":{"host_list":[{"ip":"\","port":443},{"ip":"\","port":443},{"ip":"\","port":443}],"enable":1},"sign":\","timestamp":"1580070784"}

The rest are mostly TLSv1.2 communications with one of the returned IPs. The server name is Mijia Cloud.

image

It did send some UDP packets from source port 54321 to dest port 8053.

I wonder whether it's a miot device.

rytilahti commented 4 years ago

If you can obtain the token, you could try to execute miot_info command to see how is it responding. If it is a miot device, it will (hopefully) respond to that call.

The miot support is still WIP and there are a couple of PRs where the work is being done, but if it's a miot device, we can use the description files to help adding a preliminary support for that device. Otherwise it will require deciphering that udp device communication (which can be useful anycase, as the description files are not always complete).

rezmus commented 4 years ago

it's miio device

https://cdn.cnbj1.fds.api.mi-img.com/rn-plugins/2019-12-26/signed_10032_1000741_15_ANDROID_bundle_6f61e13511ab120a80f23e852aba4d8a.zip

tcwj2008 commented 4 years ago

execute miiocli device info, respond this

Model: lumi.acpartner.mcn02 Hardware version: esp32 Firmware version: 2.0.8_0002 Network: {'localIp': '192.168.1.111', 'mask': '255.255.255.0', 'gw': '192.168.1.1'} AP: {'ssid': 'mywifi', 'bssid': '11:22:33:44:55:66', 'rssi': -56, 'primary': 1}