Skip to content

Instantly share code, notes, and snippets.

View johndoewashere2's full-sized avatar

johndoewashere2

View GitHub Profile
@johndoewashere2
johndoewashere2 / duskdawn.sh
Last active July 31, 2024 07:36 — forked from themactep/dusk2dawn.sh
Generate cron job lines from sunrise and sunset times using Home Assistant sensor data
#!/bin/sh
#
# Set cron jobs by sunset and sunrise time using sensor data from Home Assistant (HASS)
# Original work by Paul Philippov <[email protected]> - https://gist.github.com/themactep/06f951da3fc05693871cc15aa243dff5
# Create separate entry in your crontab to run this script at midnight (or after DST clock changes) to update the times daily
#
# 2024.06.13.00 Initial version
# 2024.06.13.01 Using universal sun.sun entity from HASS, removed leading zero from printf (%02d) output to crontab
#