Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement - Sunrise/Sunset with Offset #804

Open
UNICodehORN opened this issue Sep 11, 2024 · 3 comments
Open

Enhancement - Sunrise/Sunset with Offset #804

UNICodehORN opened this issue Sep 11, 2024 · 3 comments

Comments

@UNICodehORN
Copy link

First of all: great work! I am using cronicle for some years now and never had any stability problems.
Keep up the marvelous work!

Feature Request: New timing option sunrise/sunset
I guess this mainupulated screenshot describes best what I am thinking of
image

I want to be able to schedule events for sunrise/sunset (with an offset). The time changes over the year and is dependent on the location.

Location to retrieve sunset/sunrise time must be saved in config or estimated by the timezone.
API call to a service (e.g. https://openweathermap.org/api) needed, API key must be set for this feature in the config.

Use-Case: Some automation task are dependent on daytime/nighttime, this can be e.g. smarthome tasks: "turn on light after sunset"

@jhuckaby
Copy link
Owner

Great idea, thank you! Adding it to the list.

I wonder what else I could use to enhance the scheduling system... Tidal charts? Run job when the tide is < 0.2? Hahaha! Weather? Run job when rain is expected in the next hour?

Maybe I should have "Scheduler Plugins" that can run a bit of code, say every minute, and decide whether to "trigger" the event or not. Then Sunrise / Sunset, Tidal Chart, and Weather can all be Plugins!

@UNICodehORN
Copy link
Author

Had the same thought to have scheduler plugins. Actually that was how I came up with the idea when trying to write a plugin and realized that scheduling is not done by the executable plugins.

And if you ask for more ideas to enhance scheduling: I am also missing sometimes an option to exclude/include holidays.

If a task is scheduled for tuesday but it is a holiday I might want to not execute a task OR if a day is a holiday I want to execute it no matter which weekday it is.

Weather could be a thing for tasks like rain or temperature based.
Also system states could be interesting for tasks, e.g. disc is 80% full or Server xyz not reachable.

@jhuckaby
Copy link
Owner

jhuckaby commented Sep 11, 2024

Yup, agree! So, Cronicle v2 (called Orchestra) has several new features built into it, and one of those features is custom server monitors (which can run any code really), and custom alerts on the data from your monitors (you can set an expression that evaluates to true or false), and alerts can run jobs when they trigger!

That handles this case for sure, which is literally what it was made for, and it even comes with a disk full alert built-in, hahaha:

Also system states could be interesting for tasks, e.g. disc is 80% full or Server xyz not reachable.

But also, it could actually be used for the weather and tidal things too.

So maybe we can make this all work within the Cronicle v2 design...

For skipping events on holidays, Cronicle v2 has a "blackout" option you can apply to your scheduled events, where you can give it a date/time range. You can even apply multiple blackouts per event.

So maybe all the cases are handled in v2... I'll keep pondering this tho... I do rather like the idea of "scheduler plugins"...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants