npm package: @inmation/node-red-contrib-inmation
Description: inmation Node-RED Node
Author: inmation Software
Latest version: 1.5.5

# inmation Node-RED Node

This Node-RED Node connects to Inmation System via the Inmation Web API.

## Disclaimer

AspenTech Inmation is a registered trademark of Aspen Technology, Inc. further referred to as AspenTech.

This application, is provided for convenience purposes only and is not an official product of AspenTech. While every effort has been made to ensure its functionality and reliability, it is important to note that this tool has not undergone formal quality assurance testing or approval by AspenTech.

The creators of this application have developed it to facilitate easy and powerful configuration of inmation platforms. However, AspenTech does not endorse or guarantee the accuracy, completeness, or suitability of this application for any particular purpose.

Users of this application should understand that it is provided on an "as-is" basis, and AspenTech shall not be held liable for any direct, indirect, incidental, special, or consequential damages arising from its use. 

By using this application, you acknowledge and agree that you do so at your own risk. While efforts have been made to minimize errors and bugs, AspenTech cannot guarantee that the application will be free from defects or that it will meet your specific requirements.

This disclaimer is subject to change without notice. Please review the latest version of this disclaimer regularly.

Thank you for your understanding.

## 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
```

## Topics

### Read an Item value property

- Topic: read
- Payload:

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

### Write to an Item value property

- Topic: write
- Payload:

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

### Read Historical Data

- Topic: readhistoricaldata
- Payload:

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

- Payload with options:

```json
{
    "items":[ { "p": "/System/Core/TestItem", "aggregate": "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"
    }
}
```

### Read Historical Data At Time

- Topic: readhistoricaldataattime
- Payload:

```json
{
    "items":[ { "p": "/System/Core/TestItem" } ],
    "timestamp": "2017-12-01T12:00:00.000Z",
}
```

### Read Raw Historical Data By Query

- Topic: readrawhistoricaldatabyquery
- Payload:

```json
{
    "query": {
        "start_time": "2019-07-25T00:00:00.000Z",
        "end_time": "2019-07-26T00:00:10.000Z",
        "items": [
            {
                "p": "/System/Core/Examples/Demo Data/Process Data/DC4711"
            }
        ],
        "bounds": true,
        "fields": "ALL",
        "filter": [
            {
                "$match": {
                    "v": {
                        "$gte": 42
                    }
                },
                "$limit": 300
            }
        ]
    }
}
```

### Execute Function

- Topic: execfunction
- Payload:

```json
{
    "ctx": { "p": "/System/Core/TestFolder" },
    "lib": "my-library-name",
    "func": "calculate",
    "farg": { "a": 10, "b": 20 }
}
```
or

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

### Subscribe to DataChanges

- Topic: subscribe2dc
- Payload:

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

### Subscribe to ChildrenCountChanges

- Topic: subscribe2ccc
- Payload:

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

### Subscribe to ConfigurationVersionChanges

- Topic: subscribe2cvc
- Payload:

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

### Subscribe to UserStateChanges

- Topic: subscribe2usc
- Payload:

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

### Run Script

- Topic: runscript
- Payload:

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

# inmation

inmation is a vendor-independent industrial system-integration specialist. Dedicated to modern technologies such as OPC UA (Unified Architecture) and document-oriented schema-less repositories, inmation opens up new horizons for enterprise real-time data management.

More information on [inmation.com](https://inmation.com)