Skip to content

A slack app to share a notification in a given channel when a door is opened.

Notifications You must be signed in to change notification settings

nenoch/sensor-butler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sensor Butler :bowtie:

A Raspberry Pi device to share a message on a slack channel when a door is opened.

Raspberry Pi & PIR sensor

1) Slack & Webhooks
Create a slack team for prototyping purposes and your first slack App. You will need a incoming webhook url to send the POST request with your message to slack.

Resources
https://api.slack.com/tutorials/slack-apps-hello-world

Try out your incoming webhook in the terminal:

curl -X POST -H 'Content-type: application/json' --data '{"text":"Door :door: is open! :open_hands:"}' https://hooks.slack.com/services/YOUR-SLACK-WEBHOOK

2) Raspberry Pi and PIR (passive infrared) motion sensor

Build your Raspberry Pi device. You will need:

  • Raspberry Pi
  • PIR sensor
  • USB Wi-Fi adaptor
  • Jumper wires (female to female)
    Note: male to female will work too if you have a Breadboard

Raspberry Pi & PIR sensor

IMPORTANT: Setup
You will need access to the RPi via screen (HDMI), mouse and keyboard.

wiring detail 1 wiring detail 2
wiring detail 3 wiring detail 4

Resources
https://www.hackster.io/hardikrathod/pir-motion-sensor-with-raspberry-pi-415c04 https://www.raspberrypi.org/learning/parent-detector/worksheet/

3) Download the sensor-butler repository in your RPi

In the Terminal:

$ cd Desktop
$ git clone https://github.com/nenoch/sensor-butler.git

Open pir.py and change the webhook url to the one in your slack app.

Resources
https://projects.raspberrypi.org/en/projects/getting-started-with-git

4) Schedule tasks with Cron
Follow the instruction in the cron-config.md file. With this setting the sensor will be active at reboot and then everyday after midnight. Remember that the sensor will be 'triggerable' only once per day.
Note: remember change the path if your directory is not in the Desktop

Resources
https://www.raspberrypi.org/documentation/linux/usage/cron.md

About

A slack app to share a notification in a given channel when a door is opened.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages