Skip to content

Commit

Permalink
reformat deepsleep TIMERS
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanbode authored Nov 29, 2023
1 parent 2eb6173 commit eff39a9
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion docs/DeepSleep.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,26 @@ DeepSleep support for up to 10 years (i.e., 86,400 seconds = 1 day) (e.g., if us
!!! note
The next wake time will always be an even number of `DeepSleepTime` cycles since the epoch (Midnight 1970-01-01). This may matter if the sleep time isn't an even number of minutes/hours (ex: 3660), such as when trying to wake at a specific time of day.

With Version 13.2 there is a new functionality to use TIMERS for the wakeup process on deepsleep. In this case the deepsleeptime will be dynamically calculated through the TIMERS. To enable TIMERS on deepsleep there must be a `rule1 Wakeup` and `rule1 on` or `rule1 5` (ONCE). Now every TIMER that has RULE as an action will wakeup the device at the proposed time. You can define multiple timers and multiple wakeups also defined on sunset or sunrise. The process will always select the NEXT wakeup it finds. As soon as all conditions meet a 60 second timer countdown starts to send the device to deepsleep. To prevent this it is recommended to disbale ALL timers on the UI during definition. If you tag the rule1 with ONCE the device will stay awake after the deepsleep. To send the device to deepsleep e.g. at sunset another rule can be used to do this: `rule2 on timers#minute=%sunset% do rule1 5 endon` and enable the rule: `rule2 1`. Be aware that `rule1 Wakeup` will DISABLE the capability to use deepsleeptime. You have to clean rule1 if you want to use the regular wakeups through deepsleeptime window.
With Version 13.2 there is a new functionality to use TIMERS for the wakeup process on deepsleep. In this case the deepsleeptime will be dynamically calculated through the TIMERS. To enable TIMERS on deepsleep there must be a
```console
Rule1
Wakeup

Rule1 ON
or
Rule1 5 (ONCE)
```

Now every TIMER that has RULE as an action will wakeup the device at the proposed time. You can define multiple timers and multiple wakeups also defined on sunset or sunrise. The process will always select the NEXT wakeup it finds. As soon as all conditions meet a 60 second timer countdown starts to send the device to deepsleep. To prevent this it is recommended to disbale ALL timers on the UI during definition. If you tag the rule1 with ONCE the device will stay awake after the deepsleep. To send the device to deepsleep e.g. at sunset another rule can be used to do this:

```console
Rule2
on timers#minute=%sunset% do rule1 5 endon

Rule2 ON
```

Be aware that `rule1 Wakeup` will DISABLE the capability to use deepsleeptime. You have to clean rule1 if you want to use the regular wakeups through deepsleeptime window.

![](_media/deepsleep_timers.png)

Expand Down

0 comments on commit eff39a9

Please sign in to comment.