mdog has asked for the wisdom of the Perl Monks concerning the following question:

Brethern --

I want to use ControlX10::CM11 to check the status of different appliances I have in my house but don't need the full blown coolness of misterhouse.

So using ControlX10::CM11 I am able to turn devices on and off quite easily but am having a hard time querying the status of a device. The best documentation that I can find for the STATUS command is here.

I think I am executing the command OK (cuz it doesn't complain about the function being non-existant) but when I try to get the actual return value...there is nothing there. I just prints out blank lines.

So I looked at the function check_for_cm11_data in the main code of misterhouse and it looks like data should actually have a value in it.

Is anybody else doing something like this? If you could post some code showing the request for STATUS and then the actually grabbing of that STATUS return, I'd be very grateful. Or if someone knows of anyplace that talks about using the STATUS command, that would help, too!

I've looked at the function check_for_cm11_data in the main misterhouse code and it looks like there should be something in $data but since I don't know how to call the STATUS command (for sure), I'm doubting myself.

Thanks in advance,
mdog

Here's the code:
use ControlX10::CM11; # $serial_port is an object created using Win32::SerialPort # or Device::SerialPort depending on OS # my $serial_port = setup_serial_port('COM10', 4800); # This works fine...I can turn things on and off #&ControlX10::CM11::send($serial_port, 'C1'); # Address device C1 #&ControlX10::CM11::send($serial_port, 'CJ'); # Turn device ON &ControlX10::CM11::send($serial_port, 'C1'); # Address device C1 &ControlX10::CM11::send($serial_port, 'CSTATUS'); # Query C1 for its s +tatus #&ControlX10::CM11::send($serial_port, 'CSTATUS_ON'); # Check if devic +e is on?? #&ControlX10::CM11::send($serial_port, 'CSTATUS_OFF'); # Check if devi +ce is off?? $data = &ControlX10::CM11::receive_buffer($serial_port); print "$data\n"; # always prints blank lines $data = &ControlX10::CM11::read($serial_port, $no_block); print "$data\n"; # always prints blank lines

Replies are listed 'Best First'.
Re: Device Status with ControlX10::CM11
by jasonk (Parson) on Mar 28, 2003 at 20:26 UTC

    Are you sure you are using compatible hardware? The majority of X10 controllers don't support status. The easiest way to tell is by how much you paid, a regular X10 appliance module is around $10(US), the two-way ones are generally closer to $40.


    We're not surrounded, we're in a target-rich environment!
      Now that, I wasn't aware of...

      All I have to say is "Duh"! Thanks, jasonk, I have been knocking myself out trying to figure out why I wasn't getting anything back.

      I didn't see that in any of the documentation I was looking at but if you look at one of the two-way modules on x10's site, it makes perfect sense.

      Merci,
      mdog