python-miio
python-miio copied to clipboard
chuangmi.plug.212a01
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.
upupup, the same issue
upupup, the same issue !!!
Since the old version of the plug cannot be bought now, and this is all available in the market, please help support this product
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}])
我用这个方式解决了这个问题,希望对各位兄弟有帮助
miiocli -d device --ip 192.1xxxx144 --token bc8b4fexxxxaef46cc66c0 raw_command set_properties "[{'did': 'power', 'siid': 2, 'piid': 1, 'value':False}]"