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

longer interval/specific date for scheduler #2060

Closed
coelner opened this issue Dec 14, 2019 · 2 comments
Closed

longer interval/specific date for scheduler #2060

coelner opened this issue Dec 14, 2019 · 2 comments
Labels
enhancement New feature or request scheduler

Comments

@coelner
Copy link

coelner commented Dec 14, 2019

I can't find any directly related issue.

I need to activate a switch by a longer period than on daily base. Once in a month I want to start a system. Sometimes I would need a specific date and not an interval.

@coelner coelner added the enhancement New feature or request label Dec 14, 2019
@mcspr
Copy link
Collaborator

mcspr commented Dec 24, 2019

As I am not really in favour of adding yet another kv pair to the scheduler engine... I guess we can extend RPN rules instead? See this example:
https://github.com/xoseperez/espurna/wiki/RPN-Rules#open-light-at-night-if-there-is-presence

It matches the existing functionality of scheduler to compare hour, minute and day of week. e.g., here's the piece of code to return weekday match:

rpn_operator_set(_rpn_ctxt, "dow", 1, [](rpn_context & ctxt) {
float a;
rpn_stack_pop(ctxt, a);
unsigned char dow = (weekday(int(a)) + 5) % 7;
rpn_stack_push(ctxt, dow);
return true;
});

We can add an additional operator day / dom / or longer dayofmonth to match the month day instead

@mcspr
Copy link
Collaborator

mcspr commented Jun 15, 2024

Part of the scheduler update, YYYY-MM-DD can be specified in addition to DOW and HH:MM
https://github.com/xoseperez/espurna/wiki/Scheduler#time-string

@mcspr mcspr closed this as completed Jun 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request scheduler
Projects
None yet
Development

No branches or pull requests

2 participants