Python rules our plants

Last modified on July 24, 2026 • 2 min read • 307 words
In 2025, we updated our 12-year-old router (the Asus RT-AC66U, WiFi 5/IEEE 802.11ac) and replaced it with a WiFI 6 Flint 2 (GL-MT6000).
Python rules our plants
Image by Michael Jeltsch
In 2025, we updated our 12-year-old router (the Asus RT-AC66U, WiFi 5/IEEE 802.11ac) and replaced it with a WiFI 6 Flint 2 (GL-MT6000)  . While the default user interface of the Flint 2 is pretty basic, its advanced setup is a powerhouse. When you click “Advanced Setup”, you can access the underlying OpenWRT  user interface. OpenWRT is a Linux distribution for routers. And unsurprisingly, it is very powerful. A year ago, we started to use a LED array  to help our plants survive the winter. To automatically operate the lights, we use a Shelly smart plug  via a Python script that calculates the light levels and electricity prices (using the sähkönhintatänään API  to get the price data) and switches the plant lights only on when both light levels and electricity prices are low. Today, we moved this Python script from my desktop computer to the Flint 2 router. There are thousands of installable packages available for OpenWRT (directly from the router UI: Applications > Plug-ins). To make my Python script work on the router, we first needed to install the openssh-server to get shell access (btw. the p/l combo is root/“same password as for the web UI”, the router correctly opens the access only to the local network). We also installed python3 and python3-pip and then pip-installed the two non-standard packages ShellyPy  (to address the smart plugs) and astral  (to calculate the dark/bright periods for any given day at Helsinki latitude, which is around 60°North). We just needed to add an entry to the crontab to run the script once every hour. Since you are logged in as root, you just need to execute crontab -e and add this line to the crontab 0 * * * * python3 /root/plantlight.py and restart the cron daemon (which you can do via the OpenWRT UI under “System > Startup”).