Skip to content
This repository has been archived by the owner on Aug 2, 2021. It is now read-only.

Module thc_RandomLight

Andreas Drollinger edited this page May 5, 2017 · 14 revisions

Random light control


Proc: thc_RandomLight::Define

Defines the random control settings for one device

Parameters

Parameters Description
Device Device identifier
-time <OnOffTimeExpressionList> List of 4 time values {On1, Off1, On2, Off2} that corresponds to the light enable and disable times in the morning and the evening. The time is specified in hours and it can be an expressions (e.g. $SunriseT-0.3)
[-min_interval <MinInterval> Minimum interval time in hours. Default is 0.5 (=30').
[-probability_on <ProbabilityOn> Value between 0 and 1 that specifies the probability that the light is on. Default: 0.5
[-default 0|1 If set to '1' the device is considered to be switched on if no other devices is on.

Returns

-

Examples

 Define LightSalon,state -time {7.2 $SunriseT-0.3 $SunsetT+0.0 21.5} \
                         -min_interval 0.30 -probability_on 0.2

See also

thc_RandomLight::Control


Proc: thc_RandomLight::Control

Applies random settings to the lights

Parameters

Parameters Description
[Force] If define the lights are set to this value (needs to be 0 or 1).

Returns

-

Examples

 DefineJob -tag RdmLight -repeat 1m -description "Random light" {
    thc_RandomLight::Control}
 thc_RandomLight::Control 0

See also

thc_RandomLight::Define


Proc: thc_RandomLight::EvaluateSunRiseSunSet

Evaluates sun rise and set time. These two times are stored respectively inside the variables SunriseT and SunsetT. The following variables need to be defined for the sun time calculation:

Description
Longitude Geographical longitude
Latitude Geographical latitude
Zone Time zone in hours (e.g. +2). If set to 'auto' or '' the time zone will be automatically evaluated

Returns

-

Examples

 namespace eval thc_RandomLight {
   set Longitude 6.8250
   set Latitude 47.1013
   set Zone auto }

 DefineJob -tag EvalSun -time 01h -repeat 24h -init_time +0 \
           -description "Evaluate the sun shine time" {
    thc_RandomLight::EvaluateSunRiseSunSet}

See also

thc_RandomLight::Define