node-red-contrib-octocore 0.0.5

OctoCore impelentation for node-red

npm install node-red-contrib-octocore

node-red-contrib-octocore

NPM version

A Node-RED module to communicate with the OctoCore platform from Octotronic.

Overview

This Node-RED module provides nodes to publish and subscribe to messages on the OctoCore platform using NATS. It includes the following nodes:

  • uns-publish: Publish messages to the OctoCore platform.
  • uns-subscribe: Subscribe to messages from the OctoCore platform.

Installation

To install the module, run the following command in your Node-RED user directory (typically ~/.node-red):

npm install node-red-contrib-octocore

Nodes

Server Configuration

uns-server

This node is used to configure the connection to the NATS server.

  • Server: The URL of the NATS server.
  • User: The username for the NATS server.
  • Password: The password for the NATS server.

Publish Node

uns-publish

This node is used to publish messages to the OctoCore platform.

  • Name: The name of the node.
  • Server: The NATS server configuration to use.
  • Dataformat: The format of the data to publish (UNS Value, RAW Value, Specific Topic, Use msg.topic).
  • Datapoint / Subject: The datapoint or subject to publish to.

The payload of the message to publish can be set via the msg.payload property.

Subscribe Node

uns-subscribe

This node is used to subscribe to messages from the OctoCore platform.

  • Name: The name of the node.
  • Server: The NATS server configuration to use.
  • Dataformat: The format of the data to subscribe to (UNS Value, RAW Value, Specific Subject).
  • Datapoint / Subject: The datapoint or subject to subscribe to.

The received message will be available in the msg.payload property.

Example Flow

Here is an example flow that demonstrates how to use the uns-publish and uns-subscribe nodes:

[
    {
        "id": "nats-server-config",
        "type": "nats-server",
        "z": "",
        "name": "NATS Server",
        "server": "nats://localhost:4222",
        "user": "username",
        "pass": "password"
    },
    {
        "id": "publish-node",
        "type": "uns-publish",
        "z": "",
        "name": "Publish to OctoCore",
        "server": "nats-server-config",
        "dataformat": "uns_value",
        "datapointid": "example.datapoint",
        "wires": []
    },
    {
        "id": "subscribe-node",
        "type": "uns-subscribe",
        "z": "",
        "name": "Subscribe from OctoCore",
        "server": "nats-server-config",
        "dataformat": "uns_value",
        "datapointid": "example.datapoint",
        "wires": [["debug-node"]]
    },
    {
        "id": "debug-node",
        "type": "debug",
        "z": "",
        "name": "Debug",
        "active": true,
        "console": "false",
        "complete": "false",
        "x": 500,
        "y": 300,
        "wires": []
    }
]

License

This project is licensed under the MIT License - see the LICENSE file for details.

Links

www.octotronic.com

Node Info

Version: 0.0.5
Updated 5 months, 2 weeks ago
License: MIT
Rating: 5.0 3

Categories

Actions

Rate:

Downloads

4 in the last week

Nodes

  • uns-publish
  • uns-subscribe
  • nats-server

Keywords

  • node-red
  • octocore

Maintainers