Last active
August 25, 2025 05:56
-
-
Save OothecaPickle/81b4647a808f3382028efb93f9beca82 to your computer and use it in GitHub Desktop.
OpenBeken Sunset Light Script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| startDriver ntp | |
| // NIST WWV, Fort Collins, Colorado | |
| ntp_setServer 132.163.97.1 | |
| // Pacific Daylight Time | |
| ntp_timeZoneOfs -7 | |
| // [REDACTED] | |
| NTP_SetLatlong [REDACTED] | |
| // clear all events | |
| clearClockEvents | |
| waitFor NTPState 1 | |
| // set on/off commands | |
| alias light_on backlog led_dimmer 50; led_temperature 500; led_enableAll 1 | |
| alias light_off led_enableAll 0 | |
| // add clock events | |
| addClockEvent sunset 0xff 01 light_on | |
| addClockEvent 22:00 0xff 02 light_off | |
| // set the current time as seconds after midnight for easy calculations | |
| setChannel 11 $hour*3600+$minute*60 | |
| // set initial state | |
| if $CH11>=$sunset&&$hour<22 then light_on | |
| if $CH11<$sunset||$hour>=22 then light_off |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment