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
I added
open
/close
for curtains here:https://github.com/vogler/smart-home/blob/413ef14068d6d8270cfaac921117d98eec0be69b/switchbot.py#L31-L36