Node-RED Node

The Node-RED Node connects to inmation Core server via the new inmation Web API server.

Installation

To install inmation Node just change into your node-red user directory and install like so:

cd ~/.node-red/
npm install @inmation/node-red-contrib-inmation

See the Node-RED page for more details.

Topics

Read an Item value property

Topic: read

Payload:

[ { "p": "/System/Core/TestItem" } ]

Write to an Item value property

Topic: write

Payload:

[ { "p": "/System/Core/TestItem", "v": 200 } ]

Read historical Data

Topic: readhistoricaldata

Payload:

{
    "items":[ { "p": "/System/Core/TestItem", "v": "AGG_TYPE_RAW" } ],
    "startTime": "2017-12-01T12:00:00.000Z",
    "endTime": "2017-12-01T12:05:00.000Z",
    "numberOfIntervals": 1
}

Payload with options:

{
    "items":[ { "p": "/System/Core/TestItem", "v": "AGG_TYPE_RAW" } ],
    "startTime": "2017-12-01T12:00:00.000Z",
    "endTime": "2017-12-01T12:05:00.000Z",
    "numberOfIntervals": 1,
    "options": {
        "percentage_good": 100,
        "percentage_bad": 100,
        "treat_uncertain_as_bad": false,
        "slopped_extrapolation": false,
        "partial_interval_treatment": "UASTANDARD"
    }
}

Execute Function

Topic: execfunction

Payload:

{
    "context": { "p": "/System/Core/TestFolder" },
    "libraryName": "my-library-name",
    "functionName": "calculate",
    "functionArg": { "a": 10, "b": 20 }
}

Subscribe to DataChanges

Topic: subscribe2dc

Payload:

[ { "p": "/System/Core/TestItem" } ]

Subscribe to ChildrenCountChanges

Topic: subscribe2ccc

Payload:

[ { "p": "/System/Core/TestItem" } ]

Subscribe to ConfigurationVersionChanges

Topic: subscribe2cvc

Payload:

[ { "p": "/System/Core/TestItem" } ]

Subscribe to UserStateChanges

Topic: subscribe2usc

Payload:

[ { "p": "/System/Core/TestItem" } ]

Run Script

Topic: runscript

Payload:

{
    "context": { "p": "/System/Core/TestItem" },
    "script": "return inmation.getself().ObjectName"
}