Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: Timed Events Macro Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
JTWise
Newbie
Newbie
Avatar

Joined: August 19 2004
Location: United States
Online Status: Offline
Posts: 6
Posted: August 10 2005 at 15:44 | IP Logged Quote JTWise

Hi all:

I am a complete noob at programming so I was hoping that you could help me here.

When I travel, I use the Control Center via the web interface to edit and create events, etc. Occasionally I will forget to turn Timed Events on in Powerhome before I leave town. While I obviously can add and edit timed events from the road, I see no way of actually turning Timed Events on or off via the Web. Maybe this could be done via a Macro?
Back to Top View JTWise's Profile Search for other posts by JTWise
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: August 10 2005 at 20:36 | IP Logged Quote dhoward

JT,

You can do it with the simple formula below (placed in a macro, formula button, etc):

ph_switchto(" PowerHome ",1) + ph_sendkeys("{alt+F5}{alt+tab}")

However, this will not work if you have past due timed events. When you have past due timed events and "Timed Events" are toggled on, you'll get a message box asking if you wish to "Execute Timed Events". This halts all PowerHome processing and eliminates the possiblity of just using a send keys to answer the message box.

Soooo....I'll put together some functions in the next beta that will allow you to control this processing as well as query the current status.

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
JTWise
Newbie
Newbie
Avatar

Joined: August 19 2004
Location: United States
Online Status: Offline
Posts: 6
Posted: August 14 2005 at 00:42 | IP Logged Quote JTWise

Thanks Dave. I tried to build the formula a month or so back and just couldn't get it working. It is working now, even if it is a bit limited due to the past events problem. Thanks for making the change in the next beta. The more I learn about this stuff the more timed events I seem to have.
Back to Top View JTWise's Profile Search for other posts by JTWise
 
JTWise
Newbie
Newbie
Avatar

Joined: August 19 2004
Location: United States
Online Status: Offline
Posts: 6
Posted: October 25 2005 at 16:03 | IP Logged Quote JTWise

Sorry to revive my old thread but I have another question along the same lines. I have been adding various timed events and I now have two distinctive types of timed events - those that I run when I am home (alarm clock, etc), and those that I run when I am out of town (simulated lighting scenarios to make it look like I am home). I usually only want one type of event class to run on any given day.

My solution thus far has been to manually change the time of the timed events I don't want to run to a date in the future, then manually change them when I want to switch. I am looking for an easier solution. I have 2 ideas and hopefully everyone else can supply some other solutions.

1. Can I do this with a Global Variable of "Home/Away" and then compare as the first line of a macro? I think this would work but I would need to edit and probably duplicate some of my macros. This might also come in handy when I get around to making my X-10 "Security System."

2. As a feature request, have the ability to group sets of timed events and be able to toggle each group individually on/off in the "Timed Events On" (i.e. the timed events would have multiple toggles, one for each subgroup). I like the thought of this because then it would make it easier to visually see which events belong to which groups.

Anybody else implementing a different solution? I would love to hear your thoughts.
Back to Top View JTWise's Profile Search for other posts by JTWise
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: October 25 2005 at 22:50 | IP Logged Quote TonyNo

I have an Away flag that I set. At the start of some macros, I check it, and if the flag is not set, I exit.

I do think an enable bit, as in the triggers, would be a nice addition to timed events.
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: October 26 2005 at 22:15 | IP Logged Quote dhoward

JT,

I currently use the system like Tony and your option 1. I use a global variable to flag a certain state and then conditionally execute my macro. THis check is typically done in the first line of my macro.

Now as another possibility, if you don't want to modify your macros and have some duplicates, you could put the check in the Timed Event itself. Instead of making the action a "Macro", make the action a "Formula" and then you something like:

if([AWAYFLAG] = 1,ph_macro("AWAY MACRO"),0)

This might ease the pain a bit.

I also like Tony's idea of an enable type field. To achieve the functionality like you would like, I would really need to create an ID field for the Timed Events and Ive been staying away from that so far because of the ability to dynamically create timed events. However, even with an "enable" flag, would it be best that the timed event is never executed (and the time never rolled forward) or should the timed event still execute with the action never being performed but the time still being moved forward?

Another possibility would be to have the actions as formulas and then include a comment within the action which you could use to programmatically update the timed event in SQL. Something like:

TImed Event action: /*AWAY*/ ph_macro("AWAY MACRO")

SQL to roll all AWAY timed events forward 2 days:

ph_directsql("update timedevents set starttime = dateadd(day,2,starttime),reftime = dateadd(day,2,reftime) where action like '/*AWAY*/%'")

PS. I bet Tony is going "I didnt know you could do that!!"

HTH,

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: October 26 2005 at 23:07 | IP Logged Quote TonyNo

Using the enable bit, maybe have only the next event blocked? Nah, seems like disabled should be disabled, and the user would need to reset it.

That SQL works now?! You can use embedded comments?! And select on them?! I need to learn SQL...
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
JTWise
Newbie
Newbie
Avatar

Joined: August 19 2004
Location: United States
Online Status: Offline
Posts: 6
Posted: October 27 2005 at 16:49 | IP Logged Quote JTWise

Thanks for the quick replies. I implemented the Global "away" Variable and updated all of my macros. It was less time consuming than I thought it would be, plus I think it is a simple method that I can use with the "Alarm System" I plan on implementing using some motion detectors, emails, and maybe a powerhorn and webcam. We will see how it goes, I might try one of the other methods Dave suggested and see how it works. For now, I am going with the Keep It Simple Stupid methodology.

Powerhome's flexibility is both a blessing and a curse. I love the fact that there are multiple solutions for problems and that it is so scalable. However, it does make for a bit of a barrier of entry for Noobs like me. Fortunately the barriers are eased by the personal support you guys give in the forums. I appreciate the hand holding.

Keep up the great work.
Back to Top View JTWise's Profile Search for other posts by JTWise
 

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