Script Connector
From HomeSeer
The Script Connector plugin lets you run any HomeSeer .Net script on remote computers, and advanced HomeSeer scripts on your main HomeSeer server.
Remote scripts are running on the remote computers, and have access to all remote computer resources (file system, com ports, screen, keyboard, mouse...). The remote scripts also have access to all HomeSeer API. For example, you can easily set a HomeSeer device string with the content of a file on a remote computer, or print any message on the remote computer screen.
Contents |
[edit] Requirements
- The Speaker Client must be installed on the remote computers, but it doesn't have to be running. Alternatively, you can also run the Script Client on your main HomeSeer Server.
- TCP port 8737 has to be open on your firewall, if you want to run HomeSeer scripts on remote computers over the Internet.
- A Script Connector Client must be installed on the remote computer.
[edit] Sample scripts installed with the plugin
- remote_writelog.vb <-- Writes a message to the HomeSeer log
- remote_writelog.cs <-- Writes a message to the HomeSeer log (Test C-Sharp Script)
- remote_devicestring.vb <-- Changes a HomeSeer device string from a remote computer
- remote_messagebox.vb <-- Shows a message box on the remote computer
- remote_deviceaction.vb <-- Shows a dialog box on the remote computer, to switch HomeSeer devices ON/OFF
- remote_mini_control.vb <-- Shows a dialog box with device status. You can click the status icons to switch devices ON/OFF
- remote_marquee.cs <-- Shows a large scrolling message on the remote computer. Click on the message to close it.
- remote_postit.cs <-- Shows a yellow post-it on a remote computer. Enter message as script parameter
- remote_thermostat.cs <-- Shows a HomeSeer Thermostat control dialog box
- remote_light.cs <-- Shows a small slider to control one light. Enter one device code as script parameter
- remote_lights.cs <-- Shows a dynamic dialog box to control several lights. Enter several device codes as script parameter
- remote_test_func.cs <-- Example CSharp Function Script
- remote_test_func.vb <-- Example VB Function Script
- remote_set_context.cs <-- Example script to save a value
- remote_get_context.cs <-- Example script to get a value saved with remote_set_context.cs
- media/*.cs <-- Scripts for the distributed HomeSeer Media Player
[edit] Remote scripts advanced API
Remote scripts have access to the hs object methods and properties. Furthermore remote scripts have access to the sh object (ScriptHost) methods and properties, to take advantage of remote features.
- sh.SetContext( keyString, paramObject ) <-- Save an object within the script client
- object = sh.GetContext( keyString) <-- Get an object previously saved. This allows to pass values between several scripts.
- boolean = sh.ExecLocalSub( scriptPath, paramObject )
- object = sh.ExecLocalFunc( scriptPath, paramObject )
- boolean = sh.ExecRemoteSub( scriptClient, scriptPath, paramObject )
- object = sh.ExecRemoteFunc( scriptClient, scriptPath, paramObject )
- string [] = sh.ClientList <-- List of registered Script clients as a string array
- string = sh.ClientName <-- Name of the running Script Client
[edit] Usefull links
