Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: The Boolean Field Easter Egg Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
GadgetGuy
Super User
Super User
Avatar

Joined: June 01 2008
Location: United States
Online Status: Offline
Posts: 942
Posted: November 18 2010 at 18:42 | IP Logged Quote GadgetGuy

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!
Back to Top View GadgetGuy's Profile Search for other posts by GadgetGuy
 
smarty
Super User
Super User
Avatar

Joined: May 21 2006
Location: United States
Online Status: Offline
Posts: 728
Posted: November 18 2010 at 22:51 | IP Logged Quote smarty

Very nice write up/explaination!!! Thanks for taking the time to write it up.

__________________
Elk - Insteon - BlueIris - DMC1 - PowerHome - XLobby - HA_Bridge w/Dots - Brultech
Back to Top View smarty's Profile Search for other posts by smarty
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum