Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: Creating Timed Event Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
GadgetGuy
Super User
Super User
Avatar

Joined: June 01 2008
Location: United States
Online Status: Offline
Posts: 942
Posted: October 13 2010 at 11:26 | IP Logged Quote GadgetGuy

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 View GadgetGuy's Profile Search for other posts by GadgetGuy
 
BeachBum
Super User
Super User
Avatar

Joined: April 11 2007
Location: United States
Online Status: Offline
Posts: 1880
Posted: October 13 2010 at 11:49 | IP Logged Quote BeachBum

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 View BeachBum's Profile Search for other posts by BeachBum
 
GadgetGuy
Super User
Super User
Avatar

Joined: June 01 2008
Location: United States
Online Status: Offline
Posts: 942
Posted: October 13 2010 at 11:50 | IP Logged Quote GadgetGuy

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 View GadgetGuy's Profile Search for other posts by GadgetGuy
 
BeachBum
Super User
Super User
Avatar

Joined: April 11 2007
Location: United States
Online Status: Offline
Posts: 1880
Posted: October 13 2010 at 11:57 | IP Logged Quote BeachBum

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 View BeachBum's Profile Search for other posts by BeachBum
 
GadgetGuy
Super User
Super User
Avatar

Joined: June 01 2008
Location: United States
Online Status: Offline
Posts: 942
Posted: October 13 2010 at 13:05 | IP Logged Quote GadgetGuy

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 View GadgetGuy's Profile Search for other posts by GadgetGuy
 

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