GadgetGuy Super User
Joined: June 01 2008 Location: United States
Online Status: Offline Posts: 942
|
Posted: November 18 2010 at 18:42 | IP Logged
|
|
|
Having been working extensively on home automation projects this last week, I realized how much I used the Boolean field (the rightmost field in the Timed Events and also the Triggers setup windows). I also realized that the Boolean field hardly ever gets mentioned in the Forum, yet it is an extremely useful feature.
When you define a Timed Event or a Trigger, the Boolean field automatically defaults to a "1" (which stands for TRUE and thus an OK to execute the events associated with it on the same definition line).
The Boolean field, however, can contain formulas that interact with variables, etc to provide conditional "approval" to execute (or not) the event. Any formulas used, must calculate to a "0" or "1" (FALSE or TRUE) and must be a immediate (that is not a queued) function.
As an example . . .
This Timed Event only executes if it is Tuesday morning (Timing; Frequency; and initial Reference Time parameters) AND if we are HOME (Set by a motion detection macro during the prior 24 hour period). The IF function in the boolean field evaluates to a "1" if we are home (allows the Timed Event to then run), or a "0" if we are absent (the Timed event does not run).
On a more complex basis, the following Timed Event turns a light on every morning if we are Home AND Dawn occurs after 6:30AM. (It also automatically creates a Timed Event to turn it back off 15 minutes after Sunrise.)
If we are absent or Dawn is earlier than 6:30AM then there is no need for the light.
Using the Boolean field thus provides a great deal of extra control for your events while also simplifing things by eliminating the need for events to call macros to do a complex logic check.
When the Boolean filed is used, such checks can often be accomplished right within a single line event definition.
Yet one more awesome and creative design decision by Dave!
__________________ Ken B - Live every day like it's your last. Eventually, you'll get it right!
|