Daylight mode for Xiaomi Mi Yeelight bulbs and lights.
Project description
Night shift script for Xiaomi Mi Yeelight lights and light bulbs.
Setup
Raspberry Pi
Download setup the latest version of Rasbian on your Raspberry Pi.
Next install the following packages:
sudo apt-get install python3 -y
wget https://bootstrap.pypa.io/get-pip.py
sudo python3 get-pip.py
Deeelight
Install the Python package
sudo pip install deelight
and run the deelight command
deelight "New York, US" -v
Autostart
If you are running deelight on Raspbian or any other Debian system you can add a simple upstart script. It will be executed once your network is up.
sudo touch /etc/network/if-up.d/deelight
chmod +x /etc/network/if-up.d/deelight
sudo nano /etc/network/if-up.d/deelight
#!/bin/sh -e
## Replace this value with the correct city name.
# CITY="New York, US"
CITY=Valletta
PIDFILE=/var/run/deelight.pid
case "$IFACE" in
lo)
# The loopback interface does not count.
# only run when some other interface comes up
exit 0
;;
*)
;;
esac
if [ -f "$PIDFILE" ] && \
[ "$(ps -p "$(cat "$PIDFILE")" -o comm=)" == deelight ]; then
exit 0
fi
deelight "$CITY" -vv >/var/log/deelight.log 2>&1 &
echo $! >"$PIDFILE"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
deelight-1.0.4.tar.gz
(9.7 kB
view hashes)