unifi-led-light-switch is a simple self-hosted tool for automatic turning on/off LED light of UniFi controller (for
example, UniFi Dream Machine) by schedule.
- docker
- [optional] docker-compose
Use tag v2.*.* for UDM with Unifi OS (images are multiplatform):
ameyuuno/unifi-led-light-switchameyuuno/unifi-led-light-switch:latestameyuuno/unifi-led-light-switch:v2.0.0
If your UDM does not have Unifi OS, use tag v1.*.* (use specific tag for specific platform):
ameyuuno/unifi-led-light-switch:v1.1.0ameyuuno/unifi-led-light-switch:v1.1.0-amd64ameyuuno/unifi-led-light-switch:v1.1.0-arm64
docker pull ameyuuno/unifi-led-light-switch
docker run -d --name unifi-led-light-switch \
--network host \
-e UNIFI_USERNAME="usernmae" \
-e UNIFI_PASSWORD="password" \
-e UNIFI_BASE_URL="https://192.168.0.1:8443" \
-e UNIFI_LED_SWITCH_ON_CRONTAB="0 8 * * *" \
-e UNIFI_LED_SWITCH_OFF_CRONTAB="0 22 * * *" \
-e TIMEZONE="Europe/Moscow" \
ameyuuno/unifi-led-light-switch
-
Copy
docker-compose.ymlfile -
Create
.envfile and define values for parameters -
Start container
docker-compose pull docker-compose up -d
| Environment | Default | Description |
|---|---|---|
| UNIFI_USERNAME | UniFi username to login to UDM | |
| UNIFI_PASSWORD | UniFi password to login to UDM | |
| UNIFI_BASE_URL | Base URL of UniFi controller which has LED light | |
| UNIFI_LED_SWITCH_ON_CRONTAB | 0 7 * * * |
cron schedule expression for switch on LED light; default - at 07:00 every day |
| UNIFI_LED_SWITCH_OFF_CRONTAB | 0 0 * * * |
cron schedule expression for switch off LED light; default - at 00:00 every day |
| TIMEZONE | UTC |
Time zone ¯\(ツ)/¯; cron schedule depends on time obviously |
Next platforms are supported:
linux/amd64linux/arm64(tested on Raspberry Pi 4)
I bought UDM last week and put it in my bedroom, because UDM is beautiful (ノ´з`)ノ. But at night its LED light disturbs (T_T) and it's hard for me to sleep. So I decide to create a this tool which automatically turns on/off its LED by schedule.
MIT
Pull requests are welcomed. If you find some bug - open issue (^_^).