A simple bot using node js to poll a door sensor (gpio pin) and post the result to a Slack Channel
- Node 7 or later
- Raspberry PI
- Clone repo and install dependencies
git clone https://github.com/jpdenford/DoorSlackBot.git cd DoorSlackBot npm install
- Create a Slack Bot
https://api.slack.com/bot-users - Find the channelID where you want the message to be posted
https://api.slack.com/methods/channels.list/test - Put the channelID and slackbot TOKEN in the config.json file
Run command
sudo node index.js
If you want to leave the process running, run sudo nohup sudo node index.js &