Eagle EZ States - eagle.io API app

This app allows users to edit the states on multiple parameters within one data source.

Eagle EZ States

Getting started

If you install this on your Delta Watch machine you should have no issue running it as the dependencies are the same as DW eagle.

  1. To install unzip eagle-ez-states.zip into the location you wish to install it to.
  2. (If you have not already installed Python do so now, make sure to add environment to PATH and install for all users)
  3. Double click on Setup.py (if this is the first time setting up Python, repeat this step twice)
  4. A shortcut to eagleEZstates should now be on your desktop.
  5. Double click to open the shortcut.
  6. Follow the instructions in the Help menu to configure you states(see below).

Help contents

  1. API configuration Open the properties of the data source in eagle and copy(crtl + c) the node id from the bottom left, paste this into the "source_parent_id" value Create the API key with MODIFY access from your account settings page in eagle.io and paste this into the "api_key" value
  2. Parameters configuration Enter all the parameter names you want to update, one per line. Match the names exactly as they are in eagle. TIP: If updating parameters in multple data sources add all the names to the parameters config, then simply update the API config with the parent ID of each data source and run once with each.
  3. Use the Fetch Parameters button to download and append the name of every parameter contained in the configured data source.
  4. States configuration States configuration can be included in the update request for Number and Text Parameter nodes. Number parameters can use either DISCRETE or RANGE states. Text parameters are limited to DISCRETE states only.
    • States can be reset to parameter defaults by updating the states attribute with null.
    • Update existing states by providing the _id attribute for each state in the request. Any states without the _id attribute will be ignored. Only changed attributes need to be specified.
    • If no states in the request contain an _id attribute the update will Replace the existing states. RANGE states for number parameters must always be specified in ascending order based on threshold and there must be one state with the name attribute set to NORMAL.
      Note: State type for number parameters can be changed with the statesType attribute. When changing statesType you should specify new states configuration or default states will be applied.

State attributes

Type

Description

name

String

Required. Unique name assigned to the state

threshold

Variable

Required. Unique threshold value for the state. Number parameters require a Double. Text parameters require a String.

occurrences

Int32

Optional - Default is 1. Minimum number of repeat values equal or beyond threshold required to trigger state: 1-15.

isAlarm

Boolean

Optional - Default is FALSE. Flag to indicate if this state should raise an alarm. Not valid for NORMAL RANGE state.

notify

String

Optional - Default is NEVER. When notifications should be triggered: [NEVER, ALWAYS, AWAY_FROM_NORMAL, TOWARDS_NORMAL]. The NORMAL RANGE state is restricted to: [NEVER, ALWAYS]

categoryId

ObjectId

Id of owner category to assign to this state. Required when notify option is not NEVER. In EZ states app this ID should be the category name, ID will automatically be looked up

messageAway

String

Optional. Custom message to send when the state becomes active (away from normal). Maximum of 255 characters. Leave empty for default message.

messageTowards

String

Optional. Custom message to send when the state becomes inactive (towards normal). Maximum of 255 characters. Leave empty for default message.

qualityCode

Int32

Optional - Default is null. Quality code to apply to acquired data that matches this state: 0-65535.

 

From <https://docs.eagle.io/en/latest/api/resources/nodes.html#states-configuration>

 

Example state config

 

    "statesType": "RANGE",   

"states": [

        {

            "name": "Test3",

            "threshold": 22,

            "isAlarm":true,

            "notify":"ALWAYS",

            "categoryId":"Maintenance"

        },

        {

            "name": "NORMAL"

        },

        {

            "name": "HIGH",

            "threshold": 50

       }

    ]

}