node-red-contrib-jasper-node 0.1.2
This is a set of Node-Red nodes that allows you to connect to a Jasper Node server, write tags and subscribe to tags.
Node-RED Jasper Node
A set of Node-RED nodes that allows you to connect to a Jasper Node, write tags and subscribe to tags.
Installation
npm install node-red-contrib-jasper-node
Features
- Connect to Jasper Node with authentication
- Write single or multiple tag values
- Subscribe to single or multiple tags
- Batch mode support for path-based operations
- Automatic reconnection handling
- WebSocket-based real-time updates
Nodes
Jasper Node (Configuration)
Configuration node for setting up the connection to a Jasper Node.
Properties
- Name: Name for this configuration
- Server URL: URL of the Jasper Node
- Token: Authentication token
Tags In
Write tag values to the Jasper Node.
Properties
- Name: Name for this node
- Server: Select the Jasper Node configuration
- Batch Mode: Enable to write multiple tags at once
- Tag Path: Base path for tags (used in both modes)
- Tag Name: Specific tag name (single mode only)
Input
In single tag mode:
{
payload: "value" // string, number, boolean, null; Object will be converted to JSON string
}
In batch mode (object format):
{
payload: {
"tag1": "value1",
"tag2": "value2"
}
}
In batch mode (array format):
```js
{
payload: [
{ tagId: "tag1", value: "value1" },
{ tagId: "tag2", value: "value2" }
]
}
Tags Out
Subscribe to tag values from the Jasper Node.
Properties
- Name: Name for this node
- Server: Select the Jasper Node configuration
- Batch Mode: Enable to subscribe to multiple tags
- Tag Path: Path to subscribe to (batch mode)
- Tag IDs: List of specific tags to subscribe to (single mode)
Output
In single tag mode:
{
name: "tag1",
path: 'path/to/tag1',
value: "value1",
stats: {
ts: 1716729600000,
prevValue: "value0",
prevTs: 1716729599000,
setTs: 1716729600000,
prevSetTs: 1716729599000,
source: "source",
},
payload: "same as value",
}
In batch mode:
{
data: [
{
name: "tag1",
path: 'path/to/tag1',
value: "value1",
stats: {
ts: 1716729600000,
prevValue: "value0",
prevTs: 1716729599000,
setTs: 1716729600000,
prevSetTs: 1716729599000,
source: "source",
}
},
{
name: "tag2",
path: 'path/to/tag2',
value: "value1",
stats: {
ts: 1716729600000,
prevValue: "value0",
prevTs: 1716729599000,
setTs: 1716729600000,
prevSetTs: 1716729599000,
source: "source",
}
}
],
payload: [same as data],
collection: {
[tagName: string]: "tag value"
},
tagEvent: "valueChange"
}