Set a regular timer to SwitchBot.
This program works with python3
- Install required libraries
sudo apt-get update
sudo apt-get install python-pexpect
sudo apt-get install libusb-dev libdbus-1-dev libglib2.0-dev
sudo apt-get install libudev-dev libical-dev libreadline-dev
sudo pip3 install -r requirements.txt
- Identify Mac address of your SwitchBot by SwitchBot app or following commands
# 2.1. show Mac address list (finish by Control+C)
sudo hcitool lescan
# 2.2. Test Mac address (try pushing)
python3 check_address.py <Mac address>
-
Edit set_timer.py and add Mac address and execution interval
-
execute set_timer.py
python3 set_timer.py
- Kill existing task if you want
# Check PID of existing task
ps aux | grep set_timer.py | grep -v grep
# kill
kill <PID>