How to integrate Housebot with Meedio Essentials
Posted: Fri Apr 21, 2006 6:32 pm
Not sure how many are doing this already but I have never been able to find a guide on how to integrate Housebot with Meedio, I have now managed to get this working successfully and thought others trying to do a similar thing may appreciate some info on how I did it. The integration is based around my home cinema system.
I have set things up so that Housebot keeps track of when Meedio video or music players are Playing, Paused or stopped, and to run tasks when I press these buttons on my remote control.
So for example if I press Pause on my remote, it will run a housebot task which checks the current status of the player (Paused, Stopped or Playing), if it is already Paused or stopped it will do nothing, if it is playing it will send a Pause to Meedio Essentials and bring the lights up 10% and the current status will be set to ‘Paused’. When you press play it will bring the lights down and then send a Play to Meedio Essentials and set the current status to ‘Playing’. The lights can react differently when I am playing music or video.
You can also get a Housebot event to send any command to Meedio, I have used this when I order a Pizza delivery, when the Pizza guy comes to the front door the video pauses and the front room and porch lights come on, and it is possible to toggle the housebot value that controls if this happens from the meedio menu. (This helps if your cat walks passed the sensor, and keeps pausing your movie, I’m sure my cat does this on purpose!)
How to change Housebot tasks, change device properties, change modes etc.. from Meedio or a remote control
To do this you need HB_CONTROL.EXE, this was created by Scottbot to control Housebot from a command line, which can be started via your remote control software or a Program Module in meedio.
To run a Housebot task from a standard IR remote control, you would need a 3rd party remote control software which would take the IR code from the Play, Stop, Pause button etc.. and run the HB_Control.exe with the the parameters you want, I use software called Sconi for this, but there are a fair few applications that do this.
To use HB_Control.exe you need to add in Housebot a new device ‘External Control’ and give the Property ‘Server IP Port’ value a port number like ‘9876’, obviously use something which doesn’t clash with standard IP port numbers and other apps port numbers you may have running.
The command line I use to run my Housebot ‘pause’ task is
D:\Tools\Housebot\HB_Control.exe /I 192.168.51.10 /O 9876 /C ET /T Pause
A break down of the command line parameters is
/I 192.168.51.10 – This is the IP address of the Housebot server. This can also be the computer name e.g. ‘/I SERVER1’, if Housebot is on the same PC as the software which is launching the command line then use ‘/I localhost‘.
/O 9876 – The port number specified in the External Control device in Housebot
/C ET – Tells it you want to execute a Task
/T Pause – This specifies the name of the task you have defined in Housebot.
From a DOS window you can run ‘HB_Control.exe /?’ and it will give you a break down of everything you can do with it, changing Property values, set mode states etc…
There is a minor annoyance with this program though, which is that a black DOS box flashes up on the screen for a fraction of a second when the program runs, I have found a utility which can hide this though, if anyone does the above and wants to hide the flash, PM me and I will send you the utility with instructions.
How to get Housebot to control meedio
You can run from a command line any input or jump target you have defined in the Input tab in meedio configuration. In my setup this is enables, among other things, Housebot to pause video when someone passes under the X10 sensor outside my front door.
To enable this in meedio you need to go to Meedio Configuration and the General tab, go down to ‘Network Plugin Server Settings’ and tick ‘Network Plugin Server enabled’.
If you are running Housebot on a separate PC then you need to do the following:
Install Meedio Essentials on to it, no need to put your registration code in.
Go to your Meedio Essentials program folder and edit a file called ‘MeedioSendCommand.vbs’ look for a line in the code which reads
‘if client.Connect( "localhost" , 7500 , "" , 0 , 0 ) then’
Change the word localhost to the IP address or the Computer Name of the PC running Meedio Essentials. So it reads for example like
‘if client.Connect( "htpc2" , 7500 , "" , 0 , 0 ) then’
Next create a batch file for each Input in Meedio Configuration you wish to control from housebot, to do this open notepad and type
‘D:\Meedio Essentials\ MeedioSendCommand.vbs Pause’ where the last word of the line is name of the Input in the Meedio Configuration, and save it as ‘Pause TV.bat’, you can create ones for Stop, Play etc….
In Housebot create a new device ‘Execute Program Device’ and call it (for example) ‘Pause Cinema’. In the ‘Path and Name of Program’ property type (for example) ‘D:\Remote Commands\Pause TV.bat’
Create one of these for each Batch file you created.
Now all you have to do is change the ‘Execute Command’ property to ‘Yes’ and it will run the command in Meedio Essentials running on your HTPC, the ‘Execute Command’ value can be changed using a task which itself can be triggered by a Property on an X10 device changing or from a remote control software using HB_Control.exe or even from another task, it can get as complicated as you like.
Note: The task that sets the ‘Execute Command’ value to ‘Yes’ will need to set it back to ‘No’ afterwards, it doesn’t seem to go back to 'No' on its own when the program finishes.
You’ve probably noticed I haven’t mentioned Meedio – Housebot Connector, for me the only thing this seems useful for is viewing current settings of properties, I have found changing the value of properties of this causes all sorts of weirdness with my X10 devices. I change the values using the HB_Control.exe with the appropriate command lines setup in a Program Module in Meedio, so I have a menu item which enables and disables whether the Front Door Sensor pauses the movie or not.
Hopefully you guys might find the above useful, if you want more details on the how the tasks are setup to control all this, and any other detail not in here I should be able to help you out, and if anyone has any ideas on doing any of the above a better or different way, it will be good to know.
I have set things up so that Housebot keeps track of when Meedio video or music players are Playing, Paused or stopped, and to run tasks when I press these buttons on my remote control.
So for example if I press Pause on my remote, it will run a housebot task which checks the current status of the player (Paused, Stopped or Playing), if it is already Paused or stopped it will do nothing, if it is playing it will send a Pause to Meedio Essentials and bring the lights up 10% and the current status will be set to ‘Paused’. When you press play it will bring the lights down and then send a Play to Meedio Essentials and set the current status to ‘Playing’. The lights can react differently when I am playing music or video.
You can also get a Housebot event to send any command to Meedio, I have used this when I order a Pizza delivery, when the Pizza guy comes to the front door the video pauses and the front room and porch lights come on, and it is possible to toggle the housebot value that controls if this happens from the meedio menu. (This helps if your cat walks passed the sensor, and keeps pausing your movie, I’m sure my cat does this on purpose!)
How to change Housebot tasks, change device properties, change modes etc.. from Meedio or a remote control
To do this you need HB_CONTROL.EXE, this was created by Scottbot to control Housebot from a command line, which can be started via your remote control software or a Program Module in meedio.
To run a Housebot task from a standard IR remote control, you would need a 3rd party remote control software which would take the IR code from the Play, Stop, Pause button etc.. and run the HB_Control.exe with the the parameters you want, I use software called Sconi for this, but there are a fair few applications that do this.
To use HB_Control.exe you need to add in Housebot a new device ‘External Control’ and give the Property ‘Server IP Port’ value a port number like ‘9876’, obviously use something which doesn’t clash with standard IP port numbers and other apps port numbers you may have running.
The command line I use to run my Housebot ‘pause’ task is
D:\Tools\Housebot\HB_Control.exe /I 192.168.51.10 /O 9876 /C ET /T Pause
A break down of the command line parameters is
/I 192.168.51.10 – This is the IP address of the Housebot server. This can also be the computer name e.g. ‘/I SERVER1’, if Housebot is on the same PC as the software which is launching the command line then use ‘/I localhost‘.
/O 9876 – The port number specified in the External Control device in Housebot
/C ET – Tells it you want to execute a Task
/T Pause – This specifies the name of the task you have defined in Housebot.
From a DOS window you can run ‘HB_Control.exe /?’ and it will give you a break down of everything you can do with it, changing Property values, set mode states etc…
There is a minor annoyance with this program though, which is that a black DOS box flashes up on the screen for a fraction of a second when the program runs, I have found a utility which can hide this though, if anyone does the above and wants to hide the flash, PM me and I will send you the utility with instructions.
How to get Housebot to control meedio
You can run from a command line any input or jump target you have defined in the Input tab in meedio configuration. In my setup this is enables, among other things, Housebot to pause video when someone passes under the X10 sensor outside my front door.
To enable this in meedio you need to go to Meedio Configuration and the General tab, go down to ‘Network Plugin Server Settings’ and tick ‘Network Plugin Server enabled’.
If you are running Housebot on a separate PC then you need to do the following:
Install Meedio Essentials on to it, no need to put your registration code in.
Go to your Meedio Essentials program folder and edit a file called ‘MeedioSendCommand.vbs’ look for a line in the code which reads
‘if client.Connect( "localhost" , 7500 , "" , 0 , 0 ) then’
Change the word localhost to the IP address or the Computer Name of the PC running Meedio Essentials. So it reads for example like
‘if client.Connect( "htpc2" , 7500 , "" , 0 , 0 ) then’
Next create a batch file for each Input in Meedio Configuration you wish to control from housebot, to do this open notepad and type
‘D:\Meedio Essentials\ MeedioSendCommand.vbs Pause’ where the last word of the line is name of the Input in the Meedio Configuration, and save it as ‘Pause TV.bat’, you can create ones for Stop, Play etc….
In Housebot create a new device ‘Execute Program Device’ and call it (for example) ‘Pause Cinema’. In the ‘Path and Name of Program’ property type (for example) ‘D:\Remote Commands\Pause TV.bat’
Create one of these for each Batch file you created.
Now all you have to do is change the ‘Execute Command’ property to ‘Yes’ and it will run the command in Meedio Essentials running on your HTPC, the ‘Execute Command’ value can be changed using a task which itself can be triggered by a Property on an X10 device changing or from a remote control software using HB_Control.exe or even from another task, it can get as complicated as you like.
Note: The task that sets the ‘Execute Command’ value to ‘Yes’ will need to set it back to ‘No’ afterwards, it doesn’t seem to go back to 'No' on its own when the program finishes.
You’ve probably noticed I haven’t mentioned Meedio – Housebot Connector, for me the only thing this seems useful for is viewing current settings of properties, I have found changing the value of properties of this causes all sorts of weirdness with my X10 devices. I change the values using the HB_Control.exe with the appropriate command lines setup in a Program Module in Meedio, so I have a menu item which enables and disables whether the Front Door Sensor pauses the movie or not.
Hopefully you guys might find the above useful, if you want more details on the how the tasks are setup to control all this, and any other detail not in here I should be able to help you out, and if anyone has any ideas on doing any of the above a better or different way, it will be good to know.