sharby Groupie
Joined: May 13 2007 Location: United States
Online Status: Offline Posts: 50
|
Posted: September 02 2007 at 02:47 | IP Logged
|
|
|
Below is a more reliable Auto-Lights at night feature that works great
1. Define Global Variable - DARK OUTSIDE (0 for off, 1 for on)
2. Set 2 Timed Events to define light vs day
Timing Freq &n bsp; Offset ... ... Type ID/Keys
Sunrise Daily Raw ph_setglobal_a("DARK OUTSIDE",0)
Sunset Daily & nbsp; & nbsp; Raw &nbs p;ph_setglobal_a("DARK OUTSIDE",1)
3. write a Formula in Startup that automatically sets Dark for 0 or 1 for when you startup up PH (in case you're not running the program round the clock)
ph_setglobal_a("DARK OUTSIDE",if(now() >= relativetime(ph_getsuntime(today(),2), - 600) or now() < ph_getsuntime(today(),1),1,0))
4. Write a macro entitled AUTOLIGHTS UTILITYRM like this
10 JUMP if({DARK OUTSIDE} = 0,999,1)
20 JUMP if(ph_ismacrowaiting("AUTOLIGHTS UTILITYRM") > 0, 999, 1)
30 X-10 UTILITY LIGHTS Preset Dim 15
40 Wait 300
50 X-10 UTILITY LIGHTS Off
5. Write your Trigger to run the above macro (autokills if executed multiple times)
UTILITY5MIN trigger Macro AUTOLIGHTS UTILITYRM Multi-State In triggerID 2 (Zone 2 motion in my case) TriggerValue 9 (that's the off trigger N/C for my Elk)
This sample runs great and frees up tons of rulespace in ELK. Try it and provide feedback. Thanks
-=*Sharby*=-
Edited by sharby - September 02 2007 at 02:53
|