🔗 Code can be found here: home-lab-lighting/lab

Hardware setup
Lighting demo

Home Lab Lighting Project

I wanted to build automated lighting for my home office. I used an old rapberry pi 3 that I had laying around, a PIR sensor, and my Hue Bridge to automate turning on my lights when entering the room.

Overview

TL;DR I created a systemd service on the Pi to monitor motion detection from the PIR sensor. If no motion is sensed after 30 minutes, the lights will turn off.

Features

Materials

Setup

I recommend enabling SSH access on your pi, and interfacing with it that way.

1. SSH into your pi, and clone the repository

git clone https://github.com/sammydowds/home-lab-lighting.git

2. Create the hue environment file

python3 setup_hue_env.py

This will output a file into your pi's home directory which the service references for its environment variables. It is also responsible for setting up a group of lights and will require your input for that.

3. Create the systemd service and start it

./start_service.sh

This will copy over the lighting.service file into /etc/systemd/system, enable it, and start the service.

4. [NOTE] To stop and remove the service run remove-service.sh

./remove_service.sh

This will stop and remove the service folder from systemd.

License

MIT (or your preferred license)