Home

Scripting

To provide an easy level of customization, NuvIoT includes a robust online editor and script engine you can use to create scripts in JavaScript.

Scripts

Attribute - onSet - When an Attribute is set from any source you can add a custom script
Input - onSet - When an Input is set from a Device Message you can add a custom script
Input Command - onArrive - When an Input Command arrives from from an external source you can add a custom script
State Machine - handle - You can invoke the handle method on your state machines to cause a state machine to handle an event.
State Machine - onTransition - As a state transition is executed on your state machine you can add a custom script.
OutputCommand - send - You can invoke the send method to generate an output command, this will execute the onExecute method.
OutputCommand - onExecute - This method can be used to build up an output command to be forwarded to the Output Translator.
OutputCommand - onExecute - This method can be used to build up an output command to be forwarded to the Output Translator.
Workflow - preHandler - This method is called prior to any of the workflow methods being called, WorkflowInputs will be available.
Workflow - postHandler - This method is called after all the worfklow methods have been called.

Data Models

Device Model - Properties and Methods that are available to access Device data in your script.
Device Workflow Model - Properties and Methods that are availabe to access Device Workflow methods
Property Bag - While executing your scripts you have access to a general purpose property bag where you can store random variables and data.
Session Values - While executing your scripts you have access to a temporary variable storage mechanism that will be destroyed after the workflow has completed.
Working with Attributes - Attributes are data generated from the device or workflow.
Working with Properties - Properties are used to modify user settings and defaults. Working with Workflow Inputs - Properties are used to modify user settings and defaults.

Messaging

Sending Messages - Send messages to other devices or device configurations Sending Notifications - Send web socket based notifications to subscribed clients

Networking

Networking - Basic Methods to make Network calls

Other

Utilities - General purpose methods available to your scripts
Working with Locations - There are some utilities you can use to work with locations of your device Logging - Methods available to log messages from your scripts