Giter VIP home page Giter VIP logo

node-red-contrib-osisoft-web-api's Introduction

node-red-contrib-osisoft-web-api

These are Node-RED nodes that interface with the OSISoft Web API server. The nodes simplify the process of developing an application to write data and to query data.

For more information of these nodes, please refer to our tutorial on http://developers.sensetecnic.com.

Pre-requesites

To run these nodes, you need to have:

  • A running OSIsoft PI Server
  • A running OSIsoft PI Web API server associated with the PI Server
  • The OSIsoft PI Web API server will need to be configured using "Basic" or "Anonymous" authentication methods.
  • EnableCSRFDefense flag must be set to "False" in WebAPI system configuration.
  • PI identities with appropriate read/write access privileges are required to access to PI server
  • You can find more infomation on OSIsoft PI Server product page.

Install

Run the follwing command in the root directory of your Node-RED install. Usually this is ~/.node-red .

    npm install node-red-contrib-osisoft-web-api

Usage

Web API write node: Write data to Pi Server

This is the node to write data to the PI Server. Currently, you can either write data to points in your data servers by Web ID, point paths, or you can write data to any other API endpoints with your own URL input.

  • By Web ID: Write to a point in data servers by using Web ID
  • By Point Path: Write to a point in data servers by using the point path. The node will first query the path, and write to that point using the Web ID returned from the query.
  • By Custom URL: Write data using a custom URL relative to the base Web API URL set in the configuration node. You can use this mode to write to anything that is not in the data servers.

An example flow writing to a specific Web ID:

[{"id":"96264f9e.af0bd","type":"web-api-write","z":"543e65ad.2f3a4c","name":"","server":"64727ec0.eb85f","writeMethod":"webId","webId":"P0RBbjFMMXuUivIEAgCXqPnADwAAAARUMyQU1BWi05SEVKVlRMXEtIT1VfUkVMQVRJVkVfSFVNSURJVFk","requestMethod":"POST","x":585,"y":381,"wires":[["19d58c27.3e2c84"]]},{"id":"5441511c.03566","type":"inject","z":"543e65ad.2f3a4c","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":258,"y":338,"wires":[["7b828585.10df2c"]]},{"id":"7b828585.10df2c","type":"function","z":"543e65ad.2f3a4c","name":"post value","func":"msg.payload = {\n    \"Value\":31.5\n}\nreturn msg;","outputs":1,"noerr":0,"x":425,"y":362,"wires":[["96264f9e.af0bd"]]},{"id":"19d58c27.3e2c84","type":"debug","z":"543e65ad.2f3a4c","name":"","active":true,"console":"false","complete":"true","x":771,"y":356,"wires":[]},{"id":"64727ec0.eb85f","type":"web-api-client","z":"","name":"","serverURL":"my-pi-server/piwebapi","authenticateMethod":"basic","usetls":true,"tls":"b50d2d8b.bbace"},{"id":"b50d2d8b.bbace","type":"tls-config","z":"","name":"","cert":"","key":"","ca":"","certname":"","keyname":"","caname":"","verifyservercert":false}]

For more info on the write node, please refer to our tutorial on http://developers.sensetecnic.com.

Web API query node: Query data from PI Server

This is the node to query data from the PI server. Currently, you can either query points from your PI Data servers by Web ID, point paths, and preset features, or you can query any other data with your own URL input.

  • By Web ID: Query a point in data servers by using Web ID
  • By Point path: Query a point in data servers by using the point path
  • By Custom URL: Query a custom URL relative to the base Web API URL set in the configuration node. You can use this mode to query anything that is not in the data servers

These are the preset features where you can:

  • List all Assert servers: List all the assert servers from your PI Server
  • List all DBs in Assert Servers: List all the databases from all assert servers
  • List all Data Servers: List all the data servers from the PI Server
  • List all points in Data Servers: List all points from all data servers.

An example flow code querying a point with a specific Web ID:

[{"id":"919a963f.186748","type":"web-api-query","z":"543e65ad.2f3a4c","name":"","server":"64727ec0.eb85f","queryMethod":"webId","webId":"P0RBbjFMMXuUivIEAgCXqPnADwAAAARUMyQU1BWi05SEVKVlRMXEtIT1VfUkVMQVRJVkVfSFVNSURJVFk","dataType":"self","customUrl":"","x":359,"y":173,"wires":[["8023a61c.a03078"]]},{"id":"a774c1cd.57ba9","type":"inject","z":"543e65ad.2f3a4c","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":162,"y":164,"wires":[["919a963f.186748"]]},{"id":"8023a61c.a03078","type":"debug","z":"543e65ad.2f3a4c","name":"","active":true,"console":"false","complete":"true","x":529,"y":170,"wires":[]},{"id":"64727ec0.eb85f","type":"web-api-client","z":"","name":"","serverURL":"my-pi-server/piwebapi","authenticateMethod":"basic","usetls":true,"tls":"b50d2d8b.bbace"},{"id":"b50d2d8b.bbace","type":"tls-config","z":"","name":"","cert":"","key":"","ca":"","certname":"","keyname":"","caname":"","verifyservercert":false}]

For more info on the query node, please refer to our tutorial on http://developers.sensetecnic.com.

node-red-contrib-osisoft-web-api's People

Contributors

jmikerq avatar odenisnobre avatar tedhuang avatar zainisma avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-red-contrib-osisoft-web-api's Issues

How to dynamically change PI tag property!!

Hi,
I would like to know how to dynamically change the "PI tag" property on node "web api query" so i would be able to query tags using only one "web api query" node and changing the tag name.
Thanks in advance.
Ogeda, Renato.

inject msg.headers{"X-Requested-With"} for web-api-write

Machine configuration
Node-red version: v3.0.2
OS: Windows 11
httpNodeCors: enabled

PI webapi configuration
Authentication method: "Basic"
EnableCSRFDefense flag: "True"

Issue:
web-api-write produce 403 error. HTTP POST calls works using POSTMAN and Node-red HTTP request by defining "X-Requested-With" in the headers even with httpNodeCors disabled.

I created a function to set the payload and headers node before the pi-web-api-write node for both webid and point path but still getting the same 403 error.

Please advise.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.