Skip to content

Instantly share code, notes, and snippets.

@OothecaPickle
Last active August 25, 2025 05:56
Show Gist options
  • Select an option

  • Save OothecaPickle/81b4647a808f3382028efb93f9beca82 to your computer and use it in GitHub Desktop.

Select an option

Save OothecaPickle/81b4647a808f3382028efb93f9beca82 to your computer and use it in GitHub Desktop.
OpenBeken Sunset Light Script
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