-
Notifications
You must be signed in to change notification settings - Fork 639
SCHEDULER
SCHEDULER module (scheduler.cpp). Original implementation by @faina09, ref. xoseperez/espurna#131
Since version 1.16.0 uses a generic 'time string' specification string instead of separate weekdays, hour and minute strings. Instead of module-bound actions, generic terminal command support was included.
Configuration key | Build flag | Description |
---|---|---|
SCHEDULER_SUPPORT |
Build scheduler module, 1 by default (0 to disable) |
|
SCHEDULER_MAX_SCHEDULES |
Maximum amount of schedules that will be stored on the device | |
schRstrDays |
SCHEDULER_RESTORE_DAYS (applied to all schedules) |
1 (today and yesterday, default). Number of days to look back for schRestore# . Set to 0 to only check 00:00..NOW. Disable schRestore# for individual schedules. |
SCHEDULER_SUN_SUPPORT |
Build sunrise & sunset module, 0 by default (1 to disable). Use sunrise or sunset keywords in the time string |
|
schLat |
SCHEDULER_LATITUDE |
Current latitude (float) |
schLong |
SCHEDULER_LONGITUDE |
Current longitude (float) |
schAlt |
SCHEDULER_ALTITUDE |
Current altitude aka elevation (float). Default is 0.0 , adjust for more precise time calculation. |
| Configuration key | Build flag | Description |
|schType#
||Type of the n-th schedule. One of: unknown
, disabled
or calendar
. Note that unknown
schedules cannot be saved in settings, and will be removed. Currently, only calendar
type is used.|
|schTime#
||Time specification at which the n-th schedule action should take place. See below for more information.|
|schAction#
||Action to perform for n-th schedule. w/ TERMINAL_SUPPORT=1
, uses terminal commands. When disabled, limited to relay
, light
and curtain
commands with a similar syntax.|
|schRestore#
| SCHEDULER_RESTORE
(applied to all schedules) |0
(disabled, default) or 1
(enable) to attempt to trigger last missed schedule when device syncs time for the very first time.|
Time string | When action would be triggered |
---|---|
12:00 |
at tweelve o'clock |
00:00 UTC |
at midnight UTC |
Sat,Sun 10:00 |
at ten o'clock on Saturday and Sunday |
13,15..17:00 |
at thirteen, fifteen, sixteen and seventeen o'clock |
01-01 06:00 |
at six o'clock on January 1st |
05-W2 |
at midnight of every day on the 2nd week of May |
12-L1,2 18:55 |
at eighteen fifty five on the second to last day and the last day of December |
*-1/5 5:00 |
at five o'clock on days 1, 6, 11, 16, 21, 26 and 31 |
Mon,Thu..Sat 10,15,20:30 |
at ten thirty, fifteen thirty and twenty thirty on Mondays, Thursdays, Fridays and Saturdays |
Expected format is YYYY-MM-DD
, where
-
YYYY
is a year, a 4-digit number -
MM
is a month, 1–12 -
DD
is a day, 1–31
Expected format is either full or abbreviated name in English (case insensitive), or its ISO numeric value.
Quoting ISO 8601
D is the weekday number, from 1 through 7, beginning with Monday and ending with Sunday.
Name | Abbreviation | Number |
---|---|---|
Monday |
Mon |
1 |
Tuesday |
Tue |
2 |
Wednesday |
Wed |
3 |
Thursday |
Thu |
4 |
Friday |
Fri |
5 |
Saturday |
Sat |
6 |
Sunday |
Sun |
7 |
Expected format is HH:MM
-
HH
is an hour, 0–23 -
MM
is a minute, 0–59
Can be specified only once per string, generally appear right at the end.
-
UTC
to use coordinated universal time instead of local time.
When SUNRISE_SUN_SUPPORT=1
, additional keywords can be used in place of HH:MM
-
SUNRISE
to trigger schedule at the next sunrise. -
SUNSET
to trigger schedule at the next sunset.
When using restore feature, both are respected for previous dates
- At least one element must appear in the string
- Extra zero in front is not required for numbers less than 10
-
*
can be used to match any year, month, day, hour or minute -
YYYY-MM-DD
can be omitted from the string,*-*-*
is used by default -
YYYY
can be omitted in theYYYY-MM-DD
string,MM-DD
format is allowed - Weekdays can be omitted from the string and defaults to
Mon..Sun
-
HH:MM
can be omitted and defaults to00:00
. - Multiple months, days of month, weekdays, hours and minutes can be specified when separated with a
,
(comma) - Range of months, days of month, weekdays, hours and minutes can be specified by separating two values with a
..
(double period) - Comma and double period can be combined within one element
- In place of
DD
,W1–5
can be used to match a specific week number. - In place of
DD
,L1–31
can be used to match last day of the month as a starting point for the day number instead of its start. - In place of
DD
,L
to match the last day of the month -
/1–..
is a repetition suffix, which matches specific element and also any multiples of the repeat value, starting with the specified element itself. This suffix is allowed with month, day (includingL
), hour, minute
If you're looking for support:
- Issues: this is the most dynamic channel at the moment, you might find an answer to your question by searching open or closed issues.
- Wiki pages: might not be as up-to-date as we all would like (hey, you can also contribute in the documentation!).
- Gitter channel: you have better chances to get fast answers from project contributors or other ESPurna users. (also available with any Matrix client!)
- Issue a question: as a last resort, you can open new question issue on GitHub. Just remember: the more info you provide the more chances you'll have to get an accurate answer.
- Backup the stock firmware
- Flash a pre-built binary image
- Flash a virgin Itead Sonoff device without opening
- Flash TUYA-based device without opening
- Flash Shelly device without opening
- Using PlatformIO
- from Visual Studio Code
- Using Arduino IDE
- Build the Web Interface
- Over-the-air updates
- Two-step updates
- ESPurna OTA Manager
- NoFUSS
- Troubleshooting
- MQTT
- REST API
- Domoticz
- Home Assistant
- InfluxDB
- Prometheus metrics
- Thingspeak
- Alexa
- Google Home
- Architecture
- 3rd Party Plugins
- Coding style
- Pull Requests