1. I would like to run a task each day 30 minutes before dawn so i have to compute that time at some point.
2. I run a task normally every hour but if something happens i want to run it 20 minutes after that event.
1. I would like to run a task each day 30 minutes before dawn so i have to compute that time at some point.
2. I run a task normally every hour but if something happens i want to run it 20 minutes after that event.
Now, nothing of that would be too hard to implement myself but these task runners pop up every so often and i would like to leverage other peoples work. Home assistant just feels a bit big for this. Do note that i currently do neither of those but i always try to evaluate these use-cases for these task-runners.
I used this myself for my father's chicken coop, it's quite easy to use.
On other side it would allow it to be fancy, like rescheduling it earlier if rain is close to the sunset
https://docs.celeryq.dev/en/stable/reference/celery.schedule...
EDIT: I think you just need to provide a nowfun that offsets datetime.now() by the desired timedelta.
If you can write the condition in English, it would seem to me you can build a custom Rocketry condition to suit it.
We've built this at https://www.inngest.com. You can run functions based off of schedules or events, with things like "when this event happens, run 20 minutes after the event". Or, "run, wait for another thing to happen, then continue".
Event driven schedulers do all the regular scheduling, but with a few benefits:
- It's reactive
- You can fan-out, so one event runs many functions
- You can store all events for debugging, replay, local testing, typing, etc.
We could plumb in an event source for #1 which indicates sunrise and sunset. Heh.