[Help Index]

User Variables :


This feature is primarily useful for integrating with external programs/data feeds. 

X10Dispatcher can maintain 100 different variables, each containing a string, which can be used as a substitution text within alerts and command/macro action settings. 

The best way to describe their functionality is to give an example. Let's say you have a program which can obtain your home's current temperature, humidity, barometric pressure, etc. from perhaps a weather station which can interface with your computer. If you can write a program or script file to push these variables into x10dispatcher then you can view that information using dispatcher's web server, msn command, or through alert text substitutions.

There are four ways in which you can put these variables into dispatcher, from the Console (under Remote Cmds tab), from MSN, using the webserver to call setvalue.htm with parameters indicating their values, or by using a new macro action called Run Dispatcher Script. When integrating with an external program, you will probably use either the web server or script action methods. The Dispatcher Script is much more than for just variables, but it can be used for importing new parameter values.

Parameters are distinctly named, setting them again to a new value overwrites the last. Parameter values can be substituted for including within Alert Text, TTSSpeak actions, Run Command filenames, and many other locations. To substitute a parameter value you would use a variable placeholder such as making your alert text 'Current Temperature is %CurrentTemp%' to substitue the variable named 'CurrentTemp'.

As an example of using the web service to set these values, your program might issue requests every 30 seconds or so (with latest values) to the dispatcher web server such as :
http://192.168.1.100:8080/setvariable.htm?CurrentTemp=75.2
http://192.168.1.100:8080/setvariable.htm?CurrentHumidity=20.2

If your program was additionally capable of determining that any of these values warrants an alert being raised you can invoke that alert using web macro request or sendplc to a phantom trigger. That subsequent alert/Macro can be configured to use those parameters in email text, Alert Descriptions, etc.

If it is easier for you to work with text files you could write a series of commands to a dispatcher script file and then execute a macro which will run that script. An example (for variables) might be a script file 'UpdateLatestVars.txt' containing lines such as :
setvariable CurrentTemp=75.2
setvariable CurrentHumidity=20.2

You might then run the ActiveHome sendplc.exe utility to raise a phantom trigger to a trigger which will import them, or invoke the macro via the web server's macro request page.

Even if you do not wish to alert on these variables, you might want to maintain them to be displayed or accessible via the Web Server, MSN, or Console. The web server will display the first 10 variables in the summary page, or you can view them all using the showvars.htm web page. From MSN, Console, and script commands you can use the 'SetVariable', 'ShowVars', and 'ClearVars' commands to set, show, and clear all variables (See MSN/CommandPrompt/Script Command Reference for more details).