How to integrate Housebot with Meedio Essentials

General HouseBot discussion. Any issues that don't fit into any of the other topics belong here.
Post Reply
Rayth Kaled
Member
Posts: 8
Joined: Fri Jan 23, 2004 4:57 pm
Location: England

How to integrate Housebot with Meedio Essentials

Post by Rayth Kaled »

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.
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Post by Richard Naninck »

Can you tell me why you just didn't use the Meedio / HouseBot Connector to control Meedio from HouseBot? I must agree with you that the connector is useless while going from Meedio to HouseBot, but the other way around (from HouseBot to Meedio) is really OK! You can create Meedio jumppoints for every menu option you can think of including all the standard jumppoints like HOME, STOP, PLAY, PAUSE etc etc etc and control those from HouseBot using the connector. It is as simple as putting a text jumppoint into the property Meedio Essentials, Command To Send. It appears to me you found a nice way to work around something that is already there!

If you ever figure out a way to get control of Essentials libraries in HouseBot, please let us know.
Davieboy
Member
Posts: 30
Joined: Thu Jul 14, 2005 12:35 pm
Location: Ireland

Post by Davieboy »

Rather excellent alternative to using the connector as already mentioned. What I wish is that there was some way to make houesbot have a set of properties/commands that could be directed at a multitude of meedio installations on a network. So for example u could have an opening screen on a swremote and select which room u want to control meedio in and then be able to have all the sub control screen and commands be automatically directed to the specific room. Anyone have any thoughts on this?

The current solution is to create different remotes for each room which is a pain in the ass.
Image
Rayth Kaled
Member
Posts: 8
Joined: Fri Jan 23, 2004 4:57 pm
Location: England

Post by Rayth Kaled »

I have never really been able to get the Housebot to meedio connector part going properly, when I am using MeeTVShows plugin in meedio, if I send a message video.play via the connector it plays the DVD player, if I do it my method it plays the Episode I have selected in the MeeTVShows module.
Richard, your suggestion using Jump Targets doesn't make sense to me, as jump targets allow you to jump to areas of the menu. Play, Stop, Pause etc are not menu items they are commands in Media Modules, how do I assign a jump point to them ? I am obviously missing something here as I could not see in the documentation regarding System Messages how it can trigger a Command in the Input Tab that doesn't relate to a jump target in the menu.
Which is the reason I have done it like this.

One upside with the alternative I have posted is it is pretty universal so any other application you may want to integrate in your setup, which can launch executables, can use this process to control Meedio.
Rayth Kaled
Member
Posts: 8
Joined: Fri Jan 23, 2004 4:57 pm
Location: England

Post by Rayth Kaled »

Davieboy wrote:What I wish is that there was some way to make houesbot have a set of properties/commands that could be directed at a multitude of meedio installations on a network. So for example u could have an opening screen on a swremote and select which room u want to control meedio in and then be able to have all the sub control screen and commands be automatically directed to the specific room. Anyone have any thoughts on this?
Davieboy, I have an idea with this, I will test it out and come back to you if it works.
spike5884
Senior Member
Posts: 129
Joined: Thu Aug 26, 2004 8:08 am
Location: WI

Post by spike5884 »

Davieboy wrote:Rather excellent alternative to using the connector as already mentioned. What I wish is that there was some way to make houesbot have a set of properties/commands that could be directed at a multitude of meedio installations on a network. So for example u could have an opening screen on a swremote and select which room u want to control meedio in and then be able to have all the sub control screen and commands be automatically directed to the specific room. Anyone have any thoughts on this?
Off the top of my head this should be easy to do. I use a simular concept to control SageTv. You would just need to add the Room level of control. It would take work and maybe a switch in thinking. I do not have Essentials installed, so I can not test this theory. This is going to be simplistic. It will be up to you to add the details. That is if you are up to the mission...
  • Create button(s) or something on SwR (SWRemote) that sets a property to match room to control. Lets call this property pRoom.
  • Create buttons on SwR for each action to be done against Essentials. They should set the same property that we will call pAction.
  • Create task that monitors for changes in pAction. When property changes, task should execute a VBScript.
  • VBScript will be something like the one I use below. Except you will be controlling Essentials.
  • Tweak script using info from Rayth's instructions above.
  • I do not know what is in "MeedioSendCommand.vbs", but I would think that it could be integrated into this script to make things easier.
  • Script will need to retrieve the pRoom property and set a variable to the proper IP address.

