Author |
|
groston Newbie
Joined: November 05 2007 Location: United States
Online Status: Offline Posts: 16
|
Posted: November 01 2008 at 19:30 | IP Logged
|
|
|
All,
I have a very simple set of commands programmed in PH. Basically, my devices turn on/off at fixed times or relative to sunrise/set. To accomplish this, I have timed events, with each event firing a macro that makes the specific device turn on/off.
I would like to 'get fancy'. I would like one of my devices to come on at sunset (know hoe to do this) and turn off at the later of 9:00 pm or 30 minutes after sunset. I suspect that formula is needed, but it seems that a trigger is needed as well. (Why? Because it seems as if the formula is a simple timed event, then this cannot be accomplished.)
Kindly provide some suggestions for doing this.
p.s. Still running V1.02.4.12. Tried the V2.0.0 beta, but got a pile of errors after launching, so backed down to the previous version.
__________________ Gerald P. Roston
gerry (at) pairofdocs (dot) net
|
Back to Top |
|
|
grif091 Super User
Joined: March 26 2008 Location: United States
Online Status: Offline Posts: 1357
|
Posted: November 02 2008 at 12:55 | IP Logged
|
|
|
Add this as a Formula in the Macro that turns On the light you want to turn Off at 21:00 or Sunset+30 minutes, whichever is later. You mentioned you already had Macros to turn the devices On and Off so I create a timed event which invokes a Macro. Change MXXXX to the name of the macro that turns Off the device. After running the macro containing this Formula, select Control, PowerHome Status to view the newly created timed event. This was created and tested on PH 2.0.0 but I don't think any of this is based on 2.0.0 function.
ph_createtimedevent(0,"MXXXX",datetime(date(today()),if (relativetime(21:00:00,0) > relativetime(00:30:00,[SUNSET]),relativetime(21:00:00,0),relativetime(00:30:00,[SUNSET]))))
Edited by grif091 - November 11 2008 at 16:31
__________________ Lee G
|
Back to Top |
|
|
groston Newbie
Joined: November 05 2007 Location: United States
Online Status: Offline Posts: 16
|
Posted: November 11 2008 at 15:41 | IP Logged
|
|
|
grif091,
Thanks for the help. Seems there is a missing ), but after playing around, I figured this out. Works exactly as needed.
__________________ Gerald P. Roston
gerry (at) pairofdocs (dot) net
|
Back to Top |
|
|
grif091 Super User
Joined: March 26 2008 Location: United States
Online Status: Offline Posts: 1357
|
Posted: November 11 2008 at 16:45 | IP Logged
|
|
|
There sure is, sorry. I fixed my original post. If you put anything that you get off a forum under the Formula Builder it is an easy way to verify results. Not all formulas can be tested this way but the Formula Builder also has the nice feature of pairing up constructs as you move the cursor across the formula. The first open paren would have been highlighted in red as the cursor was moved to that position indicating there was not a corresponding closing paren. Might save you some pain the next time I make a mistake in a post.
Edited by grif091 - November 11 2008 at 16:47
__________________ Lee G
|
Back to Top |
|
|
|
|