Power Button

(ver 1.000)

 


Get “Power Button”:

 

Make a donation to support
this free software

Supported X10 hardware:

 Currently, the following X10 hardware is supported: CM11A/C12U, JDS Startgate/TimeCommander/TimeCommnader-Plus and also any device supported by ActiveHome Interface (CM15, CM19A, VT37A, etc). However, you will need to have ActiveHome installed if you plan to use any of the cm15-etc devices enumerated above.  

 
What is “Power Button” and why use it?

 

 Power Button will give you the ability to automatically start/stop the external hardware associated with a desktop application (like amp, speaker, dim the lights with media player) just in one click, as you usually start that application.

 

 For example, when you click the desktop icon to start winapm or media player, “Power Button” will first start the external hardware, such as amp speakers, dim the lights then start your application - all in one click. Same, when you close your application, the hardware will revert to the initial setup (turn off speakers, bright the lights, etc)

 

Note: With this application you will also need an X10 controller of kind and X10 appliances as needed.

 

 Power Button is an application written to manage both the hardware and desktop applications in one click. It's a client-server design, which will also allow you to control the hardware remotely.

 

(A view sample of the main interface)

 

(A sample of how icons look under the “Power Button”)

Get started:

 

   Download the binary installation package from here and install it. Currently supported platforms are 2000 and XP. The source code is written platform independent (with wxWidgets) and could probably be compiled on other platforms such as Linux and MacOS.

 

After you completed the installation, start the “Power Button” application.

 

Note: If you run a firewall you will have to allow this application to communicate on that specific port (by default 33333) on the local interface or outside if you are in the remote mode.

 

Configuration:

 

1.      First, set on which serial port is your X10 controller installed. To do this go to File->Config and there in the first tab(X10) you will find a select option labelled "X10 Serial Port Number:". There chose your serial port number. IF your x10 controller doesn’t have a serial port (like cm1a) you don’t need to select any specific port – just leave it as it is. Next step is to select your controller type. Then, once you press "OK" in config windows you should see a message in the logs saying that the port/interface was successfully open. Else, check your serial/usb port configuration.

 

 

   In the Action panel you can configure if the “Power button” should hide or show the main window when you start close a program.

 

 

  The Runtime panel has three options. If you check the first then “Power Button” will start on widows start up. If you check the second option then every time you close “Power Button”, all other programs started under power button management will be stopped/closed as well. The third option refers to either save or not your setup (programs, hardware added in this session) on exit.

 

 

  Under the Network panel you can configure the communication parameters (server address and port) to be used. The local configuration is used to communicate between power button processes – one that monitors the running process and the other handles the incoming commands to starts/stops the process.

 

 

  If you check the “Use Remote Server”, then you can use a remote instance of “Power Button” to handle the hardware while the local instance will handle the software part. In this case a second set of server/port values have to be filled in. Note that after a change in/out remote mode you will need to restart your application.

 

 

2.      Plug your external devices (amp, speakers, dvb box, lamp, etc) into X10 appliance modules or needed. Set the address for each of them as required.

 

3.      Adding a program such as Winamp to the “Power Button” can be done in three different ways:

 

a) You can drag your program icon (or executable) over the “Power Button” icon (found  on the desktop). This will start the application and you can see the name of the icon you just dragged in the software list.

b) First start “Power Button”, then drag the icon (or executable) anywhere in the main window of the application. This will have the same effect as motioned at point a. Then you can edit the entry (right click menu->edit) and change the name of your listed program or adjust the start/stop delays as you require.

c) Use either the first icon in the toolbar (add program) or right click in the software list and use “Add” option. This way of adding is slightly different from previous methods and only works for executable or virtual buttons (for shell links icons use the previous two methods). This will open a dialog box as follows:

 

 

Application type option will let you select if you want to either add an existing system application or define a virtual button (see explanation bellow). In this case you can click on the “Software Path” to select the program you want to add then fill in the name you whish for your application.

The next panel is where you can specify the delay between when the software is started and the hardware is “started”. Same apply for second entry only the delay is for how long to wait after the software was closed before we “close” the hardware as well. The time units are in milliseconds.

 

 

In the case that “Virtual Button” option was selected, there will be different fields required. A “virtual button” is an icon placed on the desktop (for example) which when clicked instead of starting a program will action a group of hardware devices associated with in the “Power Button” application.  In the first two rows you have to fill in the icons for the two states this “button” has – on and off. By default there are two icons which come with this application. Then you have the select the folder where this icon will be placed. And at last the button name. The delays in the advanced panel will still apply only this time in reference with the moment you click the “virtual button”.

 

 

Once a program was added it’s icon will transform (as you can see bellow) by adding to it in the right corner a small rectangle with a button inside to show that this program is under the “Power Button” management from now on. If the added program is not an icon but an executable (exe, com or bat) there will be created an icon in the same folder as the executable, which will actually handle the redirection.

 

 

Once you remove the program from software list the icon will revert to its initial status. In the case of virtual buttons these will be removed from the desktop.

 

4.       Adding the hardware associated with your program or virtual button. First select the software to which you want add these devices and then you can either click the second icon in the toolbar (Add Hardware) or right or right click in the “Associated Hardware List” and select “Add Device”. This will pop the following dialog:

 