Code: Select all

Dim oShell
Dim btnPressed
Dim msgNbr
Set oshell = CreateObject("WScript.Shell")

btnPressed = GetPropertyValue("BtnChgScript.SageTvBtn")

If Left(btnPressed,3) = "CH_" Then
  Call SetFavChan(Right(btnPressed,2))
Else

Select Case btnPressed
   Case "Left"    msgNbr = "2"
   Case "Right"    msgNbr = "3"
   Case "Up"    msgNbr = "4"
   Case "Down"    msgNbr = "5"
   Case "Pause"    msgNbr = "6"
   Case "Play"    msgNbr = "7"
   Case "Skip Fwd"    msgNbr = "8"
   Case "Skip Bkwd"    msgNbr = "9"
<<SNIPPED>>
   Case "Video Library"    msgNbr = "88"
   Case "Stop"    msgNbr = "89"
   Other msgNbr = "999"
End Select

End If

If msgNbr <> "999" Then
  rc = oShell.run("%windir%\SendMessage.exe SageApp SageWin 1258 0 " + Trim(msgNbr))
End If

Set oShell = Nothing
Set btnPressed = Nothing
Set msgNbr = Nothing

Sub SetFavChan(Chan)
 rc = oShell.run("%windir%\SendMessage.exe SageApp SageWin 1258 0 63")  
 Select Case Left(Chan,1)
   Case "0"    msgNbr = "30"
   Case "1"    msgNbr = "31"
   Case "2"    msgNbr = "32"
   Case "3"    msgNbr = "33"
   Case "4"    msgNbr = "34"
   Case "5"    msgNbr = "35"
   Case "6"    msgNbr = "36"
   Case "7"    msgNbr = "37"
   Case "8"    msgNbr = "38"
   Case "9"    msgNbr = "39"
 End Select
 rc = oShell.run("%windir%\SendMessage.exe SageApp SageWin 1258 0 " + Trim(msgNbr))
 Select Case Right(Chan,1)
   Case "0"    msgNbr = "30"
   Case "1"    msgNbr = "31"
   Case "2"    msgNbr = "32"
   Case "3"    msgNbr = "33"
   Case "4"    msgNbr = "34"
   Case "5"    msgNbr = "35"
   Case "6"    msgNbr = "36"
   Case "7"    msgNbr = "37"
   Case "8"    msgNbr = "38"
   Case "9"    msgNbr = "39"
 End Select
 rc = oShell.run("%windir%\SendMessage.exe SageApp SageWin 1258 0 " + Trim(msgNbr))
 msgNbr = "20"
 set Chan = Nothing
End Sub
Hopefully this is enough to get you going in the right direction and to show that what you want is possible.
Thanks,
Scott J
aka spike5884
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Post by Richard Naninck »

@ Rayth Kaled:

It is not done using the Message to Send. In stead I use the Command to Send property from the connector. If you go to the Meedio Configuration program and then to the Input tab you see text commands for everything Meedio can control using the keyboard, USB UIRT, Jumppoints etc etc. Commands like UP, DOWN, LEFT , RIGHT, SELECT, 1, 2 etc etc etc and of course your own made jumppoints can be controlled via the connector using the Command to Send property. Very easy to set up. I have a theme panel which holds all basic Meedio functions like play, pause, stop, numeric keyboard, up, down etc etc and with my new script also the alphabet to be able to jump to movies faster in my library. As for jumppoint menu control I set up something like the Windows Start menu. Each button holds a jumppoint to a menu function. This way I can navigate through meedio by pressing jumppoint buttons from HouseBot. When I am at the right panel in meedio (say my movies), I can continue using housebot with the up, down, left, right, select etc etc buttons. Full control of Meedio without the libraries of course. This would be nice so I could also display the library content in my SWRemote. I could press the thumbnail of a movie and the movie then starts right away. Too bad this will probably never be built now. The rest works OK and even better now with my alphabet keys.
Post Reply