Simplest Switchbot Command
It tested on Raspberry Pi Zero W with Raspbian Stretch.
$ sudo apt-get install python-pip libglib2.0-dev bluez-tools
$ sudo pip install bluepy
$ sudo hciconfig hci0 down
$ sudo btmgmt le on
$ sudo hciconfig hci0 up
$ wget https://gist.githubusercontent.com/mugifly/a29f34df7de8960d72245fcb124513c7/raw/switchbot-cmd.py
$ chmod u+x switchbot-cmd.py
$ sudo hcitool lescan
$ ./switchbot-cmd.py ff:ff:ff:ff:ff:ff on
$ ./switchbot-cmd.py ff:ff:ff:ff:ff:ff off
$ ./switchbot-cmd.py ff:ff:ff:ff:ff:ff press
Send
5701037804
, where 0x78 = 120s.https://github.com/OpenWonderLabs/python-host/wiki/Bot-BLE-open-API#0x01-execute-an-action