Open gls21 opened 1 year ago
I'd probably try to do this with cron calling a script every x minutes and the script using heliocron to evaluate if the current time is between sunrise and sunset. For example I use something like the below in Python to collect the day state from Heliocron into a string:
def daylight_state(lat, lon):
result = subprocess.run(["/home/pi/heliocron", "-l", str(lat), "-o", str(lon), "poll", "--json"],
capture_output=True)
data = json.loads(result.stdout)
return data["day_part"]
Is it possible to use heliocron to run a script every x amount of minutes between sunrise and sunset, as opposed to using it to trigger a single event relative to sunrise/set?