Skip to main content
InSource KnowledgeCenter

TN InSight017 Query AVEVA Insight History API using Node-RED and Email results

Description

 

This article from InSource shows how to query AVEVA Insight and return process values using Node-RED and then send out an Email with the value(s).

  • Author: Ron Tanner
  • Published: 12/13/2019
  • Applies to: AVEVA Insight

Details

Example Steps:

1.) Access your AVEVA Insight and click the “Insight Suite” in the upper right.
clipboard_ebd6548dd2976c6608371e51755124118.png

2.) Click the “Administration” icon

clipboard_e741876eefd70103ec54172ef13e3e5c5.png


3.) Click the “REST API” on the “Integration Settings” tile.

clipboard_e1b1747daf815023de53090e6e5ea5e39.png


4.) For this example, we will use Basic Authentication:  Copy the “Endpoint” URL

clipboard_e62689ae2d0e95a9096358c4033e3c281.png

5.) For this example, Node-RED has been installed on a Windows 10.  You can download Node-RED from https://nodered.org clipboard_e66449135530f08047beb611d32915e1a.png

 

6.) We will now create a simple Node-RED flow to query information from AVEVA Insight and send an Email with the current value from one of our tags.

clipboard_e4b1a0eff4d55ab7c1a2b8ae5333ce3f3.png

7.) The “inject” node is used as a trigger to start the GET request.
clipboard_e4bd1da56cdf6bff81360db7c6bb85a96.png
 

8.) The “http request” node is used to call the AVEVA REST API.  The method we use will be “GET” and can be chosen using the dropdown box.  The URL is built starting with the URL from step 4 above along with different parameters which can be found in the AVEVA REST API documentation on the AVEVA Insight website.

The following URL GET’s the ProcessValue using the endswith filter option.  The example tag is “Baltimore.Labeler1.Performance”

https://online.wonderware.com/a/1234...r=endswith(FQN, 'Baltimore.Labeler 1.Performance')

clipboard_ec76ce35144c503b349f12dea3533020b.png
 

9.) The “function” node is used to create the custom Email message:  The function node supports JavaScript and in our example, we concatenate the current date along with the process value we received from our GET query

clipboard_e1132da68528e114e551652d61e0937a0.png

 

10.)  The “email” node is used to send the Email.  In our example we used office365 to send the Email.

clipboard_e26fe49a56917bd5da9b34d177337c003.png

 

11.)  The “debug” node is used to test the flow.  You can click on the “inject” node tab which will start the flow.  You can also use the “inject” nodes “Repeat” option to have the inject run periodically.

clipboard_e50c7a87776ae32ca100b1648d9cb4c1c.png

12.) The resulting Email.  You can also customize the Email using HTML in the JavaScript code if desired.

clipboard_e5f34f1faa39f9ae9039685c2471cf410.png

 

Similar steps can be used with other 3rd party application to request tag values from AVEVA Insight.