syssi / xiaomiplug

Xiaomi Mi Smart WiFi Socket integration for Home Assistant
Apache License 2.0
107 stars 26 forks source link

Xiaomi Chuangmi Plug V3 support #10

Closed cxlwill closed 6 years ago

cxlwill commented 6 years ago

Yesterday Xiaomi just launched a new version of Smart Plug with 2-slot USB. No English page yet. My friend got one and here's the feedback:

'get_power', []
'get_prop', ["on","usb_on","temperature","wifi_led"]
'set_power', ["off"]
'set_usb_on', []
'set_wifi_led', ['on']

chuangmi I think basic logic is the same as first generation. HA component is under test.

syssi commented 6 years ago

Could you provide the output of the "mirobo info" command? I would like to know the model name.

syssi commented 6 years ago

The python-miio call looks like this:

self.send("miIO.info", [])
cxlwill commented 6 years ago

The model name is chuangmi.plug.v3. mirobo info output is:

['fw_ver']:'1.3.0_92'
['hw_ver']:'ESP8266'
['uid']:'25180012'
['model']:'chuangmi.plug.v3'
['wifi_fw_ver']:'1.5.0-dev(7f7a714)'
syssi commented 6 years ago

Could you try to request these properties just for testing:

mirobo raw_command get_prop "['power', 'temperature', 'current', 'mode',  'power_consume_rate', 'wifi_led', 'power_price']"
syssi commented 6 years ago

I've implemented a basic device support: https://github.com/rytilahti/python-miio/pull/257

syssi commented 6 years ago

As far as python-miio 0.3.8 is released I will extend this component. Thanks for your support!

cxlwill commented 6 years ago

Output:

device.send('get_prop', ['power', 'temperature', 'current', 'mode', 'power_consume_rate', 'wifi_led', 'power_price'])
['on', 34, None, None, None, 'on', None]`

Thanks for miio and component update~~

syssi commented 6 years ago

@cxlwill I would be happy if your friend could test the updated custom component! Thanks in advance!

cxlwill commented 6 years ago

Although you close this issue, here's the feedback: it works like a charm~ Thanks