Author |
|
BeachBum Super User
Joined: April 11 2007 Location: United States
Online Status: Offline Posts: 1880
|
Posted: October 23 2009 at 11:00 | IP Logged
|
|
|
I can delete a queued Timed Event by using PH_DIRECTSQL("DELETE FROM TIMEDEVENTS WHERE FREQUENCY = 0 AND ACTION = 'INSTEON_RECOVERY'"). It works fine if the event was created in a macro from the Command pull down but if I create a Timed Event using ph_createtimedevent1("INSTEON_RECOVERY",1,0,0,1,1,DATETIME(T ODAY(),NOW()),0,"INSTEON_RECOVERY","1") then I cannot delete the event. Anyone got a work around?
__________________ Pete - X10 Oldie
|
Back to Top |
|
|
jbbtex Senior Member
Joined: February 15 2007 Location: United States
Online Status: Offline Posts: 181
|
Posted: October 25 2009 at 00:20 | IP Logged
|
|
|
Maybe this will help.
Here's I macro I use:
Code:
10 jump if(ph_modifytimedevent("DRIVEWAYOFF", 1, ph_relativedatetime(today(), 30), 4) = 0, 2, 1)
20 formula ph_createtimedevent1("DRIVEWAYOFF", 1, 0, 0, 0, 0, ph_relativedatetime(today(),30),2,'ph_in steongroupcu("DRIVEW AY", "DRIVEWAY", 19)', "1"
30 end macro |
|
|
This tries to modify the Timed Event "DRIVEWAYOFF" and if successful terminates the macro. If not, it creates the Timed Event "DRIVEWAYOFF"
Rather than deleting INSTEON RECOVERY, you could use this method to set it Inactive or to an execution time in the past (if that's allowed).
Just tested it and you can set the execution time to the past but it executes the Timed Event immediately.
Is there a way to just delete this post?
Edited by jbbtex - October 25 2009 at 12:35
__________________ Brady
"Never tell people how to do things. Tell them what to do and they will surprise you with their ingenuity." - Gen. George S. Patton
|
Back to Top |
|
|
GadgetGuy Super User
Joined: June 01 2008 Location: United States
Online Status: Offline Posts: 942
|
Posted: December 15 2010 at 17:40 | IP Logged
|
|
|
This is a bit late (a year after the initial posting above) but to help others with the same issue, the way to delete a Timed Event is to use a PH SQL direct control function . . .
Code:
ph_directsql(“delete from timedevents where id = ‘YourTimedEventID’”) |
|
|
This indirect approach is required as there is no way (currently) to Modify the event to delete it [that will be fixed in a next SW release].
NOTE that since the phdirectsql() function requires quotes on the command string AND the Timed Event ID must also be a string this ID must use the single(') quote character as PH does not allow nesting of the same quote character.
The syntax for putting a string inside a string is as follows...
Start the outer string with a single or double quote and the inner string the opposite,
" ' ' " or
' " " '
Edited by GadgetGuy - December 15 2010 at 19:13
__________________ Ken B - Live every day like it's your last. Eventually, you'll get it right!
|
Back to Top |
|
|
|
|