RICADO Gen 4 API JS Client

RICADO Gen 4 API JS Client

Class

PointController

Controller Class for Points

Constructor

new PointController()

Source

Methods

static

addPointEvents(siteId, objectItems) → {Promise.<boolean>}

Add Point Events [POST /sites/{siteId}/points/events]

Add Value Change Events for specified Points

Parameters

  • siteId number

    The Site ID

  • objectItems Array.<PointController.AddPointEventItem>

    An Array of Object Items

Returns

  • Promise.<boolean>

Source

static

addPointHistory(siteId, objectItems) → {Promise.<boolean>}

Add Point History [POST /sites/{siteId}/points/history]

Add Historical Values for specified Points

Parameters

  • siteId number

    The Site ID

  • objectItems Array.<PointController.AddPointHistoryItem>

    An Array of Object Items

Returns

  • Promise.<boolean>

Source

static

create(siteId, createData) → {Promise.<PointModel>}

Create a Point [POST /sites/{siteId}/points]

Parameters

  • siteId number

    The Site ID

  • createData PointController.CreateData

    The Point Create Data

Returns

  • Promise.<PointModel>

Source

static

delete(siteId, id) → {Promise.<boolean>}

Delete a Point [DELETE /sites/{siteId}/points/{id}]

Parameters

  • siteId number

    The Site ID

  • id number

    The Point ID

Returns

  • Promise.<boolean>

Source

static

getAll(siteId, queryParametersopt) → {Promise.<Array.<PointModel>>}

List all Points [GET /sites/{siteId}/points]

Parameters

  • siteId number

    The Site ID

  • queryParameters PointController.GetAllQueryParameters <optional>

    The Optional Query Parameters

Returns

  • Promise.<Array.<PointModel>>

Source

static

getAllEvents(siteId, pointIds, queryParametersopt) → {Promise.<Array.<PointController.PointEventItem>>}

Retrieve all Point Events [GET /sites/{siteId}/points/events]

Retrieves Events for all Points

Parameters

  • siteId number

    The Site ID

  • pointIds Array.<number>

    A List of Point IDs to Filter by

  • queryParameters PointController.GetAllEventsQueryParameters <optional>

    The Optional Query Parameters

Returns

  • Promise.<Array.<PointController.PointEventItem>>

Source

static

getAllHistory(siteId, pointIds, queryParametersopt) → {Promise.<Array.<PointController.PointHistoryItem>>}

Retrieve all Point History [GET /sites/{siteId}/points/history]

Retrieves History for all Points

Parameters

  • siteId number

    The Site ID

  • pointIds Array.<number>

    A List of Point IDs to Filter by

  • queryParameters PointController.GetAllHistoryQueryParameters <optional>

    The Optional Query Parameters

Returns

  • Promise.<Array.<PointController.PointHistoryItem>>

Source

static

getAllValues(siteId, queryParametersopt) → {Promise.<Array.<PointController.PointValueItem>>}

Retrieve all Point Values [GET /sites/{siteId}/points/values]

Retrieves Values for all Points

Parameters

  • siteId number

    The Site ID

  • queryParameters PointController.GetAllValuesQueryParameters <optional>

    The Optional Query Parameters

Returns

  • Promise.<Array.<PointController.PointValueItem>>

Source

static

getOne(siteId, id) → {Promise.<PointModel>}

Retrieve a Point [GET /sites/{siteId}/points/{id}]

Parameters

  • siteId number

    The Site ID

  • id number

    The Point ID

Returns

  • Promise.<PointModel>

Source

static

setValues(siteId, objectItems) → {Promise.<boolean>}

Set specific Point Values [POST /sites/{siteId}/points/values]

Sets Values for specified Points

Parameters

  • siteId number

    The Site ID

  • objectItems Array.<PointController.SetPointValueItem>

    An Array of Object Items

Returns

  • Promise.<boolean>

Source

static

update(siteId, id, updateData) → {Promise.<PointModel>}

