Skip to content

jlax47/bedlight

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bedlight (Traffic Light Wake Helper)

A Raspberry Pi--based traffic light that helps kids know when it's okay to come out of their room.

Light meanings

  • Red -- go back to bed
  • Yellow -- play quietly in your room
  • Green -- it's okay to come out
  • Off -- before the configured start time and after noon

Features

  • Web UI to configure daily schedule
  • Configurable "start lighting at" time (default 05:00)
  • Automatically turns off after 12:00 PM
  • Manual override buttons (Red / Yellow / Green / Off / Auto)
  • Timed overrides (e.g., force green for 30 minutes)
  • Persistent configuration across reboots
  • Runs as a systemd service
  • mDNS support (http://bedlight.local)
  • Uses gpiozero with lgpio (no RPi.GPIO issues)

Hardware

  • Raspberry Pi (any 40-pin model)
  • 3 LEDs (red, yellow, green)
  • 3 resistors (220--330Ω)
  • Wiring:
    • Red LED → BCM 17 (physical pin 11)
    • Yellow LED → BCM 18 (physical pin 12)
    • Green LED → BCM 27 (physical pin 13)
    • Common ground

Install on a new Raspberry Pi

sudo apt update
sudo apt install -y git
git clone <YOUR_REPO_URL> bedlight
cd bedlight
sudo ./deploy.sh bedlight

Then open: - http://bedlight.local - or http://<pi-ip>


Configuration

Configuration is stored at:

/etc/bedlight/config.json

Example:

{
  "start_at": "05:00",
  "red_until": "07:00",
  "yellow_until": "08:30",
  "green_until": "11:00",
  "enabled": true,
  "override_state": "auto",
  "override_until": ""
}

Edits made via the web UI are saved automatically.


Service management

Check status:

sudo systemctl status bedlight.service

Restart:

sudo systemctl restart bedlight.service

Logs:

sudo journalctl -u bedlight.service -f

Updating

git pull
sudo ./deploy.sh bedlight

Your configuration will be preserved.


Troubleshooting

LED doesn't turn on - Check wiring and resistors - Verify BCM pin numbers - Check logs with journalctl

Can't reach bedlight.local - Ensure avahi is running:

sudo systemctl status avahi-daemon
  • Try using the Pi's IP address instead

License

MIT

About

A raspberry pi light to let a kid know when it's ok to come out of their room in the morning

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors