Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome and Elk
 PowerHome Messageboard : PowerHome and Elk
Subject Topic: Auto-Lights via Motions at Night Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
sharby
Groupie
Groupie


Joined: May 13 2007
Location: United States
Online Status: Offline
Posts: 50
Posted: September 02 2007 at 02:47 | IP Logged Quote sharby

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
Back to Top View sharby's Profile Search for other posts by sharby
 

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