the routine to write to the serial port for the CM11?
I see cm11.pm with a few places, mostly appear to ack the cm11 response.
I need to prepend to the data that is sent 1: so I can send to the cm11a from =
my bx24's port 1.
Alan
Epson Inkjet Printer FAQ: http://welcome.to/epson-inkjet

> i got so caught up in playing with all of the bells and whistles
> that MH has to offer that i am just now getting around to coding
> my day-to-day lighting schedules and a couple of
> questions have occurred to me.
>
> 1) does MH automatically maintain a record of the state of an
> item so that if i restart MH, it'll know what the states of all
> of my items were before stopping MH?
Yep. In data_dir/mh_temp.saved_states
> 2) since i can only send dim and bright commands to old-school
> X10 devices, is there a function built into MH that'll compare a
> state that i want to set an item to to it's current state
> and figure out what to do to make this transition? (ie if a
> light is at 100% and i want to go to 50% - it'll calculate the
> correct number of dims to send)
We recently put in code to track the light level, via an X10_Item level
method. For example:
print_log "Light level = " . level $light;
I could modify the X10_Item set method to use this and set accordingly if
the request was for an absolute light level (e.g. 0%->100%), but then those
who had the nice 2 way modules would loose the guaranteed accuracy they get
when asking for a preset-dim level.
So, the 2 options I see are to:
- add another parm to X10_Item that tells us what kind of device it is
- add another method, to use with the older devices.
To start with, lets try the 2nd option. To try it, you will need these 2
updates:
http://misterhouse.net:81/mh/lib/X10_Items.pmhttp://misterhouse.net:81/mh/lib/Serial_Item.pm
So with older X10 modules, you can now use a new set_level, instead of set.
For example:
set_level $light ON; # Same same set $light ON
set_level $light '60%';
set_level $light '40%';
Note the dd% states will not work directly from the OFF state, as the normal
X10 module can only dim from ON. If you try it from OFF, the light will
simply be turned on.
Bruce

