python-miio icon indicating copy to clipboard operation
python-miio copied to clipboard

chuangmi.plug.212a01

Open hzh-hzh opened this issue 3 years ago • 5 comments

Before submitting a new request, use the search to see if there is an existing issue for the device.

Device information:

  • Name(s) of the device: 小米智能插座蓝牙网关版

  • Link: https://www.mi.com/buy/detail?product_id=12777

Use miiocli device --ip <ip address> --token <token>.

Model: chuangmi.plug.212a01 Hardware version: esp32 Firmware version: 2.1.8_0028

Additional context Currently only the plug with this model can be purchased in Mi Mall, also other online store. So please help add it into the support list, thanks.

hzh-hzh avatar Sep 05 '21 11:09 hzh-hzh

upupup, the same issue

3cobblers avatar Mar 04 '22 09:03 3cobblers

upupup, the same issue !!!

Gerald-Rowe avatar Apr 19 '22 08:04 Gerald-Rowe

Since the old version of the plug cannot be bought now, and this is all available in the market, please help support this product

Gerald-Rowe avatar Apr 19 '22 08:04 Gerald-Rowe

class Plug: """ 程序控制小米蓝牙插座 https://www.mi.com/buy/detail?product_id=12777

1. 使用米家添加蓝牙插座
2. 使用 https://github.com/PiotrMachowski/Xiaomi-cloud-tokens-extractor.git 获取到蓝牙插座的ip和token
"""

def __init__(self, ip, token):
    self.device = Device(ip, token, model='chuangmi.plug.212a01')

def status(self):
    reply = self.device.send(command='get_properties', parameters=[{'did': 'MYDID', 'siid': 2, 'piid': 1}])
    if 'value' in reply[0]:
        return reply[0]['value']
    else:
        return False

def power(self, on: bool):
    self.device.send(command='set_properties', parameters=[{'did': 'MYDID', 'siid': 2, 'piid': 1, 'value': on}])

luokui-c12 avatar Jun 03 '22 01:06 luokui-c12

我用这个方式解决了这个问题,希望对各位兄弟有帮助

luokui-c12 avatar Jun 03 '22 01:06 luokui-c12

miiocli -d device --ip 192.1xxxx144 --token bc8b4fexxxxaef46cc66c0 raw_command set_properties "[{'did': 'power', 'siid': 2, 'piid': 1, 'value':False}]"

fanlushuai avatar Mar 02 '23 12:03 fanlushuai