ScriptExecution

actions. ScriptExecution

ScriptExecution Actions

The static methods of this class are made available as functions in the scripts.

Methods

(static) callScript(scriptName)

Description:
  • Calls a script which must be located in the configurations/scripts folder.

Source:
Parameters:
Name Type Description
scriptName string

the name of the script (if the name does not end with the .script file extension it is added)

(static) createTimer(identifier, zdt, functionRef, …params) → {*}

Description:
  • Schedules a function for later execution.

Source:
Example
actions.ScriptExecution.createTimer(time.toZDT().plusSeconds(10), (foo, bar) => {
  console.log(foo + bar);
}, 'Hello', 'openHAB');
Parameters:
Name Type Attributes Description
identifier string

an optional identifier, e.g. used for logging

zdt time.ZonedDateTime

the point in time when the callback function should be executed

functionRef function

callback function to execute when the timer expires

params * <repeatable>

additional arguments which are passed through to the function specified by functionRef

Returns:

a native openHAB Timer

Type
*