Scripts for a controllable Wakeup Light build with a Raspberry Pi and a Govee LED
- Written for Raspberry Pi
- I am not a programmer. This is very messy code but it works every morning. You are nonetheless welcome to contribute to this code.
python3 govee_btled from Freemanium: https://github.com/Freemanium/govee_btled
- update your pi, this prevents bluetooth issues
- install the requirements from above and test if the LED ist reacting with the test script in the govee_btled repository
- copy both files to your /home/pi/ directory
- change all the MAC-Adresses in the scripts to the MAC-Adress of your Govee Bluetooth LED (how to find it: see below)
- modify the start and end time for the wakeup time and test the script with "python3 wake_up_service.py"
- add a systemd service for automatic startup (see below)
- add a restart at 2 or 3 o'clock in the night to prevent hangs in the bluetooth engine. It's a common problem of raspberry pis
Use the command "bluetoothctl" After firing it up tpye "scan on" and wait for a line like this one:
[NEW] Device XX:XX:XX:XX:XX:XX Minger_H6001_3E2C
Or another name like Govee. The identifier with lots of ":" is your MAC-adress
- sudo nano /etc/systemd/system/wake_up.service
add the following code:
[Unit]
Description=wake_up
Wants=graphical.target
After=graphical.target
Requires=bluetooth.target
[Service]
Type=simple
ExecStartPre=/usr/bin/xset -dpms
ExecStart=/usr/bin/python3 /home/pi/wake_up_service.py
Restart=always
RestartSec=20
User=pi
Group=pi
[Install]
WantedBy=graphical.target
- sudo systemctl enable wake_up.service