@appmodule/node-red-contrib-siot

3.0.0-rc41 • Public • Published

node-red-contrib-siot

Node-RED interactions with SIOT

Nodes

SIOT pub

  • This node connects to an SIOT instance and is designed to publish messages related to specific data elements. The messages are published to the data element with the id specified in the configuration of the node.

Details

  • The SIOT publisher node accepts one input, which is a message object with a payload to be published to the specified SIOT data element. The node does not produce any outputs.

  • Upon successfully building the data element, the node listens for incoming messages. When such a message is received, its payload is published to the specified data element.

Properties

  • Name: User-defined identifier for the node.
  • Data Element id: Identifier of the data element where messages should be published.
  • Class config: The configuration for the class of the data element.
  • Siot config: SIOT configuration associated with this node.

Inputs

The input of the de-publisher node is a message object (msg). The payload of this message is published to the specified data element.

SIOT sub

  • This node connects to an SIOT instance and it has the following three roles:

  • This node is designed to subscribe to specific data elements. When a new message is published to the data element with the id specified in the configuration of the node, the node emits the value of the message as its first output.

  • This node is designed to handle SIOT commands related to specific data elements. It listens for commands from the configured SIOT instance and, when a command related to the specified data element id is received, it sends the payload of that command as its second output. The output payload includes an id that can be used to correlate the command with its acknowledgement in a corresponding "acknowledge" node.

  • This node is designed to handle thing configuration. It listens for thing configuration from the configured SIOT instance and, when a thing configuration related to the specified data element id is received, it sends the payload of that thing configuration as its third output. The output payload includes an id that can be used to correlate the thing configuration with its acknowledgement in a corresponding "acknowledge" node.

Properties

  • Name: User-defined identifier for the node.
  • Data Element id: Identifier of the data element to which the node should subscribe.
  • Siot config: SIOT configuration associated with this node.

Details

  • The SIOT subscriber node does not accept any inputs and produces three outputs. The first output is a message with the value of the published SIOT message when a new message is received on the subscribed data element. The second output is a message with the payload of the command when a new command related to the specified data element id is received. The third output is a message with the payload of the thing configuration when a thing config related to the specified data element id is received.

  • Upon successfully verifying the existence of the data element, the node subscribes to the data element. When a new SIOT message is published to this data element, the value of the message is sent as the first output from the node. When a command related to the specified data element id is received, the payload of that command is sent as the second output from the node. When a thing configuration related to the specified data element id is received, the payload of that thing configuration is sent as the third output from the node.

Outputs

  • The first output of the de-subscriber node is a message object (msg) with one property: payload. The payload carries the value of the published SIOT message received on the subscribed data element.
{
  payload: <value of the SIOT message>
}
  • The actual content and structure of the payload depend on the specifics of the message received.

  • The second output of the de-subscriber node is a message object (msg) with one property: payload.

{
  payload: {
    params: {},
    command: "apply",
    id: ""
  }
}

Here is a breakdown of its properties:

  • params: An object or a value that provides additional parameters necessary for the command. The structure and contents of params depend on the specific command.

  • command: A string that represents the type of command to be executed. In this context, it is set as "apply" by default.

  • id: The id field serves as a "correlation id", providing a reliable way to track and manage the lifecycle of each individual command. After the user's logic has successfully processed the command, this id should be sent to a corresponding "acknowledge" node to confirm and acknowledge the successful processing and execution of the command back to the SIOT system.

  • The third output of the de-subscriber node is a message object (msg) with one property: payload.

{
  payload: {
    configuration: {},
    id: ""
  }
}

Here is a breakdown of its properties:

  • configuration: An object that provides thing configuration. The structure and contents of configuration depend on the specific thing.

  • id: The id field serves as a "correlation id", providing a reliable way to track and manage the lifecycle of each individual thing config. After the user's logic has successfully processed the thing conif, this id should be sent to a corresponding "acknowledge" node to confirm and acknowledge the successful processing and storing of the thing configuration back to the SIOT system.

SIOT plugin cnf

  • This node is designed to handle plugin configuration. It listens for plugin configuration from the configured SIOT instance and, when a plugin configuration is received, it sends the payload of that plugin configuration as its output.

  • The output payload includes an id that can be used to correlate the plugin configuration with its acknowledgement in a corresponding "acknowledge" node.

Properties

  • Name: User-defined identifier for the node.
  • Siot config: SIOT configuration associated with this node.

Output

The output of the plugin cnf node is a single message object (msg) with one property: payload.

{
  payload: {
    configuration: {},
    id: ""
  }
}

Here is a breakdown of its properties:

  • configuration: An object that provides plugin configuration. The structure and contents of configuration depend on the specific plugin.

  • id: The id field serves as a "correlation id", providing a reliable way to track and manage the lifecycle of each individual plugin cnf. After the user's logic has successfully processed the plugin cnf, this id should be sent to a corresponding "acknowledge" node to confirm and acknowledge the successful processing and storing of the plugin configuration back to the SIOT system.

SIOT ack

It is used to acknowledge the completion of a command, plugin or thing configuration that was received from an SIOT sub or SIOT plugin cnf node.

Properties

  • Name: A user-defined identifier for the node.
  • Siot config: The SIOT configuration associated with this node.

Details

  • The ack node accepts one input and produces no outputs. The input is a message with the payload being the acknowledgment information for a command, plugin or thing config that has been processed.

Inputs

  • The input to the ack node is a message object (msg) with a payload. The payload must contain the id of the command, plugin or thing config and a result that indicates the success or failure of the command execution, plugin or thing configuration. The result is a boolean value where true indicates success and false indicates failure.
{
  payload: {
    id: <id of the command, plugin or thing config>,
    result: <boolean indicating the result of the command, plugin or thing config>
  }
}

Class config

  • The class-config node is designed to manage configurations for different classes in your node-red flow. It allows users to define a broad array of properties for the chosen class, offering extensive customization options.

SIOT config

  • This node is responsible for setting up a configuration for connecting to the SIOT platform.

Readme

Keywords

Package Sidebar

Install

npm i @appmodule/node-red-contrib-siot

Weekly Downloads

80

Version

3.0.0-rc41

License

ISC

Unpacked Size

177 kB

Total Files

35

Last publish

Collaborators

  • appmodule