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
Hey thanks for this.
I want to ask you is it possible to add the press function for some duration? So with the press command but hold it for 2 minutes before it returns to it normal position?