Branch | Build |
---|---|
main | |
dev |
- Put a contact switch on a door and generate logs, alarms and notifications with your Raspberry PI.
- Connect a WebCam and view snapshots and motion activated videos over Slack.
- Add DHT11 temperature sensors and track temperature and humidity fluctuations over time.
This is a hobby solution, no warranty or guarantee of any kind is made.
Please use at your own risk.
- A Raspberry Pi.
- You'll need a Raspberry PI with Raspberry Pi OS or similar installed and reliable internet.
- I developed and tested this project on a Pi 1Bv2 and a Pi 3.
- Contact switches.
- These are available cheaply on ebay, Amazon or at your local electronics store.
- Some examples can be found here.
- Temperature monitors.
- Currently, only the DHT11 is supported, but it's trivial to add support for the DHT22.
- Currently, only the DHT11 is supported, but it's trivial to add support for the DHT22.
- You can find out more about these sensors here.
- Wiring between the switches, temperature monitors and the Raspberry Pi's GPIO connectors.
- Find out more about the Pi's GPIO here.
- Female jump wires make installing the connections pretty painless. I spliced them to the ends of modular cables (i.e. phone cables) for longer runs.
- Edit the config.json file to customize your pin outs and integrations.
- A USB camera or webcam that's compatible with motion.
- Many webcams are compatible and widely available.
Supports Python 3.8, 3.9, 3.10 or 3.11
See this guide for setting up your bot on Slack.
You'll need to create two S3 buckets:
- one to archive logs
- one to archive motion detection videos
Create a set AWS cli credentials with write permissions to both of these buckets.
Use the following template to design your write access policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllPutObjectActions",
"Effect": "Allow",
"Action": ["s3:PutObject", "s3:PutObjectAcl", "s3:PutObjectVersionAcl"],
"Resource": ["arn of a bucket1", "arn of a bucket2"]
}
]
}
You can also configure lifecycle rules for these buckets to control data retention. (And it's definitely a good idea to ensure they are not publicly accessible!)
This service has a generous free tier that will allow you to search your logs and create useful reports and graphs.
You will need to know your accounts log token
, (check the website on how to configure filebeat to find it.)
Enter your AWS credentials for the logging bucket here, to archive your logs.
PI Portal ships with a binary for filebeat that has compiled for the Raspberry PI 3. This binary is responsible for streaming your logs to logz.io.
To get started rolling your own configuration file, here's some important resources:
- First it's handy to look at the sample config included in the repository.
- For more detail on what the options all do, there's a JSON schema documented here that can help you make the most of your config.
- The actual JSON schema is here and is used to do programmatic validation of your configuration.
- The motion configuration can be a bit overwhelming. The existing values in the sample config should get you started. You can also check out the motion and camera configuration files for a bit more information.
There are 3 primary delivery mechanisms for Pi Portal:
- a multiarch (armv6, armv7 and arm64) docker image
- a set of Raspberry Pi OS compatible deb packages
- a Python wheel and source distribution
Please see the installation guide for further details.
Once configured and installed you should be streaming your logs to logz.io, where you can create custom notifications and integrate with other services. You will also be receiving notifications on the configured Slack channel whenever a door is opened or closed.
You can also interact with the bot service on the Slack channel, try the command help
to get started.