Skip to end of metadata
Go to start of metadata

In the Advanced section of theRun Scriptaction, you can add a single script statement.  This allows you to execute script commands without creating a file.  Statements are preceded with an ampersand (&) so HomeSeer knows to treat it as a statement.  For example, the followingif then else logiccould be typed into the "OR Script Statement" field of the Run Script action:

For VBScripts and VB.Net scripting:

&if hs.ison(1234) then hs.SetDeviceValue 1234,0 Else hs.SetDeviceValue 1234, 100

or

&hs.SetDeviceString 5678,"Garage Open",false


Multiple statements may be added to the "OR Script Statement" field.  Separate each statement with a colon (:).
Note: On Windows, you have the choice of using either the older VBScript engine for immediate scripts or the VB.NET script engine. To use VBScript format an immediate command as:

&

For example:

&hs.WriteLog "script","this is from vbscript"

For the VB.NET script engine use:

&n

For example:

&nhs.WriteLog("script","this is from vb.net")

On Linux, VBScript is not support so you can use either "&" or "&N", and either one will execute the script using the VB.NET script engine.

On Linux and Windows, you can also use C# immediate scripts. On slower Linux systems, C# is much faster than VB.NET for immediate scripts. The format is:

&s (for calling a sub)
&f (for calling a function that returns a value)

For example:

&shs.Speak("hello",true,"");

See the CSharp scripting section for more information formatting C# scripts.

  • No labels