It should be _very_ simple to get the write's going through the BX24-AHT to the =
CM11A. If I read my BX24-AHT manual correctly, prepending a :1 or :2 or :3 to =
your outgoing serial will cause the command to go to :[port #] on the BX24-AHT.
When I figure out where to put that additional information I expect I can have =
my cake and eat it too!
Alan
>> If we can't write through the BX24-AHT, do we want the BX24-AHT on a
>> separate com port? I have an 8-port serial card in my MH machine, so I
>> have
>> plenty to spare at the moment, but there would be others that don't. This
>> could allow us to send and receive with the CM11A and receive with the
>> BX24-AHT. I like seeing that you immediately have the output of the new
>> module working with the X10 security codes, so I'm impatiently waiting for
>> my Mouser parts to get here.
>> On a related note, does anyone know where I can get just a keypad panel
>> for
>> the X10 security system without having to buy a Monitor Plus kit or a
>> Protector Plus kit from X10? I made the mistake of buying a bunch of the
>> sensors without having the kit, so I don't need more sensors.
Epson Inkjet Printer FAQ: http://welcome.to/epson-inkjet

i got so caught up in playing with all of the bells and whistles that MH has to offer that i am just now getting around to coding my day-to-day lighting schedules and a couple of
questions have occurred to me.
1) does MH automatically maintain a record of the state of an item so that if i restart MH, it'll know what the states of all of my items were before stopping MH?
2) since i can only send dim and bright commands to old-school X10 devices, is there a function built into MH that'll compare a state that i want to set an item to to it's current state
and figure out what to do to make this transition? (ie if a light is at 100% and i want to go to 50% - it'll calculate the correct number of dims to send)
scott reston
scott@...
http://therestons.com/scott

If we can't write through the BX24-AHT, do we want the BX24-AHT on a
separate com port? I have an 8-port serial card in my MH machine, so I have
plenty to spare at the moment, but there would be others that don't. This
could allow us to send and receive with the CM11A and receive with the
BX24-AHT. I like seeing that you immediately have the output of the new
module working with the X10 security codes, so I'm impatiently waiting for
my Mouser parts to get here.
On a related note, does anyone know where I can get just a keypad panel for
the X10 security system without having to buy a Monitor Plus kit or a
Protector Plus kit from X10? I made the mistake of buying a bunch of the
sensors without having the kit, so I don't need more sensors.
Ernie
----- Original Message -----
From: "Alan Womack" <arwbackup@...>
To: "Gaetan linny Lord" <gaetan@...>
Cc: "Majordomo leben.com" <misterhouse-users@...>
Sent: Saturday, March 23, 2002 8:09 AM
Subject: re: [misterhouse-users] Finally , the BX24-AHT code
It occurs to me, looking through the code, that you don't intend to write to
the CM11A through the BX24, and therefore since I have turned off the comm
port for the Cm11a in my ini files it cannot find an output method.
So where would I find the code in MH that writes data out to the CM11A or
the interface so I can start making a modification to use the BX24 as the
gateway to the CM11A?
Alan
Epson Inkjet Printer FAQ: http://welcome.to/epson-inkjet
________________________________________________________
To unsubscribe from this list, go to:
http://sourceforge.net/mail/?group_id65

It occurs to me, looking through the code, that you don't intend to write to =
the CM11A through the BX24, and therefore since I have turned off the comm port =
for the Cm11a in my ini files it cannot find an output method.
So where would I find the code in MH that writes data out to the CM11A or the =
interface so I can start making a modification to use the BX24 as the gateway =
to the CM11A?
Alan
Epson Inkjet Printer FAQ: http://welcome.to/epson-inkjet

I got the code installed into:
f:\misterhouse\mh\lib\X10_BX24.PM
running on windows obviously from the drive letter designation.
Misterhouse seems to receives data from the BX24 just fine.
Misterhouse is complaining it cannot find the interface when I instruct it to =
turn on/off a module:
Error, X10 interface not found: interface=3Dnone, data=3DXA6
Error, X10 interface not found: interface=3Dnone, data=3DXAK
Error, X10 interface not found: interface=3Dnone, data=3DXA6
Error, X10 interface not found: interface=3Dnone, data=3DXAK
03/23/2002 04:51:00 AM: Saving object states ... done
Error, X10 interface not found: interface=3Dnone, data=3DXA6
Error, X10 interface not found: interface=3Dnone, data=3DXAJ
03/23/2002 04:51:27 AM XA6AJ: Office_heater on
] received from BX2487 04
The last line is from my security x-10 motion sensor, I will endevour to figure =
out how to put this into MH over the weekend so it knows what to do with the =
result codes.
Thoughts? I can read the Perl code a whole lot easier now that I have made it =
40 or so pages into the Perl Tut from Robert. I still get lost in the calls to =
MH's routines.
>> So, test the code, and if there is any problem, please send the
>> output/error
>> message.
Epson Inkjet Printer FAQ: http://welcome.to/epson-inkjet