Update a Point [PATCH /sites/{siteId}/points/{id}]

Parameters

  • siteId number

    The Site ID

  • id number

    The Point ID

  • updateData PointController.UpdateData

    The Point Update Data

Returns

  • Promise.<PointModel>

Source

Type Definitions

AddPointEventItem

A AddPointEventItem Type

Type

  • Object

Properties

  • id number

    The Point ID

  • oldValue any

    The Previous Point Value

  • newValue any

    The New Point Value

  • timestamp Date <optional>

    The Timestamp for the Point Event. Defaults to Now

Source

AddPointHistoryItem

A AddPointHistoryItem Type

Type

  • Object

Properties

  • id number

    The Point ID

  • value any

    The Point Value

  • timestamp Date <optional>

    The Optional Timestamp for the Point Value. Defaults to Now

Source

CreateData

The Create Data for a Point

Type

  • Object

Properties

  • rtuId number <optional>
    <nullable>

    The RTU this Point belongs to

  • pluginId number <optional>
    <nullable>

    The Plugin ID

  • name string

    The Point Name

  • type string

    The Point Type

  • valueType string

    The Point's Value Type

  • permissions string <optional>

    The Permissions

  • enabled boolean <optional>

    Whether the Point is Enabled

  • settings Object <optional>

    The Point Settings

Source

GetAllEventsQueryParameters

The Optional Query Parameters for the getAllEvents Function

Type

  • Object

Properties

  • timestampBegin Date <optional>

    The Beginning Timestamp of the Point Event Results. Defaults to 24 Hours ago

  • timestampEnd Date <optional>

    The End Timestamp of the Point Event Results. Defaults to Now

Source

GetAllHistoryQueryParameters

The Optional Query Parameters for the getAllHistory Function

Type

  • Object

Properties

  • timestampBegin Date <optional>

    The Beginning Timestamp of the Point History Results. Defaults to 24 Hours ago

  • timestampEnd Date <optional>

    The End Timestamp of the Point History Results. Defaults to Now

  • maximumValues number <optional>

    The Maximum Number of Values that should be returned for each Point ID. Defaults to an Unlimited Number of Values

  • resolution number <optional>

    A Resolution (Interval) in Seconds for the History Results - NOTE: Use of the maximumValues Query Parameter may enforce a higher minimum resolution. Defaults to 30 Seconds

Source

GetAllQueryParameters

The Optional Query Parameters for the getAll Function

Type

  • Object

Properties

  • rtuId number <optional>
    <nullable>

    The RTU this Point belongs to

  • pluginId number <optional>
    <nullable>

    The Plugin ID

  • name string <optional>

    The Point Name

  • type string <optional>

    The Point Type

  • valueType string <optional>

    The Point's Value Type

  • permissions string <optional>

    The Permissions

  • enabled boolean <optional>

    Whether the Point is Enabled

Source

GetAllValuesQueryParameters

The Optional Query Parameters for the getAllValues Function

Type

  • Object

Properties

  • pointIds Array.<number> <optional>

    A List of Point IDs to Filter by

Source

PointEventItem

A PointEventItem Type

Type

  • Object

Properties

  • id number

    The Point ID

  • oldValue any

    The Previous Point Value

  • newValue any

    The New Point Value

  • timestamp Date

    The Timestamp for the Point Event

Source

SetPointValueItem

A SetPointValueItem Type

Type

  • Object

Properties

  • id number

    The Point ID

  • value any

    The Point Value

  • timestamp Date <optional>

    An Optional Timestamp of when the Point Value last changed. Defaults to Now

Source

UpdateData

The Update Data for a Point

Type

  • Object

Properties

  • pluginId number <optional>
    <nullable>

    The Plugin ID

  • name string <optional>

    The Point Name

  • type string <optional>

    The Point Type

  • valueType string <optional>

    The Point's Value Type

  • permissions string <optional>

    The Permissions

  • enabled boolean <optional>

    Whether the Point is Enabled

  • settings Object <optional>

    The Point Settings

Source