There, fill in the device name (not that relevant however have something unique there) and then select your house id and appliance id. In the advanced panel you have first to select the action’s logic. There are three distinct possibilities:

 

·         ON/OFF – the default direct logic – will turn the hardware ON when you start the program and OFF when you close the program.

·         OFF/ON – the negated logic – will turn the hardware OFF when you start the program and ON when you close it. Useful for example if you want to turn off the sealing lights when you start your media player to watch a movie.

·         DIM – direct logic to control from value to value  – based on your setting it will set the dimmer to the value in “dim from” when you start the program and to the value in “dim to” when you close the program. Useful if you want to dim the lights while you listed to music or watch TV.

 

You can set ON/OFF delays if you want a device to start with a certain delay relative to the next previous hardware. Note that the hardware will be started sequentially in order they are added in the list.

 

 

In case you select the “DIM” logic then you will have to adjust your sliders, “dim from” and “dim to”, the way you want it. Currently only 30 levels of dim/bright are supported.

  

 

 

 

Running you programs:

 

   After you completed the configuration and added your program/devices you are ready to go. To start a program you could either click on the icon as you would normally do or right click on the program in the software list and choose “Start” or click on the play button in the toolbar. To stop it you just close your program as usual or you could do it from the right click option “Stop” or the stop button in the toolbar but be careful that the later cases will actually kill you program (however it’s a soft not forced kill). You could also stop the application by clicking again on the desktop icon (as you normally do to start it). In the case of virtual buttons the same options apply – probably the most useful is to use the desktop icon.

   Also, you can use the task bar icon menu to stop start your programs/virtual buttons.

 

 

   If when you start your program the “Power Button” isn’t already running, the power button will start first and then it will start your application. To avoid the power button window popup you have check the “Hide Power Button window on action” in the config, in which case the application will be automatically hidden in the task bar. 

  The state of a device or program is shown in both text (under state column) and with colour (red= closed/off ,green= started/on, cyan=starting/stopping in progress, grey=failure).

 

Running in remote mode:

 

   As I mentioned before it’s possible to run this application using the hardware remotely controlled over the network by another instance. To do this you first need to configure both computers in remote mode (the local which holds your application and the remote which controls the x10 hardware). Then start first the “Power Button” application on the remote server and you should see in the window title mentioned that is running as a server. Now you can follow the same steps as usual on your local machine, to add the programs, the hardware and control them. Every time a command is issued for software locally another will be routed to the remote instance to set the hardware as well.

 

Manual configuration:

 

   Alternatively you can edit by hand the configuration files found under the application install folder, ex. "C:\Program Files\Power Button\". There are three files as you can see the samples bellow:

 

-          " pbutton.ini" with the options you found under File->Config:

 

[X10]

SerialPort=4

X10ControllerModel=1

 

[Action]

HideOnAction=0

ShowOnStop=0

 

[Runtime]

RunOnWindowsStartup=0

CloseAllOnExit=0

SaveOnExit=1

 

[Network]

LocalServerName=localhost

LocalServerPort=33333

RemoveServerName=192.168.1.193

RemoveServerPort=33335

RemoteConnect=0

 

[Gui]

Width=644

Height=355

ViewLogs=1

  

-          " pbutton_slist.ini " stores a list with your programs/virtual buttons and the parameters:

 

[Main Light]

shelllink=C:\Documents and Settings\Administrator\Desktop\Main Light.lnk

vriconpathon=C:\Program Files\Power Button\vr_button_on.ico

vriconpathoff=C:\Program Files\Power Button\vr_button_off.ico

vrfolder=C:\Documents and Settings\Administrator\Desktop

startdelay=10

enddelay=10

filetype=2

state=1

x10dev=(device9,5,1,20,20,0,0,0)

 

[Winamp]

path=C:\Program Files\Winamp

fullname=C:\Program Files\Winamp\winamp.exe

exename=winamp.exe

shelllink=C:\Documents and Settings\Administrator\Desktop\LL Winamp.lnk

startdelay=1000

enddelay=1000

filetype=0

state=1

x10dev=(amp,2,1,20,20,0,0,0),(speakers,8,1,20,20,0,0,0)

 

[WinFast PVR]

path=C:\Program Files\WinFast\WFTVFM

fullname=C:\Program Files\WinFast\WFTVFM\WFTV.exe

exename=WFTV.exe

shelllink=C:\Documents and Settings\Administrator\Desktop\LL WinFast PVR.lnk

startdelay=27000

enddelay=17000

filetype=0

state=0

origtarget=C:\Program Files\WinFast\WFTVFM\WFTV.exe

x10dev=(dvb-tunner,2,2,20,20,0,0,0)

 

-          " pbutton_hlist.ini" stores a list with your x10 appliances and the parameters:

 

[tv power]

devid=3

houseid=2

state=0

logic=0

dimfrom=0

dimto=0

 

[lamp]

devid=5

houseid=1

state=0

logic=0

dimfrom=0

dimto=0

 

Known bugs:

 

   There are no known bugs at the moment. However, if you find any please send them to me at i@larryo.org. Any suggestions on how to improve this application are also welcome.

 

 

Main -> Work -> Information