Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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: about 5 hours 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.

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.
![Hodor in action](https://github.com/KI-labs/Hodor/blob/master/images/Slack_typing.gif "Hodor in action")

## 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.
![Hodor wiring](https://github.com/KI-labs/Hodor/blob/master/images/HardwareWiring.jpg "Hodor: Wiring the hardware")

## Components
![Hodor architecture](https://github.com/KI-labs/Hodor/blob/master/images/HodorArchitecture.jpg "Hodor: Architecture")
* __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.