This is a script for unlocking the auto-lock of an apartment using Switch Bot's Bot.
It triggers when the room's intercom sounds, performs pass-phrase authentication, and presses the unlock button.
It is intended to be used in combination with Auto Unlock Server.
License | |
Environment | |
Technology | |
This repository can be run on the following environment:
Raspberry Pi Zero W
- OS:
Raspbian GNU/Linux 12 (bookworm)
- Kernel:
Linux 6.6.28+rpt-rpi-v6
- Architecture:
armv6l
$ git clone -b v0.2.0 https://github.com/nglcobdai/auto-unlock-app.git
$ cd auto-unlock-app
$ export PYTHONPATH=$PWD
Copy .env.example to .env
$ cp .env{.example,}
You need to edit the following items
Key | Description | Reference |
---|---|---|
AUTO_UNLOCK_API_URL |
Auto Unlock API URL | API endpoint by Auto Unlock Server |
SWITCH_BOT_TOKEN |
Switch Bot Token | Switch Bot |
SWITCH_BOT_SECRET |
Switch Bot Secret | Switch Bot |
UNLOCK_BOT_ID |
Bot ID for Unlock button | Refer to the output of python app/src/switch_bot.py |
$ pip install -r requirements.txt
$ sudo apt-get install jackd2
$ sudo apt-get install libopenjp2-7
$ sudo apt-get install libtiff5
$ sudo apt-get install libatlas-base-dev
$ sudo apt-get install libjasper-dev
$ sudo apt-get install libqtgui4
$ sudo apt-get install libqt4-test
$ python app/main.py