Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Feature Requests
 PowerHome Messageboard : PowerHome Feature Requests
Subject Topic: Function to return time on Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
onhiatus
Senior Member
Senior Member
Avatar

Joined: May 12 2004
Location: United States
Online Status: Offline
Posts: 279
Posted: April 06 2005 at 16:24 | IP Logged Quote onhiatus

It seems like it might be useful to have a Time on function that when given an X10 device would calculate how much time that device had been on. It'd imagine the function taking a time parameter so you could specify the last day, week, month, forever. A similar function (or the same one) could be used for the number of times the device was turned on.

ph_calculateDeviceOn(HouseCode, UnitCode, start, end)

Easiest way might be to use the log to calculate... that would limit the calculations to the range of the log.

Just a thought.
Back to Top View onhiatus's Profile Search for other posts by onhiatus Visit onhiatus's Homepage
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: April 11 2005 at 15:00 | IP Logged Quote dhoward

Hmmm...Ive been giving this some thought and Im not sure if it could be easily implemented.

One way, as you suggest would be to use the eventlog. Im not sure how useful it would be though if you are trimming your evenlog at regular intervals (I only keep the last two days in mine). If the interval isnt a big issue, the next problem would be parsing the log. Depending upon the controller that did the turning on or turning off, the eventlog would have to be parsed differently. For example, if you were using the CM17A, then the "on" command is generated within a single eventlog record. However, if you were using a controller such as the CM11A (or most others), then the "on" command would be a minimum of two events. One for the address command, the second for the "on" command. Also, each controller outputs a slightly different format for the eventlog that would have to be accounted for.

Another approach would be to just build it into the software. The problem with this approach would be the additional overhead required to keep the information properly updated with each X-10 command. Might need additional parameters to tell PowerHome if you only want to track on a single controller vs multiple controllers, only outgoing X-10 vs both incoming and outgoing, etc.

The last way would be to put together some triggers and GV's and monitor it using code. Im not sure if it's doable, but I'll see if I can put something together that will serve in the interim.

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

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