Author |
|
jostim Groupie
Joined: February 12 2007 Location: United States
Online Status: Offline Posts: 45
|
Posted: December 18 2007 at 21:12 | IP Logged
|
|
|
I can't get the command ph_secondsdiffsec to work.
I am trying to make a macro that turns off the lights in the house when nobody is home (or asleep). I have a check on all events that show 'human activity' (lights, IR, motion sensors) and store the time of the latest 'human triggered event'. Every 15 minutes I run a macro that checks if the last human activity is more than 1.5 hours ago. If that is the case, PowerHome turns off most lights.
I would like to use the command ph_secondsdiffsec, because it is smart enough to understand that 00:10:00 is later than 23:55:00. However, I can't get the command to work. I am probably missing something obvious again.
Here is the command I can't get to work:
ph_secondsdiffsec (ph_getglobal_t ("TIME"), now ())
Any suggestions?
- jos
__________________ - jos
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: December 19 2007 at 09:07 | IP Logged
|
|
|
Jos,
Use ph_secondsdiff instead of ph_secondsdiffsec. Apparently, the help file is wrong and the text for ph_secondsdiffsec is really meant for ph_secondsdiff.
ph_secondsdiffsec accepts two double values representing seconds and does the same calculation. In this case, adding 86400.0 to the second parameter if it's less than the first parameter.
HTH,
Dave.
|
Back to Top |
|
|
jostim Groupie
Joined: February 12 2007 Location: United States
Online Status: Offline Posts: 45
|
Posted: December 19 2007 at 22:31 | IP Logged
|
|
|
Dave,
Thanks for your quick answer. Problem solved.
- jos
__________________ - jos
|
Back to Top |
|
|