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 App.
License | |
Environment | |
Technology | |
-
Docker and docker-compose are required. The versions are as follows.
Docker
:v26.0.2
Docker Compose
:v2.22.0
-
CUDA is required.
-
Whisper model is used. Please refer to the official github for the device requirements.
$ git clone -b v1.1.0 https://github.com/nglcobdai/auto-unlock-server.git
$ cd auto-unlock-server
$ cp .env.example .env.prod
You need to edit the following items
Key | Description | Reference |
---|---|---|
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 server/src/switch_bot.py |
CALL_BOT_ID |
Bot ID for Call button | Refer to the output of python server/src/switch_bot.py |
MONGODB_USER_NAME |
MongoDB User Name | Any value can be set |
MONGODB_USER_PWD |
MongoDB User Password | Any value can be set |
DATADRIVE |
Data Drive | MongoDB information storage directory |
SECRET_PHRASE |
Secret Phrase | Set any password to unlock |
$ docker-compose -f docker-compose.prod.yml --env-file .env.prod up --build -d
$ docker exec -it auto-unlock-server-prod-1 uvicorn server.main:server --host 0.0.0.0 --port 8000
Open other terminal and move to the project directory.
$ cd auto-unlock-server
$ curl --noproxy 127.0.0.1 -X POST http://127.0.0.1:8000/v1.1/unlock
$ curl --noproxy 127.0.0.1 -X POST -F "file=@./sample/test.wav" http://127.0.0.1:8000/v1.1/unlock