https://github.com/ki-labs/hodor
Hodor is a an automation application that is used to open the door controlled by an intercom system from Slack using a custom slash command.
https://github.com/ki-labs/hodor
aws-lambda hacking hardware hodor intercom iot raspberry-pi slack
Last synced: 3 months ago
JSON representation
Hodor is a an automation application that is used to open the door controlled by an intercom system from Slack using a custom slash command.
- Host: GitHub
- URL: https://github.com/ki-labs/hodor
- Owner: KI-labs
- License: mit
- Created: 2018-01-30T16:03:49.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T00:49:00.000Z (over 2 years ago)
- Last Synced: 2025-03-22T19:03:23.479Z (3 months ago)
- Topics: aws-lambda, hacking, hardware, hodor, intercom, iot, raspberry-pi, slack
- Language: Python
- Homepage: https://medium.com/ki-labs-engineering/hodor-controlling-the-office-door-from-slack-a79e77635e39
- Size: 341 KB
- Stars: 27
- Watchers: 9
- Forks: 2
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hodor
Hodor is a an automation application that is used to open the door controlled by an intercom system from Slack using a custom slash command.## How it Works
Once a command `/door open` is sent from slack, it is processed by the slack bot service and validated before triggering the door_service to activate the switch on the intercom system through the relay.
## Wiring the Hardware
We imitate a button press on the intercom by short-circuiting the physical button on the intercom. This is done by using a simple relay which is controlled by the Raspberry Pi as shown in the figure.
## Components

* __door_service__(nodejs_rpi): Raspberry Pi running a Node.js server that is connected to the intercom switch using a relay.
* __slack_bot__: Slack integration with a custom slash command `/door` which is handled by a serverless Python web service running on AWS Lambda## How to Run?
### Door Service
```
$ npm install
$ node app.js
```
#### Deployment
If the server is run on port 80 of Raspberry Pi, it can be available on the internet using [Dataplicity](https://www.dataplicity.com/).Cron jobs can be added to automatically restart the service on restart of the device.
```
@reboot /path/to/node /path/to/the/app.js &
```### Slack Bot
```
$ export VERIFICATION_TOKEN=
$ export CHANNEL_ID=
$ export DOOR_SERVICE=
$ pip install -r requirements.txt
$ python slack_bot.py
```
#### Deployment to AWS Lambda
```
$ zappa init
$ zappa deploy
```
Note: Your AWS credentials need to be configured for [Zappa](https://www.zappa.io/) to work.