Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome General
 PowerHome Messageboard : PowerHome General
Subject Topic: X-10 status request Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
RWCS
Senior Member
Senior Member
Avatar

Joined: October 28 2002
Location: United States
Online Status: Offline
Posts: 102
Posted: October 28 2002 at 10:47 | IP Logged Quote RWCS

Given X-10s inherent unreliability I’m trying to write a verification routine, which verifies the status of an x-10 target. I’m using X-10 PRO PAM21 modules. My problem is that if the module doesn’t respond (test = unplugged) the [X10STAT??] system variable reports last status. How do I verify that the last status request actually had a corresponding response?

This is my first question, so please don’t get upset if this is the wrong forum or format . . .


__________________
RWCS LLC
Back to Top View RWCS's Profile Search for other posts by RWCS Visit RWCS's Homepage
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: October 28 2002 at 13:17 | IP Logged Quote dhoward

Bob,

The [X10STAT??] system variables only report what PowerHome thinks the status should be which would be either from commands it received on the Powerline or commands that it issued.  There is no built in facility which verifies that the module actually "heard" the command.

I wasn't familiar with the PAM21 so did a quick search on the net and see that it is a two-way 2-pin appliance module.  I know that most 2-way modules can be polled for their status or can be set to automatically send a "confirmation" that the command was applied.  If you would like to "verify" that the module actually responded to the command, you should be able to create a trigger on "X-10 Out" for the modules in question and have an action that then polls the module and sets the status appropriately.  You could probably do this several different ways based upon how the PAM21 reports that it properly received a command.  Im thinking that you could create a trigger on outgoing X-10 that would use the ph_x10setstat function to set the status to unknown or some other value that would represent that you're not sure what the status is (this will directly affect the [X10STATUS??] variables), then have a trigger fire on incoming X-10 which corresponds to the PAM21's verification and then use the ph_x10setstat to set the modules status appropriately. 

If you could provide me with a little more info on what the PAM21 does to verify that it heard a command properly, I can probably put together a way for you to verify the status.

Dave.

 

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

Joined: October 28 2002
Location: United States
Online Status: Offline
Posts: 102
Posted: October 28 2002 at 15:45 | IP Logged Quote RWCS

There is precious little info I've found on what any X-10 device does. . . Everything I think I know is found empirically.  This particular device (X-10s PAM21) will respond to a "Status Request" like this:

X-10 controller 1 transmission of House code: C, Command: Status Request

Incoming X-10 received on controller 1. Byte Values: 02 01 2D  Decode:  C{Status On}

If and when it responds the [X10STAT??] sets to the correct value.  The question is how did you know it responded?  If it doesn't respond (ie you unplug the module) the "Status" request goes out nothing comes back and [X10STAT??] is unchanged.  (seems to me the system should set the [X10STAT??] to "UNK" when the "Status Request" is sent and update it if and when it gets a response)

I have been unable the change [X10STATC6] to a "0" with this formula ph_x10setstat( 0, 'C', 6, 0, 0 ), I'm at a loss as to were to go from here.

Bob



__________________
RWCS LLC
Back to Top View RWCS's Profile Search for other posts by RWCS Visit RWCS's Homepage
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: October 28 2002 at 16:47 | IP Logged Quote dhoward

Bob,
 
I looked over my earlier message and realized that the ph_x10setstat would'nt set it to unknown.  But did play around and you can get the effect with direct SQL.  What I would do is create a trigger for X-10 Out for both C6 On and C6 Off.  Use direct SQL and set the status to unknown.  Send an X-10 status request for the device and then wait for the status to come back.  You don't have to create a trigger for the status request because if you request the status and it comes back, it will automatically update the status.  As an example, here is a Send Keys command for the X-10 Out for the C6 On or Off:
 
ph_rtne(ph_directsql("update x10unitcode set status = 0 where id = 'C' and code = 6") + ph_x10refreshstat() + ph_x10(1,"C",6,0) + ph_x10(1,"C",15,0))
 
This will directly set the status to "Unknown", refresh your status screen and automatically send the code to request a status from the C6 device (the ph_x10 commands assume you are using controller 1).
 
A list of X-10 commands is:
 
 All Units Off                                  00
 All Lights On                                 01
 On                                               02
 Off                                               03
 Dim                                             04
 Bright                                          05
 All Lights Off                                06
 Extended Code                            07
 Hail Request                                08
 Hail Acknowledge                         09
 Pre-set Dim (1)                            10
 Pre-set Dim (2)                            11
 Extended Data Transfer                12
 Status On                                   13
 Status Off                                   14
 Status Request                           15
 
Let me know if the above works out for you.
 
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