Author |
|
GadgetGuy Super User
Joined: June 01 2008 Location: United States
Online Status: Offline Posts: 942
|
Posted: October 13 2010 at 11:26 | IP Logged
|
|
|
There do not appear to be any posts in the Forum re the creation of timed events. I am trying to turn a light off one minute after it is turned on by a door opening trigger.
I am using the PH function ...
ph_createtimedevent ( 2, "ph_insteon("OUT GAR LITE",ifastoff,0)", today()+60)
But get a Syntax Error. I have tried everything I can think of to clear up the error, but with no luck.
Has anyone used this PH function, or have any suggestions re: syntax?
__________________ Ken B - Live every day like it's your last. Eventually, you'll get it right!
|
Back to Top |
|
|
BeachBum Super User
Joined: April 11 2007 Location: United States
Online Status: Offline Posts: 1880
|
Posted: October 13 2010 at 11:49 | IP Logged
|
|
|
Try this type. Also you should eliminate blanks in names. I use underscore.
ph_createtimedevent1("GAR_LITE_OFF ",1,0,0,1,60,DATETIME(TODAY(),NOW()),0,"OUT_GAR_LITE ","1")
__________________ Pete - X10 Oldie
|
Back to Top |
|
|
GadgetGuy Super User
Joined: June 01 2008 Location: United States
Online Status: Offline Posts: 942
|
Posted: October 13 2010 at 11:50 | IP Logged
|
|
|
Aha!
Got it. I got bitten by the PH dual quote limitation. I used " to delineate the device ID string and also the formula string!
I just changed one of the " quote marks to a ' type and all works well.
Sometimes it is the simple things that are the hardest to find and fix!
__________________ Ken B - Live every day like it's your last. Eventually, you'll get it right!
|
Back to Top |
|
|
BeachBum Super User
Joined: April 11 2007 Location: United States
Online Status: Offline Posts: 1880
|
Posted: October 13 2010 at 11:57 | IP Logged
|
|
|
Your catching on quickly… The other problem with the formula you are using is there is no informational id in the event log. The type I gave you will generate the id you specify.
__________________ Pete - X10 Oldie
|
Back to Top |
|
|
GadgetGuy Super User
Joined: June 01 2008 Location: United States
Online Status: Offline Posts: 942
|
Posted: October 13 2010 at 13:05 | IP Logged
|
|
|
Thanks Pete. I realize that I only get a generic system label on the event but since it is only around for a few minutes and a one-shot event, I decided to go with the simpler ph function so others reading my extensive code library might be able to more readily understand what I was doing.
Hell, as I keep getting older, it may not be too long before I begin to wonder what I heck I did, in looking back over things! Thus I keep trying to keep it simple!
__________________ Ken B - Live every day like it's your last. Eventually, you'll get it right!
|
Back to Top |
|
|