Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: Is it possible to trigger on ANY X10-In? 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: October 30 2006 at 21:37 | IP Logged Quote onhiatus

I'm trying to get a time stamp for the last time that the overall x10 state may have changed (by "overall" I mean any x10 device may have changed).

The way I thought to do this was to have a macro that sets a global variable to the current time whenever and X10 command comes in or out.

Unfortunately there does not seem to be a way to set a trigger on any X10 in.

Can anyone think of an efficient way to get the last time any X10 device changed state? I say efficient because I'm not willing to call ph_getx10dt for each device.

Suggestions? Thanks, Tony
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: October 31 2006 at 11:06 | IP Logged Quote dhoward

Tony,

You could do it with triggers, but you would need 32 total (1 for each housecode for both "X10 in" and "X10 Out"). It doesnt hurt to have alot of triggers. Most people thinks it will slow the system but due to the database design, it's actually quite efficient. However, it will be a PITA to create them all.

If you go this route, I would trigger on "Any (Before Buffer)" and "Addressed". You could then have each of these triggers update global variable with the current date and time.

You can also just get the latest timestamp of an X10 device change by using the following formula:

Code:
ph_sqlselectinto(1,"select max(lastchange) from x10devices")


When this formula runs, the [LOCAL1] variable will contain the most recent X10 device status change datetime (alot better than calling ph_getx10dt for each device ).

HTH,

Dave.


Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
onhiatus
Senior Member
Senior Member
Avatar

Joined: May 12 2004
Location: United States
Online Status: Offline
Posts: 279
Posted: October 31 2006 at 20:36 | IP Logged Quote onhiatus

Just posted a long reply that caused an internal server (HTTP return 500) error and got lost.

Short jist was perfect answer! Thanks.

Also is there any documentation of the ph database structure? What tables are where? Etc.

Thanks, Tony
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: November 03 2006 at 17:33 | IP Logged Quote dhoward

Tony,

In the appendix of the manual are the table list and structures but it's out of date. Check this thread for methods using the PowerHome Multi-Editor http://power-home.com/forum/forum_posts.asp?TID=926

HTH,

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