Control a Lockitron unit from a Bash command line.
- curl
- jq
- hcitool (Optional)
git clone https://github.com/zerodivide1/lockitron-bash.gitcd lockitron-bashchmod u+x lockitron.sh- Create a configuration file at
$HOME/.configcalledlockitronwith the following contents, replacingxxxxxwith your OAuth access token for your Lockitron account (visit Lockitron's API page for more info):ACCESS_TOKEN=xxxxx ./lockitron-bash.sh listto retrieve the names of your Lockitrons.
The following commands can be used:
list- Retrieves the names of current Lockitron units associated with your accountstatus <unit name>- Retrieves the current status of the given Lockitron unitlock <unit name>- Issues a lock command to the given Lockitron (will return when the operation has completed)lock <unit name> immed- Issues a lock command to the given Lockitron immediately (requires the command to be run as root and requires the Lockitron to be within range of a connected Bluetooth 4.0 w/BLE device)unlock <unit name>- Issues an unlock command to the given Lockitron (will return when the operation has completed)unlock <unit name> immed- Issues a unlock command to the given Lockitron immediately (requires the command to be run as root and requires the Lockitron to be within range of a connected Bluetooth 4.0 w/BLE device)firmware <unit name>- Issues a command to update the AVR and BLE firmware of the given Lockitron unit
Pull requests always welcome! You can also hit me up on Twitter @zero_divide_1.
If you would like to support the lockitron-bash project monetarily, you can send Bitcoin donations here: 1Gc3uHo3mJ7LUwJ1rZp6x3dSuRurC49mL4
See LICENSE for more information.