Hi,
Finally got home, and rebuild my computer
Here's the code to use the BX24 with misterhouse. At least it does the job
for me with Linux. I include 2 files in attachment, the first one is the
module, and the second one is my program to deal with the barometric pressure.
I don't know if there will be a new release this week-end, I would like to
not include this code with this release for 2 reasons.
- 2 person ask me for the code, so they are officially the beta tester
- secondly, and the most important, it is not documented, and there is
few people who deserve the have their name include in the comment,
after all, my code is based on their work.
The code is based on the MR26 code.
Copy the file X10_BX24.pm in the same directory as the X10_MR26.pm module
Add the following parameter to mh.private.ini
BX24_module = X10_BX24
BX24_port = /dev/ttyS1 # set the port
You have to define all your X10 device like any other X10 modules, this module
will rewrote the X10 signal in the way misterhouse work with, so all the
code based on CM11A should work.
The code also work with the BX24 Barometric pressure option.
In the example file BX24.pl, I read the pressure every 5 minutes, keep it in
a Round Robin database, not the misterhouse one, I wrote mine. This will show
you how I deal with the Barometric pressure, and how I create a graph. Note
again, this code is based on a prior post from someone, I forget his name
sorry, who send e-mail on how he produce graph of his pond temperature (Thanks)
So, test the code, and if there is any problem, please send the output/error
message.
--
--
----------------------------------------------------------------------
Gaetan Lord - FTA - gaetan@... - SGI - Montreal, Canada
pager: gaetan_p@... (200 car. max)
"There is no future in time traveling"
----------------------------------------------------------------------
11:36pm up 43 days, 10:39, 12 users, load average: 0.07, 0.02, 0.00

> Thank you for the ability to play with such a powerful program. Also,
> thanks for such a quick response.
> Funny, I'm Rochester, as well... Rochester, NY that is. :)
Yeah, thats the Rochester that all my stuff gets inadverantly mailed to :)
> > You were close :) We have a built-in short cut for X10 stuff given to
> > &process_external_command (used by telnet, and mh/bin/house), so you can
> > simply type X10 codes directly. For example, to turn hc=O device=7 on,
> > type:
> >
> > XO7OJ O 7 ON
> > XA1AK A 1 OFF
> > XOAOL O 10 Bright
> > XOGOM O 16 Dim
>
> I tried to telnet in and issue the above commands, and received
> unrecognized command responses. I tried to issue it with the SET command,
> and it accepted it in the telnet window, but the console (./mhl)
> displayed
> an error.
Sorry, I only ment for you to type in the first part. For example:
----------
Welcome to Mister House Socket Port 1
Run set_password to create a password. Global authorization enabled until
then
XO7OJ
Command executed: XO7OJ
-----------
> port. In order to offer the user of the OCX a list of valid X10 objects I
> needed to get the list that I programmed out of it. I found that:
>
> list X 10 Devices
>
> does this, *except* the output of the command is sent to the console, not
> the telnet session as I expected.
> Would integrating to MH be best on another protocol/port, or is
> the telnet server mature enough?
You can pretty easily write your own command to echo the list to your port.
The 'list x10 items' command is in mh/code/common/mh_control.pl
Other examples of sending/receiving commands via a socket are in
mhsend_server and mh/code/public/voice_client.pl and voice_server.pl
> > As you discovered, you can also set objects dirctly. Valid states for
> > X10_Items are listed near the top of mh/lib/X10_Item.pm. We have these
> > constants defined, so you can avoid having to quotes strings:
>
> Set objects directly? Are you referring to the $Master_Steve_Light object
> variable, for example?
Yes: set $object $state.
Bruce

