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
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.