Skip to content

This is a app script for unlocking the auto-lock of an apartment using Switch Bot's Bot.

License

Notifications You must be signed in to change notification settings

nglcobdai/auto-unlock-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

auto-unlock-app

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 LICENSE
Environment Raspberry Pi Python
Technology SwitchBot API

Devices

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

Getting Started

1. Clone & Set PYTHONPATH

$ git clone -b v0.2.0 https://github.com/nglcobdai/auto-unlock-app.git
$ cd auto-unlock-app
$ export PYTHONPATH=$PWD

2. Create .env

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

3. Install Dependencies

$ pip install -r requirements.txt

4. Install Required Libraries

$ 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

5. Run

$ python app/main.py