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

Joined: April 11 2007
Location: United States
Online Status: Offline
Posts: 1880
Posted: October 23 2009 at 11:00 | IP Logged Quote BeachBum

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 View BeachBum's Profile Search for other posts by BeachBum
 
jbbtex
Senior Member
Senior Member


Joined: February 15 2007
Location: United States
Online Status: Offline
Posts: 181
Posted: October 25 2009 at 00:20 | IP Logged Quote jbbtex

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

Joined: June 01 2008
Location: United States
Online Status: Offline
Posts: 942
Posted: December 15 2010 at 17:40 | IP Logged Quote GadgetGuy

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 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