Author |
|
GadgetGeek Newbie
Joined: February 26 2006 Location: United States
Online Status: Offline Posts: 2
|
Posted: February 26 2006 at 16:42 | IP Logged
|
|
|
I searched and searched, and I know it's got to be here somewhere, but I can't find it!
I am looking for a simple way for a macro to only trigger (based on a motion detector) if it's dark outside (after dark, before sunrise).
I have a MS13a that I want to put in my garage. At night when I drive in, it will see the headlights (and the light from the garage door opener) and send a "light" status. I want to turn on certain lights in the house, but only if it's dark outside.
Thanks!
__________________ GadgetGeek
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: February 26 2006 at 20:31 | IP Logged
|
|
|
Welcome to PH!
One way would be to create two timed events to alternately set a flag to "dark" or "light" and then enable/disable the trigger.
Create a Global Variable, call it "SUN STATE". Create a Timed Event, set the "Timing" to "Dusk", make it a formula, and enter ph_setglobal_s( "SUN STATE", "dark" ). Create another Timed Event, this time set it to "Dawn", and make the formula ph_setglobal_s( "SUN STATE", "light" ).
Now, set the Boolean field for the trigger to be if( "{SUN STATE}" = "dark", 1, 0)
Another way would be to compare the current time to [DAWN] and [DUSK] and enable the trigger that way in the Boolean field.
|
Back to Top |
|
|
GadgetGeek Newbie
Joined: February 26 2006 Location: United States
Online Status: Offline Posts: 2
|
Posted: February 28 2006 at 06:15 | IP Logged
|
|
|
Thanks! It works great!
__________________ GadgetGeek
|
Back to Top |
|
|
|
|