MisterHouse configuration is a bit of a mess. Even as a software enginner it took me some to to understand what is happening. But having said that I have used it in many ways that the other systems can not even come close to. The fact that it is so open and perl is such a basic language makes it even more cuirious to work with but very flexable.
For WOT its worth, I have used it for home automation, it sends me sms message of traffic reports, to do lists and even updated shopping lists. I get my daily earthquake, weather and news read to me 20 minutes after I get home and that saves me from flipping news channels. My parents are not computer savvy so they just need to turn the dam thing on and it spits out emails and pictures of the kids. Voice recognition is basic but it is what it is. My current project is to automate my patio with fully automated hydroponics growing fresh organic veggies with little or no labor or dirt (I hate dirt). Since my background is advanced automation and robotics it helps with the logic parts and my friends with green thumbs do the rest of the planning. The point is why automat a switch? I have the energy to turn a switch on.
Home will automation will grow, as fast a touch screens have in just the last few years, and this is the next largest green push item. But its like the 70s pc era right now and to get there it must fill a need rather then invent some new tasks. Like where the hell, is the remote
Right now my son wants it to populate his twitter page while he watches a movie while chatting with 10 friends all in their own homes ( cost savings on snacks and spilled soda). Is this home automation? you bet it is. Think long polling, sms and Ajax and you may see the future
As for your original question, the docs are a mess and so are the tutorials; I am even considering a port to mysql to make management more reasonable.
But here is why the thing keeps turning the light on and off, its coded as a test, that’s all, to show you how it operates, but since they assume you read all the code first, then decide, lots walk away in fear of touching it at all.
The code is in a file /code/test called test_x10.pl
# Toggle the light on/off every 30 seconds
if ($New_Second and !($Second % 30)) {
my $state = ('on' eq state $test_light1) ? 'off' : 'on';
set $test_light1 $state;
my $remark = "Light set to $state";
print_log "$remark";
# speak $remark;
}
All the code does when started ( which also makes it very learn and fast with little memory/cpu ) is as follows
1: Read config files and initialize things you set in mh.ini and mh.private.ini
2: Read and evaluate/compile the user event code into the mh_temp.user_code file:
>That includes all the .pl files in its path. A better design here might be a calling function, but this is it, the rest can be call by time or other events.
Finally
3: Loop until exit, each pass executing:
Set global time/date variables
Check for voice commands
Read/write socket data
Read/write serial data
Check for timers actions
Check for external command files
Evaluate the &user_loop function
Here is test_x10.pl being called to evaluate its time and then respond if needed.
Sleep for a while (default is 100 milliseconds), so mh does not hog the CPU.
Beyond that is just writing some foo.pl code to do something and give it an evaluator like
get read say do something. Then activate it, so that it’s called into the user_loop functions and add an event for it with a time, or put that in the code so it will create its own event that you can modify later. If there is an error, it will beep and show you the error. There really is not much else to do. Any thing perl can do you can add.
The rest is setting up x10 devices and other config items like you location and zip and such. As for the emerging standards, open source code like this wont hold you back from adapting , you just include the drivers some one has to write to test the product.