Skip to content

Module thc_RandomLight

Andreas Drollinger edited this page Nov 8, 2019 · 15 revisions

Random light control


Proc: thc::RandomLight::Configure

Configures the geographical location and time zone.

Parameters

Parameters Description
[-longitude <Longitude> Geographical longitude
[-latitude <Latitude> Geographical latitude
[-zone <Zone>] Time zone in hours (e.g. +2). If set to 'auto' or '' the time zone will be automatically evaluated. Default: 'auto'

Returns

-

Examples

 thc::RandomLight::Configure \
    -longitude 6.8250 -latitude 47.1013 -zone "auto"

See also

thc::RandomLight::Define


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

 thc::RandomLight::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

 thc::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 geographical location and time zone has to be defined to use this function.

Returns

-

Examples

 ::thc::RandomLight::Configure \
                        -longitude 6.8250 -latitude 47.1013 -zone auto

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

See also

thc::RandomLight::Configure <thc::RandomLight::Define>