-
Notifications
You must be signed in to change notification settings - Fork 1
Module thc_Timer
This module provides a Timer that allows controlling device states at a certain time, and in a certain interval. User can set and delete timers from the default web application (see Web interface). The timer settings are backed up in the recovery file defined by thc::ConfigureRecoveryFile, and restored after a restart of THC.
Registers a new timer task. A timer task allows controlling a device state at a certain time and in a certain interval.
Parameters | Description |
---|---|
<Time> | Timer time. Absolute and relative time definitions are accepted. Supported formats: See the -time argument of <thc::DefineJob>. |
<Device> | Device that will be controlled |
<Command> | Device control command. Allowed commands are: 'On', 'Off', 'Switch', 'Set <Value>'. The commands are case insensitive. |
[<Repeat>] | Task repetition. Absolute time definitions are accepted. No repetition will be performed if set to "". Supported formats: See the -repeat argument of <DefineJob>. |
[<Description>] | Timer description (for logging purposes). |
Timer job identifier
thc::Timer::Define "2015-01-06 08:30" Surveillance,state Off 7d
-> timer0
thc::Timer::Define 08h30m LightLiving,state Switch 5m "Light switch"
-> timer1
thc::Timer::Delete, thc::Timer::List
Delete one or multiple timer tasks.
Parameters | Description |
---|---|
TaskTag | Jobs specified by its tags. This argument can be repeated to delete multiple jobs. The 'timer' prefix can be omitted. |
-
thc::Timer::Delete timer15 timer7
thc::Timer::Delete 15 7
thc::Timer::Define, thc::Timer::List
List all active timer tasks. The returned result is a list of timer task definitions. Each timer task definition itself is a list composed by the following elements:
- Task identifier
- Next execution time
- Controlled device
- Device control command
- Repetition
- Description
-
Timer task list
thc::Timer::List
-> {timer2 {Tue Jan 06 08:30:00 CET 2015} Surveillance,state On {} \
{Timer 2: Surveillance,state On @ 2015-01-06 08:30, rep=''}} \
{timer3 {Tue Jan 06 09:30:00 CET 2015} Surveillance,state Off 3600 \
{Timer 3: Surveillance,state Off @ 2015-01-06 09:30, rep='1h'}}
THC, Tight Home Control - See THC index register - THC repository on github.com/Drolla/thc