Bruce,
Thank you for the ability to play with such a powerful program. Also,
thanks for such a quick response.
Funny, I'm Rochester, as well... Rochester, NY that is. :)
Please see my comments below...
On Fri, 22 Mar 2002, Bruce Winter wrote:
> > I'm reasonably new to MH, and am not a Perl programmer. I am
> > professionally a JavaScript programmer, and the syntax looks very
> > similar. I have it setup and running on my Linux box, with a CM11a
> > controller. I configured a few lights in X10_test.mh?. I can now
> > telnet to
> > localhost:1234 and type:
> >
> > set $Master_Fan_Light ON
> >
> > and the light does indeed turn on.
> > However, I'm looking for a way to send an X10 command to any device,
> > whether I've defined a Perl object or not.
> > I've tried: set XB1 ON, but this doesn't work.
>
> You were close :) We have a built-in short cut for X10 stuff given to
> &process_external_command (used by telnet, and mh/bin/house), so you can
> simply type X10 codes directly. For example, to turn hc=O device=7 on,
> type:
>
> XO7OJ O 7 ON
> XA1AK A 1 OFF
> XOAOL O 10 Bright
> XOGOM O 16 Dim
I tried to telnet in and issue the above commands, and received
unrecognized command responses. I tried to issue it with the SET command,
and it accepted it in the telnet window, but the console (./mhl) displayed
an error.
>
> > I have found a list of "disabled_commands" in a file of the same name.
> > However, I have no idea where to look for a list of ALL commands that can
> > be sent and their expected syntax. I have done various web searches with
> > no valuable information about MH's commands, besides Perl code.
>
> One way to get a list of all commands is to use the web Search 'Voice
> Command' box and simply hit enter without entering a search string.
I did this, and found it helpful! Thanks!
I think I found a bug (oh no!) though. (as you can see, I'm using ZOC
to type this. LOL) The main reason that I was asking about this, is
because I'm writing an OCX for use in other VB programs as an easy way to
interface to MH. I currently have it setup to talk to it on the telnet
port. In order to offer the user of the OCX a list of valid X10 objects I
needed to get the list that I programmed out of it. I found that:
list X 10 Devices
does this, *except* the output of the command is sent to the console, not
the telnet session as I expected.
Would integrating to MH be best on another protocol/port, or is the telnet
server mature enough?
>
> As you discovered, you can also set objects dirctly. Valid states for
> X10_Items are listed near the top of mh/lib/X10_Item.pm. We have these
> constants defined, so you can avoid having to quotes strings:
Set objects directly? Are you referring to the $Master_Steve_Light object
variable, for example?
>
> use constant ON => 'on';
> use constant OFF => 'off';
> use constant DIM => 'dim';
> use constant TOGGLE => 'toggle';
> use constant STATUS => 'status';
> use constant OPEN => 'open';
> use constant CLOSE => 'close';
> use constant OPENED => 'opened';
> use constant CLOSED => 'closed';
>
>
> Bruce
Thanks again for a quick response! Have a great night!
-Steve
--

> I'm reasonably new to MH, and am not a Perl programmer. I am
> professionally a JavaScript programmer, and the syntax looks very
> similar. I have it setup and running on my Linux box, with a CM11a
> controller. I configured a few lights in X10_test.mh?. I can now
> telnet to
> localhost:1234 and type:
>
> set $Master_Fan_Light ON
>
> and the light does indeed turn on.
> However, I'm looking for a way to send an X10 command to any device,
> whether I've defined a Perl object or not.
> I've tried: set XB1 ON, but this doesn't work.
You were close :) We have a built-in short cut for X10 stuff given to
&process_external_command (used by telnet, and mh/bin/house), so you can
simply type X10 codes directly. For example, to turn hc=O device=7 on,
type:
XO7OJ O 7 ON
XA1AK A 1 OFF
XOAOL O 10 Bright
XOGOM O 16 Dim
> I have found a list of "disabled_commands" in a file of the same name.
> However, I have no idea where to look for a list of ALL commands that can
> be sent and their expected syntax. I have done various web searches with
> no valuable information about MH's commands, besides Perl code.
One way to get a list of all commands is to use the web Search 'Voice
Command' box and simply hit enter without entering a search string.
As you discovered, you can also set objects dirctly. Valid states for
X10_Items are listed near the top of mh/lib/X10_Item.pm. We have these
constants defined, so you can avoid having to quotes strings:
use constant ON => 'on';
use constant OFF => 'off';
use constant DIM => 'dim';
use constant TOGGLE => 'toggle';
use constant STATUS => 'status';
use constant OPEN => 'open';
use constant CLOSE => 'close';
use constant OPENED => 'opened';
use constant CLOSED => 'closed';
Bruce

Community

Help

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

I agree to receive quotes, newsletters and other information from sourceforge.net and its partners regarding IT services and products. I understand that I can withdraw my consent at any time. Please refer to our Privacy Policy or Contact Us for more details