Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: ph_createtimedevent not working Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
jpcurcio
Senior Member
Senior Member
Avatar

Joined: April 01 2007
Location: United States
Online Status: Offline
Posts: 119
Posted: November 15 2008 at 13:17 | IP Logged Quote jpcurcio

For some reason I can't get this to work.

I am trying to create a timed event from the trigger of a motion sensor (on or off). I first tried the ph_createtimedevent(), and it always evaluates to "!". Here is what I am using:

ph_createtimedevent(2,ph_insteon("DR TABLE LAMP",ioff, 0),datetime( today(), relativetime( now(), 30 )))

I evaluated the ph_insteon and datetime() statements on their own, and they evaluate to proper values. However, the entire formula evaluation gives me a "!".

Similar behavior with ph_createtimedevent1().

Thanks...

-John

Edited by jpcurcio - November 15 2008 at 13:18
Back to Top View jpcurcio's Profile Search for other posts by jpcurcio
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: November 15 2008 at 13:24 | IP Logged Quote TonyNo

Try...

ph_createtimedevent(2,ph_insteon("DR TABLE LAMP",ioff, 0), string(datetime( today(), relativetime( now(), 30 ))))
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
jpcurcio
Senior Member
Senior Member
Avatar

Joined: April 01 2007
Location: United States
Online Status: Offline
Posts: 119
Posted: November 15 2008 at 15:50 | IP Logged Quote jpcurcio

TonyNo wrote:
Try...

ph_createtimedevent(2,ph_insteon("DR TABLE LAMP",ioff, 0), string(datetime( today(), relativetime( now(), 30 ))))


Still gives a "!" for me...

In the mean time, instead of creating a formula, I created a timed event in this macro, which in turn calls a second macro. That's a little sloppy, though...
Back to Top View jpcurcio's Profile Search for other posts by jpcurcio
 
grif091
Super User
Super User


Joined: March 26 2008
Location: United States
Online Status: Offline
Posts: 1357
Posted: November 15 2008 at 16:02 | IP Logged Quote grif091

The following works on my system. The second parameter of the ph_createtimedevent is a string. The problem with this is that you also need to put the device ID in quotes. Use a single quote around the second parameter of the ph_createtimedevent so that the device ID can be double quoted. The device name is one of my LampLincs because I did not want to alter what I had copy/pasted from a working example.

ph_createtimedevent(2,'ph_insteon("LAMPLINC TEST",ioff,0)',datetime( today(), relativetime( now(), 60 )))

EDIT: reversing the single/double quotes also works.

ph_createtimedevent(2,"ph_insteon('LAMPLINC TEST',ioff,0)",datetime( today(), relativetime( now(), 60 )))


Edited by grif091 - November 15 2008 at 16:09


__________________
Lee G
Back to Top View grif091's Profile Search for other posts by grif091
 
jpcurcio
Senior Member
Senior Member
Avatar

Joined: April 01 2007
Location: United States
Online Status: Offline
Posts: 119
Posted: November 15 2008 at 18:21 | IP Logged Quote jpcurcio

grif091 wrote:
The following works on my system. The second parameter of the ph_createtimedevent is a string. The problem with this is that you also need to put the device ID in quotes. Use a single quote around the second parameter of the ph_createtimedevent so that the device ID can be double quoted. The device name is one of my LampLincs because I did not want to alter what I had copy/pasted from a working example.

ph_createtimedevent(2,'ph_insteon("LAMPLINC TEST",ioff,0)',datetime( today(), relativetime( now(), 60 )))

EDIT: reversing the single/double quotes also works.

ph_createtimedevent(2,"ph_insteon('LAMPLINC TEST',ioff,0)",datetime( today(), relativetime( now(), 60 )))


Bingo!!! Thanks, Lee... got it working now.

-John
Back to Top View jpcurcio's Profile Search for other posts by jpcurcio
 

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