0.9.9 • Published 3 years ago

node-red-contrib-netfield-websocket v0.9.9

Weekly downloads
5
License
MIT
Repository
github
Last release
3 years ago

node-red-contrib-netfield-websocket

Node-RED nodes to communicate to Hilscher netFIELD Cloud WebSocket API services.

The section Websocket in the online API documents the services:

WebSocket Interface

In netFIELD Cloud WebSockets are used to stream process data of the cloud managed devices live to any clients such as Node-RED.

In a WebSocket session a device is determined by its unique deviceId. Device IDs can be retrieved from your cloud account:

The device's data object of interest is specified by a path formatted topic. Topics can be retrieved from the Device Manager in your cloud account.

Depending on the device topics can either be static:

or created manually:

The streamed data object itself is JSON formatted.

The communication is TLS secured and authenticated by an authorization key in JSON Web Token format. Keys can be generated using the API Key Manager in your cloud account.

When generating a key make sure the permission viewDeviceMessages is enabled for using WebSockets. This is a typical key details page:

Nodes usage

The module provides the nodes websocket-in and websocket-config. Configure the

  • node websocket-in with

    ParameterDescriptionExample
    Device IDDevice id of the addressed device. Copy value from your cloud account5f7b1bec199d7835e0929e9b
    TopicData object tag to listen to live. Copy the topic from your cloud account. Wildcard char # in the path creates pattern matching. # only listens to all objects#

    The node injects a JSON formatted object in msg.payload for any data object received through the WebSocket.

  • configuration node websocket-config with

    ParameterDescriptionExample
    URLWebSocket wss://... server URLwss://api.netfield.io
    Timeout Period sInactivity timeout (ping) in seconds if expired WebSocket is assumed as timed out and tried to get connected again30
    KeyKey to authorize on the server. Copy value from your cloud account key details pageeyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1S ...

Nodes installation

Use the Node-RED "Manage Palette" function to install. Enter node-red-contrib-netfield-websocket in the install tab search bar, wait for the package appearing and click install.

License

Copyright (c) Hilscher Gesellschaft fuer Systemautomation mbH. All rights reserved. Licensed under the LICENSE file information stored in the project's source code repository.