OpenGate API

Introduction to OpenGate API

Welcome to the OpenGate API, an integral part of the OpenGate IoT Platform by amplía))) soluciones. We are a recognised company at the forefront of Industrial Internet of Things (IoT) solutions. This API is the backbone for connecting, managing and optimising a wide range of IoT devices and systems, providing unparalleled flexibility and control in industrial environments. Whether you are new to IoT or a seasoned professional, our documentation will guide you through the capabilities and features of the OpenGate API, enabling you to harness the full potential of IoT in your industrial applications.

Index

Subsections of OpenGate API

Management

Introduction to Management in OpenGate REST API

The Management section of the OpenGate REST API, an essential part of Amplía Soluciones’ OpenGate IoT platform, is designed to facilitate comprehensive and efficient management of IoT resources and configurations. It encompasses a broad array of functionalities that cater to various aspects of IoT management:

  • Organizations: This is the core where you can manage Channels and Entities, including entity types, statuses, devices, subscriptions, and more. It provides tools for Bulk Provisioning, both classic and using provision functions with a JavaScript API, along with Rules management including a default rules catalog.

  • Work Groups: Critical for team collaboration, it includes managing work group relations, geo-clusters, bundles, and users, along with user login and profile settings.

  • Geo-Areas, Data Models, and Tags: These features allow for geo-spatial organization, data structuring, and categorization of IoT elements.

  • Tickets: Handle customer service and operational issues efficiently.

  • Manufacturers & Models: Manage and catalog various manufacturers and their respective models.

  • Usage Plans and Certificates: Essential for securing and governing the use of IoT devices.

  • Mobile Operators: This includes management of APNs and GGSNs, crucial for cellular network-based IoT devices.

This section of the API is geared towards providing administrators and developers with the tools needed for detailed and organized management of IoT infrastructure and services, ensuring smooth operation and effective utilization of IoT resources.

Index of OpenGate management APIs


Subsections of Management

Organizations

Introduction

This document presents a comprehensive overview of the OpenGate Organization API, a pivotal component of the OpenGate IoT platform. As defined in the OpenAPI 3.0.0 specification, this API plays a crucial role in the holistic management of OpenGate organizations, which represent the highest-level and most crucial entities within the OpenGate platform.

The Role of Organizations in OpenGate

  • Foundation of the IoT Ecosystem: In the OpenGate system, an organisation is the fundamental unit from which all other entities are derived. The aforementioned entities comprise users, devices, assets, channels (i.e., device groups), work groups, and sub-organizations.
  • Central Control and Coordination Point: The utilisation of this API enables the effective control and coordination of the entire spectrum of an organisation’s IoT infrastructure within the OpenGate ecosystem.

Organizations

Key Functionalities

  • Comprehensive API Endpoints
    • /north/v80/search/organizations: Facilitates organization searches with customizable formats and filters.
    • /north/v80/search/organizations/summary: Offers summarised data about organisations for quick overviews.
    • /north/v80/provision/organizations: Enables the creation of new organisations with detailed JSON requests.
    • /north/v80/provision/organizations/{organizationId}: Manages specific organisation details, including retrieval, updates, and deletion.

Security and Access

  • Secured Access: Employs the use of “ApiKeyAmplia” and “BearerAuthJWT” for the purpose of ensuring secure interactions with the API, thereby guaranteeing the integrity and confidentiality of the data.
  • Consistent Endpoint: The API services are accessible at https://api.opengate.es, providing a stable and efficient gateway for organizational management.

This application programming interface (API) serves as the central nervous system of the OpenGate platform, offering sophisticated tools and interfaces for the administration of organisations. By mastering this API, users can effectively orchestrate the diverse components of their Internet of Things (IoT) solutions, ensuring seamless integration and optimal performance of their IoT ecosystem.

Plan feature

The Plan feature is a fundamental component of OpenGate, the function of which is to define the organisational usage limits. Each organization will have a specific plan setting, which may take the following forms:

  • The maximum number of devices, gateways or assets the organization can have.
  • The maximum time the collected data will be stored until it is evicted.
  • The maximum number of events collected by the platform in a period.

Comprehensive API actions

Updating an organization

It should be noted that the domain is not an updatable field; therefore, its inclusion in the put will result in an error.

Searching organizations summary

In its default state, the summary displays the total counter, the counter for the organisational grouping, and the counter for the channel grouping.

API specification

Subsections of Organizations

Channels - Device Groups

Introduction

The OpenGate API provides a solution for the management and organisation of Internet of Things (IoT) devices and assets. At the core of this organisational structure are the channels, which are a vital component of an efficient device and asset management system, enabling streamlined operations and enhanced oversight.

Understanding OpenGate Channels

The Channels feature of the OpenGate group unifies the categorisation of devices and assets, thereby simplifying the management of complex systems and providing a powerful tool for the application of policies, the execution of commands and the analysis of data across a fleet of devices. The use of Channels allows for the straightforward management and interaction with devices that share common characteristics or are part of a specific project or geographic location.

Key Benefits of Using Channels

  • Simplified Management: Organise devices and assets into manageable groups.
  • Targeted Operations: Execute commands and policies on a specific group of devices efficiently.
  • Enhanced Analytics: Analysing data at the group level allows you to gain insights that may otherwise be overlooked when looking at the data individually.

Importance of User and Work Group Assignments

In order to gain access to and assume control of channels, it is necessary for the user account associated with OpenGate to be incorporated into a workgroup. This method of access control, which is based on a multi-layered structure, guarantees that only those individuals who have been duly authorised will be able to interact with the devices and assets within a given channel. This approach ensures that the environment is secure and under the control of the relevant authorities.

How to Assign Work Groups to Channels

  1. Access the OpenGate User Management interface.
  2. Select the workgroup to be assigned to a Channel.
  3. Specify the Channels to which the workgroup is to be granted access.
  4. Save the changes to implement the new access permissions.

By meticulously assigning work groups to channels, it is possible to maintain a high level of security and ensure that users only have access to the devices and assets that are relevant to their role or of interest to them.

Comprehensive API actions

Updating a channel

The channel name field can’t be updated

API specification

Subsections of Channels - Device Groups

Entities

Entities provisioning

Entity object structure

In the context of the Internet of Things (IoT), an entity represents any monitoring element.

OpenGate offers four types of entities: asset, device, subscription, and subscriber. The resourceType field is used to set the entity type. The following table illustrates the process for setting each entity type:

Entity ResourceType attribute Description Provision
Asset entity.asset The software enables users to create new entities that are distinct from the device environment. see provision of assets
Device entity.device This is a hardware unit. see provision of devices
Subscription entity.subscription This section stores information regarding the contracts with your communication operators. see provision of subscriptions
Subscriber entity.subscriber It is used to store information regarding a specific communication channel. see provision of subscribers

Common objects and attributes

All the entities have several attributes, objects, and arrays in common. The following sections provide further details on these shared objects.

{
  "provision": {
    "administration": {
      "channel": {
        "_current": {
          "value": "wind_farm_channel"
        }
      },
      "organization": {
        "_current": {
          "value": "wind_farm_organization"
        }
      },
      "serviceGroup": {
        "_current": {
          "value": "emptyServiceGroup"
        }
      }
    },
    "device": {
      "identifier": {
        "_current": {
          "value": "wind_mill_id"
        }
      }
    }
  }
}

Identifier attributes

OpenGate supports a variety of entities, each of which is identified by a unique identifier.

Administrative data attributes

  • id: Each Internet of Things (IoT) entity on the platform is assigned a unique identifier automatically by the platform.
  • provision.device.identifier: The customer-generated ID is a string that identifies a device in a specific organisation. HTTP/1.1 201 Created Location: http://api.opengate.es/north/v80/provision/organizations/{organizationName}/devices/device_1 It is imperative that you use this identifier as a URL suffix when you wish to retrieve, update or delete your device.
  • provision.device.communicationModules[].identifier: The customer-generated ID is a string that identifies a communication module.
  • provision.device.communicationModules[].subscription.identifier: It is a customer-generated identifier comprising a string that identifies a subscription.
  • provision.device.communicationModules[].subscriber.identifier: It is a customer-generated identifier comprising a string that identifies a subscriber.

Administration object attributes

It is a requirement for all OpenGate entities to operate within an administrative context.

Attributes

  • organization: the organization that owns the entity.
    • Forbidden in entity update operation
    • Required in entity insert operation
    • Constraints: [a-zA-Z0-9] max 50 chars
  • channel: an administrative grouping method for your entities.
    • Required in entity insert operation.
    • Constraints: [a-zA-Z0-9] max 50 chars
  • administrativeState: see administrativeState values
Organization ID as URL parameter

In entity POST and PUT operations, OpenGate ignores the organisation field because its value is mandatory in the URL.

  • serviceGroup: Service configuration: configuration of services, operations available, etc.
    • Constraints: [a-zA-Z0-9] max 50 chars
    • Forbidden in bundle operations.
  • workgroup: the workgroup is the way to establish the relationships between devices and users. It’s used, for example, when you want to create software bundles.
    • Constraints: [a-zA-Z0-9] max 50 chars
    • This field only applies to OpenGate users.
  • plan (optional): an administrative concept that allows limiting the number of events sent by the device. This concept only applies to devices.
    • Constraints: [a-zA-Z0-9] max 50 chars
    • Forbidden in bundle operations.
    • Optional in entity insert and update operation.
Click to show administrative data as JSON document into a device entity…
{
  "provision": {
    "administration": {
      "channel": {
        "_current": {
          "value": "YOUR_CHANNEL_NAME"
        }
      },
      "organization": {
        "_current": {
          "value": "YOUR_ORGANIZATION_NAME"
        }
      },
      "serviceGroup": {
        "_current": {
          "value": "SERVICE_GROUP_FOR_THE_ENTITY"
        }
      },
      "plan": {
        "_current": {
          "value": "FLOW_RATE_100"
        }
      }
    }
  }
}

Service group

It is of the utmost importance to select the correct entity service group. The service group you choose will determine how OpenGate behaves when managing your devices in the following ways:

  • Permitted operations.
  • This document outlines the process by which the platform transmits scheduled operations to devices.
    • Always: This type is designed for devices that are continuously connected. In this scenario, OpenGate will initiate operations on the devices in accordance with the pre-defined schedule. In the event that the target device is not connected, the operation will be cancelled and an error message will be generated.
    • On-session-connection: In this instance, the platform saves operations for subsequent use. Upon establishing a connection with the platform, the device will be notified of any pending operations and these will be sent to the device. This mode is applicable to devices utilising web sockets or MQTT connectors.
    • On-demand: In this instance, the device will request any outstanding operations. This approach enables devices to conserve battery power and retrieve pending operations when active.
Details

Should you wish for your devices to request all pending operations, you may utilise MQTT connections with the on-demand configuration.

  • Trusted boot: It is a requirement that all messages received by the platform include a field with the trusted boot value. In the absence of this field, OpenGate will reject the message.
  • Device security mode: This option allows you to select the desired security level for communications between the device and platform. The available options are:
    • None: communications are not encrypted.
    • Level 1: One-way authentication (or platform authentication). The platform is the sole entity responsible for authenticating itself to the client. It issues the client a certificate to confirm the platform’s authenticity.
    • At Level 2, both the client and the server authenticate themselves to each other, ensuring the veracity of the certificate presented by the platform.
    • At Level 3, both the client and the server authenticate themselves to each other, confirming the availability of the platform’s device certificate.

Service groups available on OpenGate cloud instance

Name Entity Type Operation Group Operation on Demand Security Mode Trusted Boot
emptyServiceGroup Asset, Gateway, Communications Module, Subscriber, Subscription emptyServiceGroup Send Always None disabled
emptyServiceGroup onDemand Asset, Gateway emptyServiceGroup Send On Demand None disabled
emptyServiceGroup onSession Asset, Gateway emptyServiceGroup Send On Session Connection None disabled
level1SecurityServiceGroup Asset, Gateway emptyServiceGroup Send Always Level1 disabled
level2SecurityServiceGroup Asset, Gateway emptyServiceGroup Send Always Level2 disabled
level3SecurityServiceGroup Asset, Gateway emptyServiceGroup Send Always Level3 disabled
noUpdate Asset, Gateway, Communications Module noUpdate Send Always None disabled
trustedLevel1SecurityServiceGroup Asset, Gateway emptyServiceGroup Send Always Level1 enabled
trustedLevel2SecurityServiceGroup Asset, Gateway emptyServiceGroup Send Always Level2 enabled
trustedLevel3SecurityServiceGroup Asset, Gateway emptyServiceGroup Send Always Level3 enabled
trustedNoneSecurityServiceGroup Asset, Gateway emptyServiceGroup Send Always None enabled
trustedNoneSecurityServiceGroup_onDemand Asset, Gateway emptyServiceGroup Send On Demand None enabled

Plan feature

As outlined in the organization’s plan, usage limits are to be established for the OpenGate platform. In the case of entities, if your organization has not defined a collection event limit, it must be set at the time of entity creation.

Flattened format

It is possible to create and search for data stream values (see default data models) using the flat format. This format is the same as that used on the South API. To indicate if data streams are in a flattened form, use the Boolean parameter ‘flattened’ in the URL.

The format is:

{
  "parameter1_id": {
    "_value": {
      "_current": {
        "value": "value1"
      }
    }
  },
  "parameter2_id": {
    "_value": {
      "_current": {
        "value": "value2"
      }
    }
  },
  ...
  "parameterN_id": {
    "_value": {
      "_current": {
        "value": "valueN"
      }
    }
  }
}

The following examples demonstrate the process of transforming a hierarchical JSON format into a flattened JSON format. There are two types of values: simple and complex.

Simple values

The hierarchical JSON format is:

{
  "provision": {
    "administration": {
      "identifier": {
        "_current": {
          "value": "device_battery"
        }
      }
    }
  }
}

The flattened JSON format is:

{
  "provision.administration.identifier": {
    "_value": {
      "_current": {
        "value": "device_battery"
      }
    }
  }
}

Complex values

To illustrate this concept, we will examine two contrasting examples.

The hierarchical JSON format is:

{
  "provision": {
    "device": {
      "location": {
        "_current": {
          "value": {
            "position": {
              "type": "Point",
              "coordinates": [-3.7028, 40.41675]
            },
            "postal": "28013"
          }
        }
      }
    }
  }
}

The flattened JSON format is:

{
  "provision.device.location": {
    "_value": {
      "_current": {
        "value": {
          "position": {
            "type": "Point",
            "coordinates": [-3.7028, 40.41675]
          },
          "postal": "28013"
        }
      }
    }
  }
}

Another example:

The hierarchical JSON format is:

{
  "provision": {
    "device": {
      "communicationModules": [
        {
          "identifier": {
            "_current": {
              "value": "commsMod_battery_id"
            }
          },
          "name": {
            "_current": {
              "value": "commsMod_battery_name"
            }
          }
        }
      ]
    }
  }
}

In the context of creative operations, the flattened JSON format is as follows:

{
  "provision.device.communicationModules[].identifier": [
    {
      "_index": {
        "value": "commsMod_battery_id"
      },
      "_value": {
        "_current": {
          "value": "commsMod_battery_id"
        }
      }
    }
  ],
  "provision.device.communicationModules[].name": [
    {
      "_index": {
        "value": "commsMod_battery_id"
      },
      "_value": {
        "_current": {
          "value": "commsMod_battery_name"
        }
      }
    }
  ]
}

In the case of a reading operation, the flattened JSON format is as follows:

{
  "provision.device.communicationModules[].identifier": [
    {
      "_index": {
        "path": "provision.device.communicationModules[].identifier",
        "value": {
          "_current": {
            "value": "commsMod_battery_id",
            "provType": "MONITORING",
            "date": "2017-09-25T09:34:32.119Z"
          }
        }
      },
      "_value": {
        "_current": {
          "value": "commsMod_battery_id",
          "provType": "MONITORING",
          "date": "2017-09-25T09:34:32.119Z"
        }
      }
    }
  ],
  "provision.device.communicationModules[].name": [
    {
      "_index": {
        "path": "provision.device.communicationModules[].identifier",
        "value": {
          "_current": {
            "value": "commsMod_battery_id",
            "provType": "MONITORING",
            "date": "2017-09-25T09:34:32.119Z"
          }
        }
      },
      "_value": {
        "_current": {
          "value": "commsMod_battery_name",
          "provType": "MONITORING",
          "date": "2017-09-25T09:34:32.169Z"
        }
      }
    }
  ]
}

We will also demonstrate how to transform the existing normalised/flattened JSON examples into CSV format. The above examples will be joined together in a single CSV file comprising three lines, one for each example (a straightforward example and two complex examples).

Transforming the flattened format into CSV format is a relatively straightforward process, as the CSV file’s content adheres to the same guidelines as the flattened format. The first line (header) contains the name of the data stream, separated by “;”, and the following lines represent the different entities, with the field value of the data stream separated by “;” in the same order as the first line.

The following lines illustrate the format of a CSV file.

provision.administration.identifier;provision.device.location;provision.device.communicationModules[].identifier;provision.device.communicationModules[].name
device_battery;;;
;"{"position":{"type":"Point","coordinates":[-3.7028,40.41675]},"postal":"28013"}";;
;;commsMod_battery_id;commsMod_battery_name

In the event that an entity contains a unique communication module, it is possible to indicate the name without the use of square brackets and without the inclusion of an identifier. In light of this, it can be seen that the two strings in question, namely [commsMod_battery_name(commsMod_battery_id)] and commsMod_battery_name, are identical.

Comprehensive API actions

Searching entities

This API enables the retrieval of a comprehensive list of entities, offering a multitude of options for:

  • Filtering (see Specific Filter Fields)
  • Sorting (see Sorting)
  • Selecting Required Fields (see Selecting)
  • Summarising (see Summary)

The results can be obtained in two distinct formats:

  • JSON Format (Default)
  • CSV Format

Additionally, the results can be obtained in a flattened format through the use of flattened parameters.

API specification

Subsections of Entities

Entity types & statuses

Entity type list

  • GATEWAY: M2M device like a concentrator or smart router, modem or gateway, etc.
  • ASSET: Business entity, usually have one or more devices connected.
  • COMMUNICATIONS_MODULE: Internal modem or interface for communications.
  • SUBSCRIPTION: Logical identifier for a communication channel as a GMS line.
  • SUBSCRIBER: Physical device associated with a Logical subscription.

Default device administrative statuses

  • REQUESTED: Entity requested to the supplier
  • READY: Entity ready for installation
  • REPAIR: Entity under repair
  • TESTING: Entity in tests
  • ACTIVE: Entity deployed on field
  • SUSPEND: Suspended its operation
  • DELETED: Entity removed from available stock
  • RETIRED: Entity retired from field
  • BANNED: Entity banned, no data is going to be collected for devices with this status

Alarms for BANNED entities

The default rules catalog has an automation rule to elevate an alarm when a BANNED device shows activity. Besides that, you can run a job or schedule a task over entities with a BANNED administrative state.

Device operational statuses

  • UNKNOWN: Not known
  • NORMAL: Normal Operation
  • ALARM: The device has active alarms
  • TESTING: The device is under test. Could be running but it is not performing its normal operation.
  • DOWN: The device is not operative. Could be running but it is not performing its operation.
  • SAFE_MODE: The device is in Safe Mode (Sleeping, etc.)
  • TAMPER: The device was tampered
  • TEST: The device is working in test mode

Communication modules operational status

  • UNKNOWN: The module status is not known
  • STOPPED: The module is not working
  • STARTING: The module is booting
  • RUNNING: The module is working
  • STOPPING: The module is shutting down
  • ERROR: The module has an error

Devices

Introduction

A device represents the physical element (communications devices, concentrators, machines, sensors, etc.) through which data is collected.

Relation between devices and assets

A device can be linked to an asset through the provision.device.related data stream, which must contain the identifier of the asset in question.

When these entities are related, the asset is able to collect data from the related device. In order to do this, it is necessary to define an available data model for the Devices and Assets resources, and then define all the data streams that you want to copy from the device. Once this has been done, the asset will then automatically start collecting these values from the device.

Comprehensive API actions

Creating a device

New devices can be created by sending a POST request that includes a correctly formatted JSON document in the body.

A device may contain or not contain subscriptions and subscribers. Furthermore, these can exist independently (please refer to create subscriptions or create subscribers for more information).

It is essential that the subscription or subscriber is located within the communication modules on the device. Consequently, there are various use cases for managing device relations, depending on whether there are existing subscriptions or subscribers.

The following options are available for creating a device:

  1. Create a device without subscriptions or subscribers.
  2. Create a device with subscriptions or subscribers that do not exist in the platform.
  3. Create a device with subscriptions or subscribers that exist in the platform. In this instance, the following steps must be completed:
  • A device must be created (please refer to the ‘Create a device without subscriptions or subscribers’ section below for further details).
  • The device must then be updated with the relevant subscriptions or subscribers that are already present on the platform (please refer to the ‘Associate a subscription or subscriber to the device’ section below for further details).

Furthermore, a device can be linked to an asset. Please refer to the section entitled Relation between devices and assets for additional details.

Updating a device

Updates can be made to the following:

  • Device data
  • Device subscription or subscriber associations
  • Device subscription or subscriber disassociations

The JSON object passed will vary depending on the desired update.

Patching a device

It is possible to patch the following:

  • Only the device data
  • Associate a subscription or subscriber to the device The JSON object passed will be different depending on the desired patch. Furthermore, a device can be related to an asset. Please refer to the section entitled ‘Relation between devices and assets’ for more information.

Deleting a device

To delete a complete device with all associated subscriptions, send a DELETE request using the provided URL. The request should include a Boolean parameter, “full,” to indicate that you wish to delete the entire device.

Note

The default value of the field ‘full’ is set to ‘false’. In this case, if a device with a subscription or subscriber is deleted, only the device will be removed. Neither the subscription nor the subscriber will be deleted. After this, they will exist on the platform independently, without being associated with a device.

Searching device

This API enables the retrieval of a comprehensive list of devices, offering a multitude of options for:

  • Filter (See Specific Filter Fields)
  • Order (see Sorting)
  • Select Required Fields (see Selecting)
  • Summary (see Summary)

The results can be obtained in two different formats, as detailed in the HTTP Header Options.

  • JSON Format (Default)
  • CSV Format

As an alternative, the result can be obtained in a flattened format thanks to the flattened parameter (see device parameters).

API specification

Subscriptions

Introduction

A subscription stores information regarding the contracts with your communication operators. It can exist as a standalone entity or integrated within the device.

Comprehensive API actions

Patching a subscription

  • Please note that the administration channel value is mandatory for securitisation purposes in patch operation.
  • In the event of patching complex objects, any non-passed object attributes will be patched as non-existent. Therefore, it is advisable to include previous unchanged values to avoid any loss of data.

Searching subscriptions

The results can be obtained in two different formats, as detailed in the HTTP Header Options:

  • JSON Format (the default)
  • CSV Format

Searching subscriptions summary

The summary will always display the total counter, the organisation grouping counter and the channel grouping counter by default.

API specification

Subscribers

Introduction

The Subscriber Entity Store contains information regarding a specific communication channel. It can exist independently or within the device.

Comprehensive API actions

Patching a subscriber

  • Please note that the administration channel value is mandatory for securitisation purposes in patch operation.
  • In the event of patching complex objects, any non-passed object attributes will be patched as non-existent. Therefore, it is advisable to include previous unchanged values to avoid any loss of data.

Searching subscribers

The results can be obtained in two different formats, as detailed in the HTTP Header Options:

  • JSON Format (the default)
  • CSV Format

Searching subscribers summary

The summary will always display the total counter, the organisation grouping counter and the channel grouping counter by default.

API specification

Assets

Introduction

The software enables the creation of entities that are not devices, allowing users to emulate any type of entity they require, such as a worker or a spool.

Concurrently, a device may be associated with an asset. To illustrate, a worker may utilise a device that monitors a range of parameters.

These devices can take the form of a bracelet that monitors battery levels, pulse rate, temperature and position, or a vest that measures a range of other parameters.

An asset is able to identify its associated devices through the provision.asset.related data stream. This data contains an array of identifiers for the associated devices.

Should you wish to receive all information pertaining to the device in the asset, you must add a data model with dual data streams. Once both are related in this way, the assets will be able to receive all common data streams from the device. This ensures that all datastreams and data points collected will be in the cycle of life for both.

The platform is set up by default to offer the Entity data model, which contains two dual data streams: ’entity.location’ and ’entity.areas’. Please refer to the Default Datamodels section for more information.

Asset object structure

An asset is a repository of information about the new entity created by the user.

In regard to provisioned data, the following attributes are applicable:

  • Minimum attributes:
    • provision.administration.
    • provision.asset.identifier.
    • resourceType.
  • Recommended attributes by OpenGate:
    • provision.asset.administrativeState.
    • provision.asset.specificType.
    • provision.asset.name.
    • provision.asset.description.
  • Extended attributes:
    • provision.asset.location.
    • Defined attributes in human datamodel.
    • Defined by the user in his new datamodels. For example photo, position
Note

The specificType field is used to differentiate new entities. For instance, a worker is classified as an entity.asset with the specificType WORKER.

Comprehensive API actions

Creating an asset

New assets can be created by sending a POST request, including a correctly formatted JSON document in the POST body using the generic URL for entities

  • Please be advised that there is no requirement to include an organisation field in the JSON, as this information is already available in the URL.

It is not possible to create a list of devices associated with an asset. These must be added from the Devices section.

Updating an asset

Please be advised that an asset can be modified by sending a PATCH request using the generic URL for entities.

It is necessary to replace {identifier} with the identifier of the asset you wish to modify. Additionally, a boolean parameter, flattened, must be included to enable the sending of a flattened JSON format.

Warning
  • Please be advised that it is not possible to patch the list of devices associated with the asset. The devices must be patched from the list.
  • When patching complex object values, non-passed object attributes will be patched as non-existent. Therefore, it is advisable to include previous unchanged values to avoid any loss of data.
  • Please note that the Resource Type and Administration Channel values are mandatory in asset patch operations for securitisation purposes.

Deleting an asset

Note that it is not possible to delete the list of devices associated with an asset. Instead, you will need to delete them from the devices list.

Please be advised that an asset can be deleted by sending a DELETE request using the generic URL for entities.

API specification

Subsections of Bulk provisioning

Classic bulk provisioning

Introduction

The bulk function enables the provisioning of a list of entities or tickets in a single operation, in either synchronous or asynchronous mode.

Bulk Object Structure

Bulk requests and responses can be formatted in four different ways, which can be selected through the Content-Type HTTP header. The default format is JSON, but the other formats are also available:

  • CSV format
  • XLS Excel format
  • XLSX Excel format

Attaching Files as Multipart

The Async API enables the creation of multipart files. In this instance, the Content-Type HTTP header will be multipart/form-data, and the file type will be indicated in the attached content.

HTTP Header Options

The API enables the indication of the format in which the request content is to be sent, either JSON or CSV, via the HTTP header option “Content-Type”. Similarly, the API allows the indication of the format in which the response content is to be received, either JSON or CSV, via the HTTP header option “Accept”.

It is possible to send a request and receive a response in different formats. For example, a request sent in JSON format can be received in CSV format.

Content-type header

The bulk input can be provided in different formats, depending on the file type. The Content-Type header should indicate the format of the input data. The following formats are supported for both synchronous and asynchronous operations:

  • application/json: json
  • text/plain: csv
  • application/vnd.ms-excel: xls
  • application/vnd.openxmlformats-officedocument.spreadsheetml.sheet: xlsx

Accept Header

Please be advised that the bulk processing results will be created in the format indicated in the ACCEPT header of the POST call, for both synchronous and asynchronous operations. To achieve the desired result with the GET call, it is essential to ensure that the ACCEPT header is identical to that used in the POST call.

In the event that the POST is not completed with the correct MIME type in the ACCEPT header, an error message will be displayed. Similarly, if the GET is not completed with the correct MIME type in the ACCEPT header, the same error message will be displayed.

Comprehensive API actions

Synchronous bulk

Creating a synchronous bulk for entities

The Synchronous Bulk Creation process allows you to create multiple entities in a single request. This bulk operation applies to the following entities:

  • Assets
  • Devices
  • Subscriptions
  • Subscribers

Creating a synchronous bulk for tickets

The Synchronous Bulk Creation process for tickets allows you to create multiple ticket records in a single request.

Asynchronous bulk

Creating an Asynchronous bulk for entities

In the case of asynchronous calls, the POST method will return an empty body and the URL of the created bulk process in the Location header. To monitor the progress and outcome, a GET request should be made to the URL returned by the POST method.

Asynchronous searching

A comprehensive search is being conducted across all previously created bulk processes, whether completed or still in progress.

API specification

Provision functions for bulk provisioning

Limited access API

Limited access

Please note that the provision API of this feature is only available to the root profile. Similarly, the execution API (plan or bulk) of this feature is only available to the following profiles: root, admin, admin_domain, advanced and super_admin_domain. In contrast, the searching API is accessible to all users. Should you require further information, please consult your administrator.

Introduction

This API enables users to perform bulk provisioning using Provision Processors. These processors allow users to define their own Excel formatting using a JavaScript script, which adapts the formatting to align with the OpenGate APIs.

Provision Processor object structure

A Provision Processor will include a JSON object with a script field, which contains the JavaScript code responsible for processing inbound data and determining the appropriate actions for provisioning the relevant entities, such as JSON objects, devices, subscriptions and subscribers. When creating or updating a Provision Processor, only minimal parsing of the script will be performed.

Comprehensive API actions

Provision processors

Creating a provision processor

Please note that the Accept field should be set to application/JSON.

Updating a provision processor

All actions are based on application/JSON data formats.

Searching provision processors

Please search for all completed and ongoing bulk processes.

Executing provision processors

Executing plan from selected provision processor

  • As with the Bulk creation process, files will be attached as multipart, with only XLS and XLSX formats permitted.
  • In this instance, the Accept header must be set to application/JSON.

Rather than creating a bulk process, it would be more efficient to return the provision process planning for specified entries. This is a synchronisation process that does not result in changes to the database.

Executing bulk from selected provision processor

  • Files used for bulk processing will be attached to the request as multipart.
  • The attached file must contain a specific Content-Type property to indicate the format of the file.
  • Only XLS and XLSX formats are permitted.
  • The Accept header must match the attached file’s Content-Type.

Reading the bulk summary

Please note that the Accept field should be set to application/JSON.

Reading the bulk details from selected bulk

Please note that the Accept field should be the same used in the bulk creation request.

API specification

Subsections of Provision functions for bulk provisioning

JavaScript API

Introduction to provision processors

This API’s purpose is to facilitate the development of Provision Processors in the simplest possible way.

The API is divided into several modules/scripts:

  • Provision_Processor / provision_processor.js: This is the entry point from Java. It defines a template for Provision Processor execution.
  • Entities_Utils / provision_entity_utils.js: Utility class to facilitate the entities building.
  • Action_Utils / provision_actions_utils.js: Utility functions to create the actions to be returned to Java process.
  • V8_Api / provision_JavaV8_api.js: Functions used to invoke Java V8 methods.
  • V8_Utils / provision_JavaV8_utils.js: Some generic functions to use V8_API. When developing a new Provision Processor, instead of calling directly V8_Api functions is better to use the methods defined here.
  • Error_Api: Facility class to manage and transform caught OpenGate provision error.

Provision Processor

One Provision Processor is a script that, using Provision Javascript API, implements the business logic to transform inbound data into several actions to be done by Java to do correct provisioning actions.

How to Implement Provision Processor

When implementing a Provision Processor it is mandatory to implement two specific functions. These functions are called from Provision_Processor.processRow function:

  • normalizeRowMap(rawObject): This function receives a map with the data to be processed. For example, a map with the data read from an excel file. It takes the inbound parameter and transforms it into an object to be used to calculate and build the actions for this row. In this function, values validation and transformation should be done.
    • Input parameter: JSON object with raw keys and values.
    • Output: JSON object with the desired structure.
  • actionsPlanning(normalizedObject): Takes the result from normalizeRowMap function and calculates the actions to be done in Java.
    • Input parameter: Normalized object.
    • Output: Array of Actions.

It is possible to define extra functions to manage and transform provision errors. This function will be called from Main_Module.transformErrorMessage:

  • customErrorTransformer(errorManager): This function will be called when some provision error is caught (for example: duplicated entity). The goal is to create a customized error message for the Excel row update. This function is not mandatory, and if it is not defined, a default message will be returned by Main_Module.transformErrorMessage.
    • Input parameter: Object with error information (caught exception, failed action specification, and default message) and useful methods to manage this information.
    • Output: This function must return a String with the customized message.

Example of Provision Processor for creating devices and assets with some fields. It uses the functions and classes defined in Provision Javascript API.

   /* *******************
      MANDATORY FUNCTIONS 
      ******************* */

   function normalizeRawObject(rawObject) {

      try {
         var normalizedObject = {
            /* 
            In this case, raw object data comes from an excel
            and to specify the full key, we use the header name and column letter
            */
            organization: readMapValue(rawObject, 'Organization', '', 'A'),
            channel: readMapValue(rawObject, 'Channel Name', '', 'B'),

            /* maybe some values can be defined in the script as constants */
            service_group: 'emptyServiceGroup',

            /* We can do values validation and transformations. For example remove blanks from the value. */
            device_identifier: readMapValue(rawObject, 'Serial number', '', 'D').replace(/\s/g, ''),
            asset_identifier: readMapValue(rawObject, 'Asset Id', '', 'C').replace(/\s/g, '')
         };
         return normalizedObject;
      } catch (e) {
         printLog('>> normalizeRawObject(): exception: ' + e);
         throw e;
      }
   }


   function actionsPlanning(normalizedObject) {
      var actions = [];

      /* 
         In this case, we will create an asset and a device. 
         In the case of the device, if it exists, we are going to update it.
      */

      /* we check if the asset exists before creating it. */
      var assetExist = checkAsset(normalizedObject.asset_identifier);
      if(!assetExist){
         var assetEntity = generateAssetEntity(normalizedObject)
         actions.push(CREATE_ASSET_ACTION(assetEntity));
      }

      /* we check if the device exists. */
      var deviceExist = checkDevice(normalizedObject.device_identifier);
      var deviceEntity = generateDeviceEntity(normalizedObject)
      if(!deviceExist){
         actions.push(CREATE_DEVICE_ACTION(deviceEntity));
      }else{
         actions.push(UPDATE_DEVICE_ACTION(deviceEntity));
      }

      return actions;
   }


   /* ******************************************
      OPTIONAL FUNCTION for error transformation 
      ****************************************** */

   /* This function will be called when a provision exception is caught to get a customized message for excel row update */

   function customErrorTransformer(errorManager) {
      return 'This is customized message for error code: ' + errorManager.getFirstErrorCode() + ' and message: ' + errorManager.getFirstErrorMessage();
   }



   /* *************************
      Other auxiliary functions 
      ************************* */

   function generateDeviceEntity(normalizedObject) {
      try {
         var deviceEntity = new Entity()
               .addDatastream('provision.administration.channel', normalizedObject.channel)
               .addDatastream('provision.administration.serviceGroup', normalizedObject.service_group)
               .addDatastream('provision.administration.organization', normalizedObject.organization)
               .addDatastream('provision.administration.identifier', normalizedObject.device_identifier)
               .addDatastream('provision.device.related', normalizedObject.asset_identifier);

         return deviceEntity.entityJson;
      } catch (e) {
         printLog('>> generateDeviceEntity: Exception: ' + e);
         throw e;
      }
   }



   function generateAssetEntity(normalizedObject) {
      try {
         var assetEntity = new Entity()
               .addDatastream('resourceType', 'entity.asset')
               .addDatastream('provision.administration.channel', normalizedObject.channel)
               .addDatastream('provision.administration.serviceGroup', normalizedObject.service_group)
               .addDatastream('provision.administration.organization', normalizedObject.organization)
               .addDatastream('provision.administration.identifier', normalizedObject.asset_identifier);
         return assetEntity.entityJson;
      } catch (e) {
         printLog('>> generateAssetEntity: Exception: ' + e);
         throw e;
      }

   }
Important tips when writing a Provision Processor script

To add the script to Provision Processor JSON, it is necessary to take into these rules:

  • For strings, use single quotes (’) instead of double quotes (")
  • Use block comments (/**/) instead of line comments (//)
  • Format the script in a unique line script.

Action format

actionsPlanning returns an array of objects specifying the action to be done. Actions must be built with the functions defined in Action_Utils. Just to see the output format and following the previous example:

[
   {
      "action": "POST",
      "resourceType": "entity.asset",
      "actionDescription": "Create Asset",
      "json": {
         "resourceType": {
            "_value": {
               "_current": {
               "value": "entity.asset"
               }
            }
         },
         "provision.administration.channel": {
            "_value": {
               "_current": {
               "value": "some_channel"
               }
            }
         },
         "provision.administration.serviceGroup": {
            "_value": {
               "_current": {
               "value": "some_service_group"
               }
            }
         },
         "provision.administration.organization": {
            "_value": {
               "_current": {
               "value": "some_organization"
               }
            }
         },
         "provision.asset.identifier": {
            "_value": {
               "_current": {
               "value": "some_asset_identifier"
               }
            }
         }
      },
      "full": false
   },
   {
      "action": "POST",
      "entityType": "device",
      "actionDescription": "Create Device without Subscription",
      "json": {
         "resourceType": {
            "_value": {
               "_current": {
               "value": "entity.device"
               }
            }
         },
         "provision.administration.organization": {
            "_value": {
               "_current": {
               "value": "some_organization"
               }
            }
         },
         "provision.administration.channel": {
            "_value": {
               "_current": {
               "value": "some_channel"
               }
            }
         },
         "provision.administration.serviceGroup": {
            "_value": {
               "_current": {
               "value": "some_service_group"
               }
            }
         },
         "provision.device.identifier": {
            "_value": {
               "_current": {
               "value": "some_device_identifier"
               }
            }
         },
         "provision.device.related": {
            "_value": {
               "_current": {
               "value": "some_asset_identifier"
               }
            }
         }
      },
      "full": false
   }
]

Error management

Sometimes, it could be necessary to stop processing and abort all provision processes. For example, because some validation is not passed. In that case, an error must be thrown with a descriptive message. For example:

function actionsPlanning(normalizedObject) {
   var actions = [];

   ...

   if(! someValidation(normalizedObject)){
      throw new Error("Provision Processor Error: some validation not passed");
   }

   ...

   return actions;
}

Main Module

Main Module

Main Script: Defines Provision Processor template to be called from Java

Main_Module~globalParams

Global parameter with a received map of params from the java process. This parameter is set at the beginning of processRow and it can be used in any function in the script.

Kind: inner property of Main_Module

Main_Module~processRow(rawObject, processorParamsMap)

This is the function that will be called from the Java process.

To work correctly this function, it is mandatory to implement in the provision processor script the following functions:

  • normalizeRowMap(rawObject): This function will read and transform inbound rawObject and transform to normalizedObject object that will be used in actionsPlanning() function.
  • actionsPlanning(normalizedObject): This function has to apply business rules and calculate the actions array to be done by the Java process.

Kind: inner method of Main_Module
Returns: String - Json with following properties:

  • scriptDirectResult: OK or descriptive error text,
  • actionsToDo: Array with the list of Actions to be done in Java Process. This array can be empty.
Param Type Description
rawObject Object Json with excel row data
processorParamsMap Object Processor extra params map: can contain necessary parameters for odm api calls (key, organization) or useful parameters to define specific behaviors

Return Example

   {
      "scriptDirectResult": "OK",
      "actionsToDo":[
            {
               "action": "POST",
               "json": {...},
               "actionDescription": "Create Asset",
               "full": false,
               "resourceType": "entity.asset"
            },
            {
               "action": "PUT",
               "json": {...},
               "actionDescription": "Update Device",
               "full": false,
               "resourceType": "entity.device"
            }   
      ]
   }

Main_Module~_testTemplateImplementation()

Auxiliary function to check if main functions are implemented.

Kind: inner method of Main_Module
Throws:

  • Error if the main methods (normalizeRawObject and actionsPlanning) are not correctly defined as functions

Entities Utils

Entities_Utils

This module contains Entity class specifications and other useful functions to convert processor script inbound data to ODM Entities.

Entity

Class used to build Entity Jsons. It contains the necessary properties and methods to build any entity JSON.

  • entityJson: this property contains the Entity JSON.
  • addDatastream: this is the main method to be used to add or update desired datastreams to the Entity
  • deleteDatastream: this is the main method to be used to remove some datastream from Entity
  • getDatastream: this is the main method to be used get the value from specific datastream in the Entity
  • Other internal methods should not be necessary to call them.

Kind: inner class of Entities_Utils

Entity(entityIdentifier)

Init entityJson property with an entity identifier. Use new Entity(entityIdentifier) to create a new Entity.

Param Type Description
entityIdentifier String identifier for current entity.

Example of use:

const entity = new Entity("entityIdentifier");

entity.withPrefix(prefixToBeUsed)

Define the prefix of the datastreams to be used by addDatastream method. Adding a new prefix will override the previously added one. Use this method with an empty or undefined parameter to stop using any prefix.

Kind: instance method of Entity
Returns: Entity - Current Entity instance

Param Type Description
prefixToBeUsed String The prefix that will be used in next addDatastream calls. If it is empty the prefix will be removed.

Example of use:

entity.withPrefix("prefix");

entity.getDatastream(datastream, _index)

Search specified datastream and returns value. This function requires always complete datastream (ignores withPrefix functions calls).

Kind: instance method of Entity
Returns: * - Found datastream’s value, it can be complex. Null if not found.

Param Type Description
datastream String Datastream complete flattened name.
_index String If datastream is an array, index should be provided, if not, first element will be returned.

Example of use:

entity.getDatastream("datastream");

entity.deleteDatastream(datastream, _index)

Delete specified datastream. This function requires always complete datastream (ignores withPrefix functions calls).

Kind: instance method of Entity
Returns: * - Found datastream’s value, it can be complex. Null if not found.

Param Type Description
datastream String Datastream complete flattened name.
_index String If datastream is an array, index should be provided, if not, first element will be returned.

Example of use:

entity.deleteDatastream("datastream");

entity.addDatastream(datastream, value, _index)

Method to be used to add datastreams to current entity. Calling this method more than one time for the same datastream will have two different behaviors:

  • If _index parameter is defined, a new value will be added or updated to the array.
  • If _index parameter is not defined, the previous datastream will be overridden.

Kind: instance method of Entity
Returns: Entity - Current Entity instance

Param Type Description
datastream String Datastream flattened name.
value String Value for the datastream.
_index String If provided, it will create special indexed datastream (for communicationModules[] datastreams).

Example of use:

entity.addDatastream("datastream", "value");

entity._addToEntity(datastream)

Internal method. Attach provided datastream to current Entity’s JSON.

Kind: instance method of Entity
Returns: Entity - Current Entity instance.

Param Type Description
datastream Object Object to be attached to current Entity.

Example of use:

entity._addToEntity({ datastream: "value" });

entity._generateDatastreamJsonWithArray(datastream, valuesArray)

Internal method. Generates an object with datastream as field and provided array as value. This method is helpful for communicationModules[] datastreams.

Internally calls _cleanArray method to add good array.

Kind: instance method of Entity
Returns: Object - Json object with built datastream.

Param Type Description
datastream String Datastream flattened name.
valuesArray Array Array of objects for the datastream.

Example of use:

entity._generateDatastreamJsonWithArray("datastream", ["value"]);

entity._generateDatastreamWithJson(datastream, value)

Internal method. Generates an object with datastream as field and provided value. In this case, value can be a plain value (for example, String) or a complex JSON

Internally calls _generateJsonCurrentValue to build basic json structure.

Kind: instance method of Entity
Returns: Object - Json object with built datastream.

Param Type Description
datastream String Datastream flattened name.
value Object Json object with datastream value.

Example of use:

entity._generateDatastreamWithJson("datastream", { value: "value" });

entity._generateIndexedJson(index, value)

Internal method. Generates a json with provided index and value. This method will be used when creating datastreams with communicationModules[].

Kind: instance method of Entity
Returns: Object - Json object with indexed value structure.

Param Type Description
index String Identifier for _index value.
value * It can be plain value (String,…) or complex Json.

Example of use:

entity._generateIndexedJson("index", "value");

entity._generateJsonCurrentValue(value)

Internal method. Generates a JSON with basic structure datastream value.

Kind: instance method of Entity
Returns: Object - Json object with basic value structure.

Param Type Description
value * It can be plain value (String,…) or complex Json

Example of use:

entity._generateJsonCurrentValue("value");

Return example:

{
    "_value":{
        "_current":{
            "value": value
        }
    }
}

entity._cleanArray(valuesArray)

Internal method. Auxiliary method to clean empty ("", null, undefined) elements from provided array.

Kind: instance method of Entity
Returns: Array - New array without empty elements. null if the array is empty.

Param Type Description
valuesArray Array Array to be checked.

Example of use:

entity._cleanArray(["value", "", null, undefined]);

entity._generateDatastreamEntry(datastream, dsJson)

Internal method. Auxiliary method to build an object with datastream as field and provided JSON as value.

Kind: instance method of Entity
Returns: Object - Json object with built datastream.

Param Type Description
datastream String Datastream flattened name.
dsJson Object Json value for the datastream.

Example of use

entity._generateDatastreamEntry("datastream", { value: "value" });

Return examples:

{
    "datastream.name": {...}
}

or

{
    "datastream.name": [...]
}

readMapValue(map, headerName, defaultValue, headerColumn)

Auxiliary method to read values from the specified map.

A key will be created with headerName and headerColumn and the value for this key will be retrieved. If there is no entry for this key or the value is empty or undefined, defaultValue will be returned.

If headerColumn is null, only headerName will be used as the key.

Kind: inner method of Entities_Utils
Returns: * - Obtained value for specified header name and column or at least defined default value.

Param Type Description
map Object map from which to read values.
headerName String Header name for mapped row.
defaultValue * If no value is read or it is empty or undefined, default value will be returned.
headerColumn String Header column letter for mapped row (if null, only headerName will be used as key).

Example of use:

readMapValue(map, "headerName", "defaultValue", "headerColumn");

newEntityBuilder(fromEntityJson)

Creates Entity class object with specified entity json.

Kind: inner method of Entities_Utils
Returns: Entity - Entity Class instance

Param Type Description
fromEntityJson Object Json with Opengate flattened entity

Example of use:

var entity = newEntityBuilder(fromEntityJson);

Actions Utils

Action_Utils

Functions for building ODM Actions.

Action structure example:

{
   "action": "POST",
   "entityType": "device",
   "actionDescription": "Create Simple Device",
   "json": {...},
   "full": false
}

CREATE_ASSET_ACTION(entityJson, description)

Builds Create Asset action with provided JSON.

Kind: inner method of Action_Utils
Returns: Object - Created action.

Param Type Description
entityJson Object Asset Entity Json to be created.
description String Action short description.

Example of use:

const assetJson = {
    "name": "asset1",
    "description": "asset1",
    "type": "asset"
}
const action = CREATE_ASSET_ACTION(assetJson, "Create Asset");

UPDATE_ASSET_ACTION(entityJson, description)

Builds Update Asset action with provided JSON.

Kind: inner method of Action_Utils
Returns: Object - Created action.

Param Type Description
entityJson Object Asset Entity Json to be updated.
description String Action short description.

Example of use:

const assetJson = {
    "name": "asset1",
    "description": "asset1",
    "type": "asset"
}
const action = UPDATE_ASSET_ACTION(assetJson, "Update Asset");

PATCH_ASSET_ACTION(entityJson, description)

Builds Patch Asset action with provided JSON.

Kind: inner method of Action_Utils
Returns: Object - Created action.

Param Type Description
entityJson Object Asset Entity Json to be updated.
description String Action short description.

Example of use:

const assetJson = {
    "name": "asset1",
    "description": "asset1",
    "type": "asset"
}
const action = PATCH_ASSET_ACTION(assetJson, "Patch Asset");

DELETE_ASSET_ACTION(entityJson, description)

Builds Delete Asset action with provided JSON.

Kind: inner method of Action_Utils
Returns: Object - Created action.

Param Type Description
entityJson Object Asset Entity Json to be deleted.
description String Action short description.

Example of use:

const assetJson = {
    "name": "asset1",
    "description": "asset1",
    "type": "asset"
}
const action = DELETE_ASSET_ACTION(assetJson, "Delete Asset");

CREATE_DEVICE_ACTION(entityJson, description)

Builds Create Device action with provided JSON.

Kind: inner method of Action_Utils
Returns: Object - Created action.

Param Type Description
entityJson Object Device Entity Json to be created.
description String Action short description.

Example of use:

const deviceJson = {
    "name": "device1",
    "description": "device1",
    "type": "device"
}
const action = CREATE_DEVICE_ACTION(deviceJson, "Create Device");

UPDATE_DEVICE_ACTION(entityJson, description)

Builds Update Device action with provided JSON.

Kind: inner method of Action_Utils
Returns: Object - Created action.

Param Type Description
entityJson Object Device Entity Json to be updated.
description String Action short description.

Example of use:

const deviceJson = {
    "name": "device1",
    "description": "device1",
    "type": "device"
}
const action = UPDATE_DEVICE_ACTION(deviceJson, "Update Device");

PATCH_DEVICE_ACTION(entityJson, description)

Builds Patch DEVICE action with provided JSON.

Kind: inner method of Action_Utils
Returns: Object - Created action.

Param Type Description
entityJson Object Device Entity Json to be updated.
description String Action short description.

Example of use:

const deviceJson = {
    "name": "device1",
    "description": "device1",
    "type": "device"
}
const action = PATCH_DEVICE_ACTION(deviceJson, "Patch Device");

DELETE_DEVICE_ACTION(entityJson, full, description)

Builds Delete Device action with provided JSON.

Kind: inner method of Action_Utils
Returns: Object - Created action.

Param Type Description
entityJson Object Device Entity Json to be deleted.
full boolean true to delete also related Subscriptions and Subscribers.
description String Action short description.

Example of use:

const deviceJson = {
    "name": "device1",
    "description": "device1",
    "type": "device"
}
const action = DELETE_DEVICE_ACTION(deviceJson, true, "Delete Device");

CREATE_SUBSCRIPTION_ACTION(entityJson, description)

Builds Create Subscription action with provided JSON.

Kind: inner method of Action_Utils
Returns: Object - Created action.

Param Type Description
entityJson Object Subscription Entity Json to be created.
description String Action short description.

Example of use:

const subscriptionJson = {
    "name": "subscription1",
    "description": "subscription1",
    "type": "subscription"
}
const action = CREATE_SUBSCRIPTION_ACTION(subscriptionJson, "Create Subscription");

UPDATE_SUBSCRIPTION_ACTION(entityJson, description)

Builds Update Subscription action with provided JSON.

Kind: inner method of Action_Utils
Returns: Object - Created action.

Param Type Description
entityJson Object Subscription Entity Json to be updated.
description String Action short description.

Example of use:

const subscriptionJson = {
    "name": "subscription1",
    "description": "subscription1",
    "type": "subscription"
}
const action = UPDATE_SUBSCRIPTION_ACTION(subscriptionJson, "Update Subscription");

PATCH_SUBSCRIPTION_ACTION(entityJson, description)

Builds Patch Subscription action with provided JSON.

Kind: inner method of Action_Utils
Returns: Object - Created action.

Param Type Description
entityJson Object Subscription Entity Json to be updated.
description String Action short description.

Example of use:

const subscriptionJson = {
    "name": "subscription1",
    "description": "subscription1",
    "type": "subscription"
}
const action = PATCH_SUBSCRIPTION_ACTION(subscriptionJson, "Patch Subscription");

DELETE_SUBSCRIPTION_ACTION(entityJson, description)

Builds Delete Subscription action with provided JSON.

Kind: inner method of Action_Utils
Returns: Object - Created action.

Param Type Description
entityJson Object Subscription Entity Json to be deleted.
description String Action short description.

Example of use:

const subscriptionJson = {
    "name": "subscription1",
    "description": "subscription1",
    "type": "subscription"
}
const action = DELETE_SUBSCRIPTION_ACTION(subscriptionJson, "Delete Subscription");

CREATE_SUBSCRIBER_ACTION(entityJson, description)

Builds Create Subscriber action with provided JSON.

Kind: inner method of Action_Utils
Returns: Object - Created action.

Param Type Description
entityJson Object Subscriber Entity Json to be created.
description String Action short description.

Example of use:

const subscriberJson = {
    "name": "subscriber1",
    "description": "subscriber1",
    "type": "subscriber"
}
const action = CREATE_SUBSCRIBER_ACTION(subscriberJson, "Create Subscriber");

UPDATE_SUBSCRIBER_ACTION(entityJson, description)

Builds Update Subscriber action with provided JSON.

Kind: inner method of Action_Utils
Returns: Object - Created action.

Param Type Description
entityJson Object Subscriber Entity Json to be updated.
description String Action short description.

Example of use:

const subscriberJson = {
    "name": "subscriber1",
    "description": "subscriber1",
    "type": "subscriber"
}
const action = UPDATE_SUBSCRIBER_ACTION(subscriberJson, "Update Subscriber");

PATCH_SUBSCRIBER_ACTION(entityJson, description)

Builds Patch Subscriber action with provided JSON.

Kind: inner method of Action_Utils
Returns: Object - Created action.

Param Type Description
entityJson Object Subscriber Entity Json to be updated.
description String Action short description.

Example of use:

const subscriberJson = {
    "name": "subscriber1",
    "description": "subscriber1",
    "type": "subscriber"
}
const action = PATCH_SUBSCRIBER_ACTION(subscriberJson, "Patch Subscriber");

DELETE_SUBSCRIBER_ACTION(entityJson, description)

Builds Delete Subscriber action with provided JSON.

Kind: inner method of Action_Utils
Returns: Object - Created action.

Param Type Description
entityJson Object Subscriber Entity Json to be deleted.
description String Action short description.

Example of use:

const subscriberJson = {
    "name": "subscriber1",
    "description": "subscriber1",
    "type": "subscriber"
}
const action = DELETE_SUBSCRIBER_ACTION(subscriberJson, "Delete Subscriber");

_createAction(action, entityJson, entityType, full, description)

Internal method. Builds an action object with specified parameters.

Kind: inner method of Action_Utils
Returns: Object - Action object with provided parameters.

Param Type Description
action String Action to be done.
entityJson Object Entity JSON to be processed.
entityType String Entity type to be processed.
full Boolean Only for DELETE device. true to delete also related Subscriptions and Subscribers.
description String Action short description.

Example of use:

const action = _createAction("CREATE", deviceJson, "device", false, "Create Device");

V8 Utils API

V8_Api

Java V8 API: Functions encapsulate the logic for calling Java V8 Methods.

Java V8 Methods are defined in: es.amplia.odm.frontend.ws.provision.bulk.bulkProcessor.jsEngine.ProvisionProcessorScriptExecutor

These are the methods defined:

  • printLogInternal (printLog): writes INFO log messages.
    • params:
      • String msg: message to be printed.
  • getEntityInternal (getEntity): gets specific Entity for provided id.
    • params:
      • String provisionType: it should be always ‘ENTITY’.
      • String resourceType: the entity type to be retrieved.
      • String entityId: entity to be retrieved.
      • Map javaParams: mandatory params to configure the query (api key, organization id…).
    • return:
      • String: Entity json.
  • genericSearchInternal (genericSearch): searches entities with provided filter.
    • params:
      • String searchTypeValue: What kind of elements must be search.
      • String searchQueryValue: Json format filter.
      • Map javaParams: mandatory params to configure the query (api key, organization id…).
    • return:
      • String: Json with found elements and page information.

printLog(msg)

Invokes Java V8 printLogInternal method.

Kind: inner method of V8_Api

Param Type Description
msg String String to be printed in Java logs

Example of use:

printLog('Provision processor started');

getEntity(entityId, resourceType, queryContextParams)

Invokes Java V8 getEntityInternal method.

Use queryContextParams parameter to specify query behavior. It is a JSON with next properties:

  • utc: used to format datetime fields. Default value: false.
  • flattened: used to specify if entity must be returned flattened or not. Default value: true.

Kind: inner method of V8_Api
Returns: Object - Entity Json. null if no entity is found

Param Type Description
entityId String Id of the entity to be retrieved
resourceType String Parameter used to specify the entity type to be retrieved
queryContextParams Object Parameters for query. Not mandatory

Example of use:

var assetEntity = getEntity(normalizedObject.asset_identifier, 'entity.asset');

entitiesGenericSearch(searchFilter, queryContextParams)

Invokes Java V8 genericSearchInternal method for ENTITIES.

Use queryContextParams parameter to specify query behavior. It is a JSON with next properties:

  • utc: used to format datetime fields. Default value: false.
  • flattened: used to specify if entity must be returned flattened or not. Default value: true.
  • defaultSorted: specifies if result must be sorted by default field. Default value: false.

Kind: inner method of V8_Api
Returns: Object - Search result json. null if no result is found.

Param Type Description
searchFilter String json search filter
queryContextParams Object Parameters for query. Not mandatory

Example of use:

var assetEntity = entitiesGenericSearch(normalizedObject.asset_identifier, 'entity.asset');

_minJavaParams(queryContextParams)

Auxiliary method to build params maps for Java Queries

Kind: inner method of V8_Api
Returns: Object - Json object

Param Type Description
queryContextParams Object parameters for query. Not mandatory.

Example of use:

var javaParams = _minJavaParams({ utc: true });

V8_Utils

Java V8 Utils: Some predefined functions for Java V8 calls. These functions internally call V8_Api functions.

checkAsset(id)

Check if an Asset exists for specified id.

Kind: inner method of V8_Utils
Returns: boolean - If the asset exists.

Param Type Description
id String asset identifier.

Example of use:

if (checkAsset(normalizedObject.asset_identifier)) {
  printLog('Check returned true');
}

checkDevice(id)

Check if a Device exists for specified id.

Kind: inner method of V8_Utils
Returns: boolean - If the Device exists.

Param Type Description
id String Device identifier.

Example of use:

if (checkDevice(normalizedObject.device_identifier)) {
  printLog('Check returned true');
}

checkSubscription(id)

Check if a Subscription exists for specified id.

Kind: inner method of V8_Utils
Returns: boolean - If the Subscription exists.

Param Type Description
id String Subscription identifier.

Example of use:

if (checkSubscription(normalizedObject.subscription_identifier)) {
  printLog('Check returned true');
}

checkSubscriber(id)

Check if a Subscriber exists for specified id.

Kind: inner method of V8_Utils
Returns: boolean - If the Subscriber exists.

Param Type Description
id String Subscriber identifier.

Example of use:

if (checkSubscriber(normalizedObject.subscriber_identifier)) {
  printLog('Check returned true');
}

getAssetEntity(id)

Gets specific Asset for specified id.

Kind: inner method of V8_Utils
Returns: Object - Asset entity, null if the Asset does not exist.

Param Type Description
id String Asset identifier.

Example of use:

var assetEntity = getAssetEntity(normalizedObject.asset_identifier);

getDeviceEntity(id)

Gets specific Device for specified id.

Kind: inner method of V8_Utils
Returns: Object - Device entity, null if the Device does not exist.

Param Type Description
id String Device identifier.

Example of use:

var deviceEntity = getDeviceEntity(normalizedObject.device_identifier);

getSubscriptionEntity(id)

Gets specific Subscription for specified id.

Kind: inner method of V8_Utils
Returns: Object - Subscription entity, null if the Subscription does not exist.

Param Type Description
id String Subscription identifier.

Example of use:

var subscriptionEntity = getSubscriptionEntity(normalizedObject.subscription_identifier);

getSubscriberEntity(id)

Gets specific Subscriber for specified id.

Kind: inner method of V8_Utils
Returns: Object - Subscriber entity, null if the Subscriber does not exist.

Param Type Description
id String Subscriber identifier.

Example of use:

var subscriberEntity = getSubscriberEntity(normalizedObject.subscriber_identifier);

duplicatedDsInSubscriptions(currentSubscriptionId, …datastreamsToCheck)

Searches for duplicated datastreams in other Subscriptions (other than currentSubscriptionId).

Kind: inner method of V8_Utils
Returns: boolean - If some Subscription has been found with some of duplicated datastreams.

Param Type Description
currentSubscriptionId String The Subscription id with the datastreams to be checked.
…datastreamsToCheck Object Datastreams to be checked if they are duplicated. Each datastream must be defined as {“datastreamId”: “datastreamValue”}.

Example of use:

if (duplicatedDsInSubscriptions(normalizedObject.subscription_identifier, normalizedObject.datastreams)) {
  printLog('Check returned true');
}

duplicatedDsInSubscribers(currentSubscriberId, …datastreamsToCheck)

Searches for duplicated datastreams in other Subscribers (other than currentSubscriberId).

Kind: inner method of V8_Utils
Returns: boolean - If some Subscriber has been found with some of duplicated datastreams

Param Type Description
currentSubscriberId String The Subscriber id with the datastreams to be checked.
…datastreamsToCheck Object Datastreams to be checked if they are duplicated. Each datastream is defined as a pair {“datastreamId”: “datastreamValue”}.

Example of use:

if (duplicatedDsInSubscribers(normalizedObject.subscriber_identifier, normalizedObject.datastreams)) {
  printLog('Check returned true');
}

duplicatedDsInDevices(currentDeviceId, …datastreamsToCheck)

Searches for duplicated datastreams in other Devices (other than currentDeviceId).

Kind: inner method of V8_Utils
Returns: boolean - If some Device has been found with some of duplicated datastreams.

Param Type Description
currentDeviceId String The Device id with the datastreams to be checked.
…datastreamsToCheck Object Datastreams to be checked if they are duplicated. Each datastream is defined as a pair {“datastreamId”: “datastreamValue”}.

Example of use:

if (duplicatedDsInDevices(normalizedObject.device_identifier, normalizedObject.datastreams)) {
  printLog('Check returned true');
}

duplicatedDsInAssets(currentAssetId, …datastreamsToCheck)

Searches for duplicated datastreams in other Assets (other than currentAssetId).

Kind: inner method of V8_Utils
Returns: boolean - If some Asset has been found with some of duplicated datastreams.

Param Type Description
currentAssetId String The Asset id with the datastreams to be checked.
…datastreamsToCheck Object Datastreams to be checked if they are duplicated. Each datastream is defined as a pair {“datastreamId”: “datastreamValue”}.

Example of use:

if (duplicatedDsInAssets(normalizedObject.asset_identifier, normalizedObject.datastreams)) {
  printLog('Check returned true');
}

_checkEntity(id, resourceType)

Internal method. Check if an ENTITY exists for the specified id and resource type.

Kind: inner method of V8_Utils
Returns: boolean - If the ENTITY exists.

Param Type Description
id String Entity id to be checked.
resourceType String Entity type to be checked.

Example of use:

if (_checkEntity(normalizedObject.asset_identifier, 'asset')) {
  printLog('Check returned true');
}

_checkDuplicatedDS(currentEntityIdentifierDatastream, currentEntityIdentifierValue, …datastreamsToCheck)

Internal method. Searches for duplicated datastreams in other entities than the specified one.

Kind: inner method of V8_Utils
Returns: boolean - If duplicated Datasteams are found in other entities.

Param Type Description
currentEntityIdentifierDatastream String Datastream used to specify the Entity id with the datastreams to be checked.
currentEntityIdentifierValue String Value for currentEntityIdentifierDatastream field.
…datastreamsToCheck Object Datastreams to be checked if they are duplicated. Each datastream is defined as a pair {“datastreamId”: “datastreamValue”}.

Example of use:

if (_checkDuplicatedDS(normalizedObject.subscription_identifier, normalizedObject.subscription_identifier, normalizedObject.datastreams)) {
  printLog('Check returned true');
}

Error API

Error_Api

This module contains ErrorManager class specification.

ErrorManager

Class used to manage and extract information from caught provision action exception. Internally contains following objects:

  • platformErrors: list of ApiPlatformError representation.
  • actionObject: OdmProvisionAction representation.
  • defaultErrorMessage: default error message string.

Kind: inner class of Error_Api

ErrorManager(platformErrors, actionObject, defaultErrorMessage)

Initialize ErrorManager entity. Use new keyword to create an instance of ErrorManager.

Param Type Description
platformErrors Object list of ApiPlatformError representation.
actionObject Object OdmProvisionAction representation.
defaultErrorMessage String default error message.

Example of use:

var errorManager = new ErrorManager(platformErrors, actionObject, defaultErrorMessage);

errorManager.getDefaultMessage()

Kind: instance method of ErrorManager
Returns: string - initialized default message

Example of use:

var defaultMessage = errorManager.getDefaultMessage();

errorManager.getFirstError()

Returns first error object.

Kind: instance method of ErrorManager
Returns: Object - first error. It can be undefined or null.

Example of use:

var firstError = errorManager.getFirstError();

errorManager.getFirstErrorAsString()

Returns first error object as string

Kind: instance method of ErrorManager
Returns: string - first error as string. It can be undefined or null.

Example of use:

var firstErrorAsString = errorManager.getFirstErrorAsString();

errorManager.getFirstErrorMessage()

Returns first error’s message property.

Kind: instance method of ErrorManager
Returns: String - message property value. It can be undefined or null.

Example of use:

var firstErrorMessage = errorManager.getFirstErrorMessage();

errorManager.getFirstErrorCode()

Returns first error’s code property.

Kind: instance method of ErrorManager
Returns: String - code property value. It can be undefined or null.

Example of use:

var firstErrorCode = errorManager.getFirstErrorCode();

errorManager.getFirstErrorContextArray()

Returns first error’s context property.

Kind: instance method of ErrorManager
Returns: array - context property value as array. It can be undefined or null.

Example of use:

var firstErrorContextArray = errorManager.getFirstErrorContextArray();

errorManager.getFirstErrorContextArrayAsString()

Returns first error’s context property.

Kind: instance method of ErrorManager
Returns: string - context property value as string. It can be undefined or null.

Example of use:

var firstErrorContextArrayAsString = errorManager.getFirstErrorContextArrayAsString();

errorManager.getFirstContextName()

Returns first error’s first context’s name property.

Kind: instance method of ErrorManager
Returns: string - context name property value. It can be undefined or null.

Example of use:

var firstContextName = errorManager.getFirstContextName();

errorManager.getFirstContextValue()

Returns first error’s first context’s value property.

Kind: instance method of ErrorManager
Returns: string - context value property value. It can be undefined or null.

Example of use:

var firstContextValue = errorManager.getFirstContextValue();

errorManager.getFirstContext()

Returns first error’s first context object.

Kind: instance method of ErrorManager
Returns: Object - context object. It can be undefined or null.

Example of use:

var firstContext = errorManager.getFirstContext();

errorManager.getFirstContextAsString()

Returns first error’s first context object as string.

Kind: instance method of ErrorManager
Returns: string - context object as string. It can be undefined or null.

Example of use:

var firstContextAsString = errorManager.getFirstContextAsString();

errorManager.getErrorsSize()

Returns number of errors contained.

Kind: instance method of ErrorManager
Returns: number - size of contained errors.

Example of use:

var errorsSize = errorManager.getErrorsSize();

errorManager.getSpecificErrorObject(index)

Returns specific error object

Kind: instance method of ErrorManager
Returns: Object - error object. It can be undefined or null.

Param Type Description
index number error index in errors list

Example of use:

var specificErrorObject = errorManager.getSpecificErrorObject(0);

errorManager.getSpecificErrorObjectAsString(index)

Returns specific error object as a string

Kind: instance method of ErrorManager
Returns: string - error object as string. It can be undefined or null.

Param Type Description
index number error index in errors list

Example of use:

var specificErrorObjectAsString = errorManager.getSpecificErrorObjectAsString(0);

errorManager.getSpecificErrorMessage(index)

Returns specific error’s message

Kind: instance method of ErrorManager
Returns: String - message property value for specified error. It can be undefined or null.

Param Type Description
index number error index in errors list

Example of use:

var specificErrorMessage = errorManager.getSpecificErrorMessage(0);

errorManager.getSpecificErrorCode(index)

Returns specific error’s code

Kind: instance method of ErrorManager
Returns: String - code property value for specified error. It can be undefined or null.

Param Type Description
index number error index in errors list

Example of use:

var specificErrorCode = errorManager.getSpecificErrorCode(0);

errorManager.getSpecificErrorContextArray(index)

Returns specific error’s context property as array.

Kind: instance method of ErrorManager
Returns: array - context property value as array. It can be undefined or null.

Param Type Description
index number error index in errors list

Example of use:

var specificErrorContextArray = errorManager.getSpecificErrorContextArray(0);

errorManager.getSpecificErrorContextArrayAsString(index)

Returns specific error’s context property as string.

Kind: instance method of ErrorManager
Returns: string - context property value for specified error. It can be undefined or null.

Param Type Description
index number error index in errors list

Example of use:

var specificErrorContextArrayAsString = errorManager.getSpecificErrorContextArrayAsString(0);

errorManager.getSpecificContext(errorIndex, contextIndex)

Returns specific context in specific error.

Kind: instance method of ErrorManager
Returns: Object - context object. It can be undefined or null.

Param Type Description
errorIndex number error index in errors list
contextIndex number context index in specified error

Example of use:

var specificContext = errorManager.getSpecificContext(0, 0);

errorManager.getSpecificContextAsString(errorIndex, contextIndex)

Returns specific context in specific error as string.

Kind: instance method of ErrorManager
Returns: string - context object. It can be undefined or null.

Param Type Description
errorIndex number error index in errors list
contextIndex number context index in specified error

Example of use:

var specificContextAsString = errorManager.getSpecificContextAsString(0, 0);

errorManager.getSpecificContextName(errorIndex, contextIndex)

Returns specific context’s name in specific error.

Kind: instance method of ErrorManager
Returns: string - name property value for specified context. It can be undefined or null.

Param Type Description
errorIndex number error index in errors list
contextIndex number context index in specified error

Example of use:

var specificContextName = errorManager.getSpecificContextName(0, 0);

errorManager.getSpecificContextValue(errorIndex, contextIndex)

Returns specific context’s value in specific error.

Kind: instance method of ErrorManager
Returns: string - value property value for specified context. It can be undefined or null.

Param Type Description
errorIndex number error index in errors list
contextIndex number context index in specified error

Example of use:

var specificContextValue = errorManager.getSpecificContextValue(0, 0);

errorManager.getAdministrationIdentifier()

Returns entity administration identifier.

Kind: instance method of ErrorManager
Returns: string - It can be undefined or null.

Example of use:

var administrationIdentifier = errorManager.getAdministrationIdentifier();

errorManager.getDatastreamValue(index)

Returns from entity (in OdmProvisionAction) specific datastream value (datastream._value._current.value). It can be an object or plain string.

Kind: instance method of ErrorManager
Returns: Object - Object with specific datastream. It can be undefined or null.

Param Type Description
index number error index in errors list

Example of use:

var datastreamValue = errorManager.getDatastreamValue(0);

errorManager.getDatastreamValueAsString(index)

Returns from entity (in OdmProvisionAction) specific datastream value (datastream._value._current.value). It can be a json string.

Kind: instance method of ErrorManager
Returns: string - String with specific datastream. It can be undefined or null.

Param Type Description
index number error index in errors list

Example of use:

var datastreamValueAsString = errorManager.getDatastreamValueAsString(0);

errorManager.getAction()

Returns provision action type (POST, PUT, PATCH, DELETE) from OdmProvisionAction

Kind: instance method of ErrorManager
Returns: string - It can be undefined or null.

Example of use:

var action = errorManager.getAction();

errorManager.isPost()

Kind: instance method of ErrorManager
Returns: boolean - true if provision action is POST.

Example of use:

var isPost = errorManager.isPost();

errorManager.isPut()

Kind: instance method of ErrorManager
Returns: boolean - true if provision action is PUT.

Example of use:

var isPut = errorManager.isPut();

errorManager.isPatch()

Kind: instance method of ErrorManager
Returns: boolean - true if provision action is PATCH.

Example of use:

var isPatch = errorManager.isPatch();

errorManager.isDelete()

Kind: instance method of ErrorManager
Returns: boolean - true if provision action is DELETE.

Example of use:

var isDelete = errorManager.isDelete();

errorManager.getEntityType()

Returns provision entity type (asset, device, subscription, subscriber) from OdmProvisionAction

Kind: instance method of ErrorManager
Returns: string - It can be undefined or null.

Example of use:

var entityType = errorManager.getEntityType();

errorManager.isSubscription()

Kind: instance method of ErrorManager
Returns: boolean - true if provision entity is subscription.

Example of use:

var isSubscription = errorManager.isSubscription();

errorManager.isSubscriber()

Kind: instance method of ErrorManager
Returns: boolean - true if provision entity is subscriber.

Example of use:

var isSubscriber = errorManager.isSubscriber();

errorManager.isDevice()

Kind: instance method of ErrorManager
Returns: boolean - true if provision entity is device.

Example of use:

var isDevice = errorManager.isDevice();

errorManager.isAsset()

Kind: instance method of ErrorManager
Returns: boolean - true if provision entity is asset.

Example of use:

var isAsset = errorManager.isAsset();

Rules

Introduction

A rule is primarily composed of conditions and actions. When a rule is defined, a rule type can be specified, which determines the structure of the rule.

  • DATASTREAM: This type of rule would be evaluated if data were collected in the South API.
  • OPERATION: This type of rule would be evaluated if an operation were executed on the Opengate platform.
  • EVENT: This type of rule would be evaluated if an event were sent to the Opengate platform.

Automation rules

The set of conditions and actions can be defined in EASY mode using a JSON structure, or alternatively, an advanced rule can be written in JavaScript code.

Easy mode

The “easy mode” allows users to define new rules using the JSON format. Firstly, the rule type must be specified, as this will determine the structure of the rule.

  • Data stream: If this option is selected, the rules engine will evaluate data stream rules if an entity is modified using the north OpenGate API or when OpenGate collects data through any of the south connectors. In this case, the data streams that the rule will use must be configured in the condition.
  • Operation: If this option is selected, the rules engine will evaluate operation responses after they have been managed by the OpenGate operations engine.

Configure data stream and parameters in the rule

It is possible to utilise data streams and parameter values within the configuration of rules. This can be done in a number of ways, including in conditions and some attributes in rule actions.

  • datastream: $datastream:<id_datastream>
  • parameter: $parameter:<id_parameter>

Example:

  • datastream: $datastream:device.identifier._current.value
  • parameter: $parameter:threshnew

Further examples can be found in the schemas’ objects.

Comprehensive API actions

Updating a rule

All fields may be updated in accordance with the same validations as a POST request, with the exception of identifier, organisation and channel. Furthermore, an ADVANCED rule cannot be changed to EASY mode.

API specification

Subsections of Rules

Advanced Rules Mode

Rules in Advanced Mode

In advanced rules, you can write conditions and actions in javascript language.

In this javascript code, it is possible to call some defined functions to execute the same actions that you can do in easy mode. On the other hand, we also have some help functions. We will explain them below.

The main function will receive a flattened entity representation, adding the _received and _previous values to each datastream. The _received field is a simple object in provision datastreams and an array object in any other case.

We will use the following entity as an example:

entity = {
  "provision.administration.channel": {
    "_value": {
      "_current": {
        "value": "battery_channel",
        "date": "2017-12-01T08:52:37.563Z",
        "at": "2017-12-01T08:52:37.563Z"
      },
      "_previous": {
        "value": "battery_channel",
        "date": "2017-12-01T08:52:37.563Z",
        "at": "2017-12-01T08:52:37.563Z"
      }
    }
  },
  "provision.administration.identifier": {
    "_value": {
      "_current": {
        "value": "device_battery_id",
        "provType": "MONITORING",
        "date": "2017-12-01T08:52:37.57Z",
        "at": "2017-12-01T08:52:37.57Z"
      },
      "_previous": {
        "value": "battery_organization",
        "provType": "MONITORING",
        "date": "2017-12-01T08:52:37.566Z",
        "at": "2017-12-01T08:52:37.566Z"
      }
    }
  },
  "provision.administration.organization": {
    "_value": {
      "_current": {
        "value": "battery_organization",
        "provType": "MONITORING",
        "date": "2017-12-01T08:52:37.566Z",
        "at": "2017-12-01T08:52:37.566Z"
      },
      "_previous": {
        "value": "battery_organization",
        "provType": "MONITORING",
        "date": "2017-12-01T08:52:37.566Z",
        "at": "2017-12-01T08:52:37.566Z"
      }
    }
  },
  "provision.administration.plan": {
    "_value": {
      "_current": {
        "value": "FLOW_RATE_100",
        "provType": "MONITORING",
        "date": "2017-12-01T08:52:37.565Z",
        "at": "2017-12-01T08:52:37.565Z"
      },
      "_previous": {
        "value": "FLOW_RATE_100",
        "provType": "MONITORING",
        "date": "2017-12-01T08:52:37.565Z",
        "at": "2017-12-01T08:52:37.565Z"
      }
    }
  },
  "provision.administration.serviceGroup": {
    "_value": {
      "_current": {
        "value": "emptyServiceGroup",
        "provType": "MONITORING",
        "date": "2017-12-01T08:52:37.561Z",
        "at": "2017-12-01T08:52:37.561Z"
      },
      "_previous": {
        "value": "emptyServiceGroup",
        "provType": "MONITORING",
        "date": "2017-12-01T08:52:37.561Z",
        "at": "2017-12-01T08:52:37.561Z"
      }
    }
  },
  "provision.device.communicationModules[].identifier": [
    {
      "_index": {
        "path": "provision.device.communicationModules[].identifier",
        "value": {
          "_current": {
            "value": "commsMod_battery_id",
            "provType": "MONITORING",
            "date": "2017-12-01T08:52:37.577Z",
            "at": "2017-12-01T08:52:37.577Z"
          }
        }
      },
      "_value": {
        "_current": {
          "value": "commsMod_battery_id",
          "provType": "MONITORING",
          "date": "2017-12-01T08:52:37.577Z",
          "at": "2017-12-01T08:52:37.577Z"
        },
        "_previous": {
          "value": "commsMod_battery_id",
          "provType": "MONITORING",
          "date": "2017-12-01T08:52:37.577Z",
          "at": "2017-12-01T08:52:37.577Z"
        }
      }
    }
  ],
  "provision.device.communicationModules[].subscription.address": [
    {
      "_index": {
        "path": "provision.device.communicationModules[].identifier",
        "value": {
          "_current": {
            "value": "commsMod_battery_id",
            "provType": "MONITORING",
            "date": "2017-12-01T08:52:37.577Z",
            "at": "2017-12-01T08:52:37.577Z"
          }
        }
      },
      "_value": {
        "_current": {
          "value": {
            "type": "IPV4",
            "value": "99.1.1.71",
            "apn": "myapnprov.es"
          },
          "provType": "REFERENCE",
          "date": "2017-12-01T08:52:37.624Z",
          "at": "2017-12-01T08:52:37.624Z"
        },
        "_previous": {
          "value": {
            "type": "IPV4",
            "value": "99.1.1.71",
            "apn": "myapnprov.es"
          },
          "provType": "REFERENCE",
          "date": "2017-12-01T08:52:37.624Z",
          "at": "2017-12-01T08:52:37.624Z"
        }
      }
    }
  ],
  "provision.device.communicationModules[].subscription.identifier": [
    {
      "_index": {
        "path": "provision.device.communicationModules[].identifier",
        "value": {
          "_current": {
            "value": "commsMod_battery_id",
            "provType": "MONITORING",
            "date": "2017-12-01T08:52:37.577Z",
            "at": "2017-12-01T08:52:37.577Z"
          }
        }
      },
      "_value": {
        "_current": {
          "value": "subscription_battery_id",
          "provType": "MONITORING",
          "date": "2017-12-01T08:52:37.626Z",
          "at": "2017-12-01T08:52:37.626Z"
        },
        "_previous": {
          "value": "subscription_battery_id",
          "provType": "MONITORING",
          "date": "2017-12-01T08:52:37.626Z",
          "at": "2017-12-01T08:52:37.626Z"
        }
      }
    }
  ],
  "provision.device.identifier": {
    "_value": {
      "_current": {
        "value": "device_battery_id",
        "provType": "MONITORING",
        "date": "2017-12-01T08:52:37.636Z",
        "at": "2017-12-01T08:52:37.636Z"
      },
      "_previous": {
        "value": "device_battery_id",
        "provType": "MONITORING",
        "date": "2017-12-01T08:52:37.636Z",
        "at": "2017-12-01T08:52:37.636Z"
      }
    }
  },
  "provision.device.location": {
    "_value": {
      "_current": {
        "value": {
          "position": {
            "type": "Point",
            "coordinates": [
              -3.7028,
              40.41675
            ]
          },
          "postal": "28013"
        },
        "provType": "MONITORING",
        "date": "2017-12-01T08:52:37.64Z",
        "at": "2017-12-01T08:52:37.64Z"
      },
      "_previous": {
        "value": {
          "position": {
            "type": "Point",
            "coordinates": [
              -3.7028,
              40.41675
            ]
          },
          "postal": "28013"
        },
        "provType": "MONITORING",
        "date": "2017-12-01T08:52:37.64Z",
        "at": "2017-12-01T08:52:37.64Z"
      }
    }
  },
  "resourceType": {
    "_value": {
      "_current": {
        "value": "entity.device",
        "provType": "IDENTIFIER",
        "date": "2017-12-01T08:52:37.643Z",
        "at": "2017-12-01T08:52:37.643Z"
      },
      "_previous": {
        "value": "entity.device",
        "provType": "IDENTIFIER",
        "date": "2017-12-01T08:52:37.643Z",
        "at": "2017-12-01T08:52:37.643Z"
      }
    }
  },
  "device.communicationModules[].identifier": [
    {
      "_index": {
        "path": "device.communicationModules[].identifier",
        "value": {
          "_current": {
            "value": "commsMod_battery_id",
            "date": "2017-12-01T08:52:37.577Z",
            "at": "2017-12-01T08:52:37.577Z"
          }
        }
      },
      "_value": {
        "_current": {
          "value": "commsMod_battery_id",
          "date": "2017-12-01T08:52:37.577Z",
          "at": "2017-12-01T08:52:37.577Z"
        },
        "_previous": {
          "value": "commsMod_battery_id",
          "date": "2017-12-01T08:52:37.577Z",
          "at": "2017-12-01T08:52:37.577Z"
        }
      }
    }
  ],
  "device.communicationModules[].subscription.address": [
    {
      "_index": {
        "path": "device.communicationModules[].identifier",
        "value": {
          "_current": {
            "value": "commsMod_battery_id",
            "date": "2017-12-01T08:52:37.577Z",
            "at": "2017-12-01T08:52:37.577Z"
          }
        }
      },
      "_value": {
        "_current": {
          "value": {
            "type": "IPV4",
            "value": "99.1.1.71",
            "apn": "myapn.es"
          },
          "date": "2017-12-01T08:52:37.624Z",
          "at": "2017-12-01T08:52:37.624Z",
          "source": "DEVICE_OPENGATE_HTTP",
          "sourceInfo": "IoT Data Message Received"
        },
        "_previous": {
          "value": {
            "type": "IPV4",
            "value": "99.1.1.71",
            "apn": "myapn.es"
          },
          "date": "2017-12-01T08:52:37.624Z",
          "at": "2017-12-01T08:52:37.624Z",
          "source": "DEVICE_OPENGATE_HTTP",
          "sourceInfo": "IoT Data Message Received"
        }
      }
    }
  ],
  "device.communicationModules[].subscription.identifier": [
    {
      "_index": {
        "path": "device.communicationModules[].identifier",
        "value": {
          "_current": {
            "value": "commsMod_battery_id",
            "date": "2017-12-01T08:52:37.577Z",
            "at": "2017-12-01T08:52:37.577Z"
          }
        }
      },
      "_value": {
        "_current": {
          "value": "subscription_battery_id",
          "date": "2017-12-01T08:52:37.626Z",
          "at": "2017-12-01T08:52:37.626Z",
          "source": "DEVICE_OPENGATE_HTTP",
          "sourceInfo": "IoT Data Message Received"
        },
        "_previous": {
          "value": "subscription_battery_id",
          "date": "2017-12-01T08:52:37.626Z",
          "at": "2017-12-01T08:52:37.626Z",
          "source": "DEVICE_OPENGATE_HTTP",
          "sourceInfo": "IoT Data Message Received"
        }
      }
    }
  ],
  "device.identifier": {
    "_value": {
      "_received": [{
        "value": "device_battery_id",
        "date": "2017-12-01T08:52:37.636Z",
        "at": "2017-12-01T08:52:37.636Z",
        "source": "DEVICE_OPENGATE_HTTP",
        "sourceInfo": "IoT Data Message Received"
      }],
      "_current": {
        "value": "device_battery_id",
        "date": "2017-12-01T08:52:37.636Z",
        "at": "2017-12-01T08:52:37.636Z",
        "source": "DEVICE_OPENGATE_HTTP",
        "sourceInfo": "IoT Data Message Received"
      },
      "_previous": {
        "value": "device_battery_id",
        "date": "2017-12-01T08:52:37.636Z",
        "at": "2017-12-01T08:52:37.636Z",
        "source": "DEVICE_OPENGATE_HTTP",
        "sourceInfo": "IoT Data Message Received"
      }
    }
  },
  "device.temperature.value": {
    "_value": {
      "_received": [{
        "value": 25.3,
        "date": "2017-12-01T08:52:37.64Z",
        "at": "2017-12-01T08:52:37.64Z",
        "source": "DEVICE_OPENGATE_HTTP",
        "sourceInfo": "IoT Data Message Received"
      }],
      "_current": {
        "value": 25.3,
        "date": "2017-12-01T08:52:37.64Z",
        "at": "2017-12-01T08:52:37.64Z",
        "source": "DEVICE_OPENGATE_HTTP",
        "sourceInfo": "IoT Data Message Received"
      },
      "_previous": {
        "value": 23.3,
        "date": "2017-12-01T05:52:37.64Z",
        "at": "2017-12-01T05:52:37.64Z",
        "source": "DEVICE_OPENGATE_HTTP",
        "sourceInfo": "IoT Data Message Received"
      }
    }
  }
}
  

Executing Actions

Executing actions

openAlarm(subEntityIdentifier, alarmName, ruleName, severity, priority, alarmDescription, extraInfo)

Deprecated: Use alarm object functions instead.

Opens an alarm for the selected entity.

Kind: global function
Returns: void

Param Type Description
subEntityIdentifier String You can open an alarm on device, subscription or subscriber identifier. With subEntityIdentifier you define selected identifier. If is undefined it will open on provision.administration.identifier identifier.
alarmName String Name that you want to see in opened alarm
ruleName String Name of rule that produce opening of alarm.
severity String Alarm severity. Values can be INFORMATIVE, URGENT or CRITICAL.
priority String Alarm priority. Values can be LOW, MEDIUM or HIGH.
alarmDescription String Alarm description.
extraInfo String Extra information.

Examples of use This example open alarm apnMismatch to subscription.

openAlarm('subscription_battery_id', 'apnMismatch' , 'apnMismatchRule', 'URGENT', 'MEDIUM', 'APN mismatch with provisioned value')

And this example open alarm highTemperature to device.

openAlarm(undefined, 'highTemperature' , 'highTemperatureRule', 'URGENT', 'MEDIUM', 'Device temperature is high')

closeAlarmByRuleName(entityIdDatastream, ruleName)

Deprecated: Use alarm object functions instead.

Closes an alarm for the selected entity using rule name.

Kind: global function
Returns: void

Param Type Description
entityIdDatastream String You can close an alarm on device, subscription or subscriber identifier. With entityIdDatastream you define selected identifier. If is undefined it will close on provision.administration.identifier identifier.
ruleName String Name of rule that open alarm.

Example of use:

closeAlarmByRuleName(undefined, 'highTemperatureRule')

closeAlarmByAlarmName(entityIdDatastream, alarmName)

Deprecated: Use alarm object functions instead.

Closes an alarm for the selected entity using alarm name.

Kind: global function
Returns: void

Param Type Description
entityIdDatastream String You can close an alarm on device, subscription or subscriber identifier. With entityIdDatastream you define selected identifier. If is undefined it will close on provision.administration.identifier identifier.
alarmName String Name of alarm to close.

Example of use:

closeAlarmByAlarmName(undefined, 'alarm name')

addEmailNotification(recipients, notificationName, notificationBody, ruleName, mailParameters)

Deprecated: Use notification object functions instead.

Sends email notification to defined recipients.

Kind: global function
Returns: void

Param Type Description
recipients Array Array of recipients to send email. This param has same format as defined in easy mode.
notificationName String Name of notification that will be received in subject field.
notificationBody String Mustache template with email’s body
ruleName String Name of rule that launch email request.
mailParameters Object Json object with key-value pairs that will be replaces in mustache evaluation.

Example of use:

The example send email to example@recipient.es with highTemperature notification.

parameters = {};
parameters['deviceIdentifier'] = getDatastreamFromEntity('device.identifier')._current.value;
parameters['deviceTemperature'] = getDatastreamFromEntity('device.temperature')._current.value;
addEmailNotification(['example@recipient.es'], 'highTemperature', 'Received high temperature from {{deviceIdentifier}} with value {{deviceTemperature}}', 'highTemperatureRule', parameters);

addTrapNotification(recipients, variables, notificationName, trapOID, enterpriseOID, ruleName)

Deprecated: Use notification object functions instead.

Sends trap notification to defined recipients.

Kind: global function
Returns: void

Param Type Description
recipients Array Array of recipients (<ip>:<port>) to send trap. This param has same format as defined in easy mode.
variables Object Map of variables. Each pair defines OID variable and sent value for this OID.
notificationName String Name of notification
trapOID String OID of trap
enterpriseOID String OID of enterprise
ruleName String Name of rule

Example of use:

The example send trap to 25.35.98.5:8585 with highTemperature notification.

var recipients = ['25.35.98.5:8585'];
var trapVariables = {
  '1.1.1': entity['provision.administration.organization']._value._current.value,
  '1.1.2': entity['provision.administration.channel']._value._current.value,
  '1.1.3': entity['provision.administration.identifier']._value._current.value,
  '1.1.4': entity['device.temperature']._value._current.value,
  '1.1.5': entity['device.temperature']._value._previous.value,
  '1.1.6': Date.now()
};         

addTrapNotification(recipients, trapVariables, 'highTemperature', '1.100.1', '1.2.7.3.1.2.25841', 'highTemperatureRule');

sendHttp(httpJson)

Deprecated: Use notification object functions instead.

Sends http notification to defined recipients.

Kind: global function
Returns: void

Param Type Description
httpJson Object Same json that easy mode.

Example of use:

The example send http request to http://myService/request with highTemperature notification.

httpJson = {
  'url': 'http://myService/request',
  'method' : 'POST',
  'headers': {
    'Content-type': 'application/json'
  },
  'queryParams' : {
    'deviceId' : entity['provision.device.identifier']._value._current.value
  },
  'body' : 'New alert received by high temperature received. Current value: ' + entity['device.temperature']._value._current.value
};
sendHttp(httpJson);

executeOperation(subEntityIdentifier, operationType, operationTimeout, jobUser, retries, ackTimeout, retriesDelay, stopValue, stopMode, parameters, callback)

Deprecated: Use operation object functions instead.

Executes selected operation to received identifier.

Kind: global function
Returns: void

Param Type Description
subEntityIdentifier String You can execute operation on device, subscription or subscriber identifier. With subEntityIdentifier you define selected identifier. If is undefined it will open on provision.administration.identifier identifier.
operationType String Operation Identifier. You can get this values getting operation catalog. Mandatory field. The rule will be created, but the operation will not.
operationTimeout Number Operation timeout in milliseconds. Default: 60000 milliseconds
jobUser String User apiKey that launch this operation. Mandatory field. The rule will be created, but the operation will not.
retries Number Operation retries number. Default: 0.
ackTimeout Number ACK timeout in milliseconds. Default: null.
retriesDelay Number Delay in seconds between retries. Default: null.
stopValue Number Stop value, this value depends of stop mode selected. Default: Operation timeout + 5000.
stopMode String Stop mode. Default: delayed. Possible values: date (stop value is a date in YYYY-MM-DDThh:mm:ssTZD format) and delayed (stop value is a time defined in milliseconds).
parameters Object This value is a json with accepted value in selected operation. You can see parameters getting operation catalog.
callback String URI where the result of the operation execution is received.

NOTE: The Job of the operation will be created with an active status by default.

Example of use:

The example execute REFRESH_PRESENCE operation to received device.

apiKey = getVariableValue(parameters['apiKey']);
parameters = {
  'active': false
};
executeOperation(entity['provision.administration.identifier']._value._current.value, 'REFRESH_PRESENCE', 20000, apiKey, 0, null, null, 25000, 'delayed', parameters, callback);

cancelDelay(ruleName)

Deprecated: Use utils object functions instead.

Cancels active delayed action produced by another rule activation.

Kind: global function
Returns: void

Param Type Description
ruleName String Name of rule that produce delayed actions.

Example of use:

The example cancel delay of ‘highTemperatureRule’ rule.

cancelDelay('highTemperatureRule');

Alarm utils

Alarm

The alarm object is the main object for managing alarms.

alarm.open(alarmConfig)

Opens an alarm.

Returns: void

This function takes as parameter an object with the following fields:

Property Type Default Mandatory Description
subEntityIdentifier String entityId No You can open an alarm on device, subscription or subscriber identifier. With subEntityIdentifier you define selected identifier. If is undefined it will open on provision.administration.identifier identifier
alarmName String No Name that you want to see in opened alarm
ruleName String No Name of rule that produce opening of alarm
severity String ‘INFORMATIVE’ No Severity of alarm. Values can be INFORMATIVE, URGENT or CRITICAL
priority String ‘LOW’ No Priority of alarm. Values can be LOW, MEDIUM or HIGH
description String No Alarm description
extraInfo String No Extra information.

Example of use:

This example open alarm apnMismatch to subscription.

alarmConfig = {
    subEntityIdentifier: "id",
    alarmName: "apnMismatch",
    ruleName: "apnMismatchRule",
    severity: "URGENT",
    priority: "MEDIUM",
    description: "APN mismatch with provisioned value",
    extraInfo: "Extra information"
}
  
alarm.open(alarmConfig);

And this example open alarm highTemperature to device.

alarmConfigDevice = {
    alarmName: "highTemperature",
    ruleName: "highTemperatureRule",
    severity: "URGENT",
    priority: "MEDIUM",
    description: "Device temperature is high"
}

alarm.open(alarmConfigDevice);

alarm.closeByRuleName(closeByRuleConfig)

Closes alarm by rule name.

Returns: void

This function takes as parameter an object with the following fields:

Property Type Default Mandatory Description
ruleName String Yes Rule name that open alarm.
entityIdDatastream String No You can close an alarm on device, subscription or subscriber identifier. With entityIdDatastream you define selected identifier. If is undefined it will close on provision.administration.identifier identifier.

Example of use:

The example close alarm generated by highTemperatureRule to device.

closeByRuleConfig = {
    ruleName: "highTemperatureRule"
}

alarm.closeByRuleName(closeByRuleConfig);

alarm.closeByAlarmName(closeByNameConfig)

Closes alarm by alarm name.

Returns: void

This function takes as parameter an object with the following fields:

Property Type Default Mandatory Description
alarmName String Yes Opened alarm name.
entityIdDatastream String No You can close an alarm on device, subscription or subscriber identifier. With entityIdDatastream you define selected identifier. If is undefined it will close on provision.administration.identifier identifier.

Example of use:

The example close opened alarm apnMismatch to device.

closeByNameConfig = {
    alarmName: "highTemperatureRule"
}

alarm.closeByAlarmName(closeByNameConfig);

Notifications utils

Notification

The notification object is the main object for managing notifications.

notification.addEmailNotification(emailConfig)

Sends an email notification to defined recipients.

Returns: void

This function takes as parameter an object with the following fields:

Property Type Default Mandatory Description
jsRecipients List Yes Array of recipients to send email. This param has same format as defined in easy mode
notificationName String Yes Name of notification that will be received in subject field
notificationBody String Yes Mustache template with email’s body
ruleName String Yes Name of rule that launch email request
mailParameters Object No Json object with key-value pairs that will be replaces in mustache evaluation

Example of use:

The example send email to example@recipient.es with highTemperature notification.

emailNotifConfig = {
    jsRecipients: ['example@recipient.es'],
    notificationName: 'highTemperature',
    notificationBody: 'Received high temperature from {{deviceIdentifier}} with value {{deviceTemperature}}',
    ruleName: 'highTemperatureRule',
    mailParameters: {
        deviceIdentifier: getDatastreamFromEntity('device.identifier')._current.value,
        deviceTemperature: getDatastreamFromEntity('device.temperature')._current.value
    }
}
    
notification.addEmailNotification(emailNotifConfig);

notification.addTrapNotification(trapConfig)

Sends an SNMP trap notification to defined recipients.

This function takes as parameter an object with the following fields:

Property Type Default Mandatory Description
jsRecipients List Yes Array of recipients (<ip>:<port>) to send trap. This param has same format as defined in easy mode
jsVariables Object Yes Map of variables. Each pair defines OID variable and sent value for this OID
notificationName String Yes Name of notification
trapOID String Yes OID of trap
enterpriseOID String Yes OID of enterprise
ruleName String Yes Name of rule

Example of use:

The example send trap to 25.35.98.5:8585 with highTemperature notification.

trapNotifConfig = {
    jsRecipients: ['25.35.98.5:8585'],
    jsVariables: {
      '1.1.1': entity['provision.administration.organization']._value._current.value,
      '1.1.2': entity['provision.administration.channel']._value._current.value,
      '1.1.3': entity['provision.administration.identifier']._value._current.value,
      '1.1.4': entity['device.temperature']._value._current.value,
      '1.1.5': entity['device.temperature']._value._previous.value,
      '1.1.6': Date.now()
    },
    notificationName: 'highTemperature',
    trapOID: '1.100.1',
    enterpriseOID: '1.2.7.3.1.2.25841',
    ruleName: 'highTemperatureRule'
}

notification.addTrapNotification(trapNotifConfig);

notification.sendHttp(httpConfig)

Sends an HTTP request notification to a specified URL.

Returns: void

This function takes as parameter an object with the following fields:

Property Type Default Mandatory Description
url String Yes URL to which the HTTP request will be sent
method String Yes HTTP method to be used for the request
headers Object No Key-value pairs representing HTTP headers
queryParams Object No Key-value pairs representing query parameters
body String No Body of the HTTP request

Example of use:

The example sends http request to http://myService/request with highTemperature notification.

httpJson = {
  'url': 'http://myService/request',
  'method' : 'POST',
  'headers': {
    'Content-type': 'application/json'
  },
  'queryParams' : {
    'deviceId' : entity['provision.device.identifier']._value._current.value
  },
  'body' : 'New alert received by high temperature received. Current value: ' + entity['device.temperature']._value._current.value
};

notification.sendHttp(httpJson);

Operation utils

Operation

The operation object is the main object for executing operations.

operation.execute(operationConfig)

Execute selected operation to received identifier.

Returns: void

This function takes as parameter an object with the following fields:

Property Type Default Mandatory Description
subEntityIdentifier String No You can execute operation on device, subscription or subscriber identifier. With subEntityIdentifier you define selected identifier. Default: If is undefined it will open on provision.administration.identifier identifier.
operationType String Yes Operation Identifier. You can get this values getting operation catalog. Mandatory field. The rule will be created, but the operation will not.
operationTimeout Number 60000 No Operation timeout in milliseconds.
jobUser String Yes User apiKey that launch this operation. Mandatory field. The rule will be created, but the operation will not.
retries Number 0 No Operation retries number.
ackTimeout Number null No ACK timeout in milliseconds.
retriesDelay Number 0 No Delay in seconds between retries.
stopValue String operationTimeout + 5000 No Stop value, this value depends of stop mode selected.
stopMode String delayed No Stop mode. Possible values are: date: If this mode is selected, stop value is a date in YYYY-MM-DDThh:mm:ssTZD format. delayed: If this mode is selected, stop value is a time defined in milliseconds.
parameters Object {} No This value is a json with accepted value in selected operation. You can see parameters getting operation catalog.
callback String null No URI where the result of the operation execution is received.

NOTE: The Job of the operation will be created with an active status by default.

Example of use:

The example execute ADMINISTRATIVE_STATUS_CHANGE operation to received device.

operationConfig = {
    subEntityIdentifier: entity['provision.administration.identifier']._value._current.value,
    operationType: 'ADMINISTRATIVE_STATUS_CHANGE',     
    operationTimeout: 20000,   
    jobUser: apiKey,           
    retries: 1,            
    ackTimeout: 5000,        
    retriesDelay: 0,      
    stopValue: '25000',         
    stopMode: 'delayed',
    callback: 'http://127.0.0.1:7070/directory',
    parameters: {
        admsts: 'BANNED'
    }
}

operation.execute(operationConfig);

Another example with stopMode = date

operationConfig = {
    subEntityIdentifier: entity['provision.administration.identifier']._value._current.value,
    operationType: 'REFRESH_PRESENCE',     
    operationTimeout: 20000,   
    jobUser: apiKey,           
    retries: 1,            
    ackTimeout: 5000,        
    retriesDelay: 0,      
    stopMode: 'date',
    stopValue: '2045-11-08T08:30:00+02:00',
    callback: 'http://127.0.0.1:7070/directory',
    parameters: {}
}

operation.execute(operationConfig);

Provision utils

Provision

The provision object is the main object for changing provision data.

provision.datastreams(provisionConfig)

Returns: void

This function takes as parameter an object with the following fields:

Property Type Mandatory Description
datastreams Object Yes Map where key is datastreamId and value is value to set in provision.
apiKey String Yes User apiKey that launches this provision.

Example of use:

var provisionConfig = {
    datastreams: {'datastream1':'value1','datastreamN':'valueN'},
    apiKey: 'the_api_key'
}

provision.datastreams(provisionConfig);

Datastreams and values

Getting and formatting datastreams and values

getVariableValue(variable)

This method reads a variable value.

Kind: global function
Returns: The read value, or undefined if the variable is not found.

Param Type Description
variable String Variable to obtain value.

Examples of use:

var myVar = undefined;
var finalVar = getVariableValue(myVar);

Result is ‘’;

This function returns the same value

var myVar = 2;
var finalVar = getVariableValue(myVar);

Result is 2;

getDatastreamFromEntity(datastreamId)

This method returns completed datastream of received entity.

Kind: global function
Returns: Completed datastream or undefined if the datastream is not found.

Param Type Description
datastreamId String Datastream to obtain value.

Example of use:

var deviceTemperature = getDatastreamFromEntity('device.temperature');

Result:

{
  "_received": [
    {
      "value": 25.3,
      "date": "2017-12-01T08:52:37.64Z",
      "at": "2017-12-01T08:52:37.64Z",
      "source": "DEVICE_OPENGATE_HTTP",
      "sourceInfo": "IoT Data Message Received"
    }
  ],
  "_current": {
    "value": 25.3,
    "date": "2017-12-01T08:52:37.64Z",
    "at": "2017-12-01T08:52:37.64Z",
    "source": "DEVICE_OPENGATE_HTTP",
    "sourceInfo": "IoT Data Message Received"
  },
  "_previous": {
    "value": 23.3,
    "date": "2017-12-01T05:52:37.64Z",
    "at": "2017-12-01T05:52:37.64Z",
    "source": "DEVICE_OPENGATE_HTTP",
    "sourceInfo": "IoT Data Message Received"
  }
}

getDatastreamValueFromEntity(datastreamObject)

Returns _value._current._value from datastream object

Kind: global function
Returns: Value object from datastream object.

Param Type Description
datastreamObject Object Datastream object.

Example of use:

var deviceTemperature = getDatastreamFromEntity('device.temperature');
var deviceTemperatureValue = getDatastreamValueFromEntity(deviceTemperature);

Result:

{
  "value": 25.3,
  "date": "2017-12-01T08:52:37.64Z",
  "at": "2017-12-01T08:52:37.64Z",
  "source": "DEVICE_OPENGATE_HTTP",
  "sourceInfo": "IoT Data Message Received"
}

getCommsDatastreamFromEntity(datastreamId, commsId)

Returns complete datastream in selected communication module of received entity.

Kind: global function
Returns: Complete datastream or undefined if the datastream is not found.

Param Type Description
datastreamId String Datastream to obtain value.
commsId String Communication module identifier.

Example of use:

datastream = getCommsDatastreamFromEntity('device.communicationModules[].subscription.address', 'commsMod_battery_id');

Result:

{
  "_current": {
    "value": {
      "type": "IPV4",
      "value": "99.1.1.71",
      "apn": "myapn.es"
    },
    "date": "2017-12-01T08:52:37.624Z",
    "at": "2017-12-01T08:52:37.624Z",
    "source": "DEVICE_OPENGATE_HTTP",
    "sourceInfo": "IoT Data Message Received"
  },
  "_previous": {
    "value": {
      "type": "IPV4",
      "value": "99.1.1.71",
      "apn": "myapn.es"
    },
    "date": "2017-12-01T08:52:37.624Z",
    "at": "2017-12-01T08:52:37.624Z",
    "source": "DEVICE_OPENGATE_HTTP",
    "sourceInfo": "IoT Data Message Received"
  }
}

getCounterValue(datastreamValue, incValue, resetDate)

Obtains incValue if datastreamValue date is before than resetDate or increments received value in datastream to incValue if the date is after.

Kind: global function
Returns: Incremented value or reset value.

Param Type Description
datastreamValue Object Datastream value.
incValue Number Value to increment.
resetDate Date Date of reset.

Example of use:

var datastream = {'value':3, 'date': toDate('2021-06-30T11:20:21.352Z')}
var resetDate = toDate('2021-06-30T00:00:0.000Z');
var counter = getCounterValue(datastream, 1, resetDate); 

Result: 4

This example get reseted daily counter to myCounterDatastream datastream:

var datastream = {'value':3, 'date': toDate('2021-06-29T11:20:21.352Z')}
var resetDate = toDate('2021-06-30T00:00:0.000Z');
var counter = getCounterValue(datastream, 1, resetDate); 

Result: 1

Dates manipulation

Dates manipulation

toDate(localDateTime)

Obtain date type from string date representation with format YYYY-MM-DDThh:mm:ssTZD.

Kind: global function
Returns: Date

Param Type Description
localDateTime string Date string representation with format YYYY-MM-DDThh:mm:ssTZD.

Example of use:

var date = toDate('2021-06-30T10:10:23.256Z');

getDailyResetDate()

Obtains date to reset daily counters.

This function returns date with current date, but with 00:00:00 hours.

Kind: global function
Returns: Date

Example of use:

var date = getDailyResetDate();

getDailyResetDateWithZuluHour(hour)

Obtains date to reset daily counters with defined hour in gmt+0.

Kind: global function
Returns: Date

Param Type Description
hour string Hour in format HH:mm:ss.

Example of use:

var date = getDailyResetDateWithZuluHour('02:00:00');

This function returns date with current date, but with 2:00:00 hours. For example, if current day is 2021-06-30, the returned date in previously called function is 2021-06-30T02:00:00Z

getMonthlyResetDate()

Obtains date to reset monthly counters.

This function returns date with first day of current month and 00:00:00 hours.

Kind: global function
Returns: Date

Example of use:

var date = getMonthlyResetDate();

getMonthlyResetDateWithZuluHour(hour)

Obtains date to reset monthly counters with defined hour in gmt+0.

Kind: global function
Returns: Date

Param Type Description
hour string Hour in format HH:mm:ss.
var date = getMonthlyResetDateWithZuluHour('02:00:00');

This function returns date with first day of current month, but with 2:00:00 hours. For example, if current day is 2021-06-30, the returned date in previously called function is 2021-06-01T02:00:00Z

getMonthlyResetDateWithZuluHourAndDayOfMonth(hour, dayOfMonth)

Obtains date to reset monthly counters with defined hour in gmt+0.

Kind: global function
Returns: Date

Param Type Description
hour string Hour in format HH:mm:ss.
dayOfMonth number Day of Month.
var date = getMonthlyResetDateWithZuluHourAndDayOfMonth('02:00:00', 21);

This function returns date of the day 21 of current month, but with 2:00:00 hours, when day of the month is null, then return first day of the month. For example, the returned date in previously called function is 2023-02-21T02:00:00Z

Logging utils

Logging

The logger object is the main object for logging functions.

logger.trace(…msg)

Creates TRACE level logging messages. It concatenates msg parameters to compound message to be logged.

Returns: void

Param Type Description
msg string list of elements to be concatenated to generate the string message to be printed.

Example of use:

logger.trace('Operation sent to', host_var, ' and port ', port_var, '. Operation content: ', operation_var);

logger.debug(…msg)

Creates DEBUG level logging messages. It concatenates msg parameters to compound message to be logged.

Returns: void

Param Type Description
msg string list of elements to be concatenated to generate the string message to be printed.

Example of use:

logger.debug('Operation sent to', host_var, ' and port ', port_var, '. Operation content: ', operation_var);

logger.info(…msg)

Creates INFO level logging messages. It concatenates msg parameters to compound message to be logged.

Returns: void

Param Type Description
msg string list of elements to be concatenated to generate the string message to be printed.

Example of use:

logger.info('Operation sent to', host_var, ' and port ', port_var, '. Operation content: ', operation_var);

logger.warn(…msg)

Creates WARN level logging messages. It concatenates msg parameters to compound message to be logged.

Returns: void

Param Type Description
msg string list of elements to be concatenated to generate the string message to be printed.

Example of use:

logger.warn('Operation sent to', host_var, ' and port ', port_var, '. Operation content: ', operation_var);

logger.error(…msg)

Creates ERROR level logging messages. It concatenates msg parameters to compound message to be logged.

Returns: void

Param Type Description
msg string list of elements to be concatenated to generate the string message to be printed.

Example of use:

logger.error('Error connecting to host ', host_var, ' and port ', port_var, '. Stop processing');

Cypher utils

String utils

encryptString(originalValue, datastreamId, organization)

Deprecated: Use utils object functions instead.

Encrypt an original string with the configuration established by the datastream of the organization

Kind: global function
Returns: String

Param Type Description
originalValue string The original value to encrypt.
datastreamId string The datastream of provision type, of the datamodel that define this value.
organization string The organization name to which the datamodel belongs.

Example of use:

var encryptedValue = encryptString('text to encrypt', 'provision.data.encrypt', 'organization_name');

decryptString(encryptedValue, datastreamId, organization)

Deprecated: Use utils object functions instead.

Decrypt an encrypted string with the configuration established by the datastream of the organization

Kind: global function
Returns: String

Param Type Description
encryptedValue string The encrypted value to decrypt.
datastreamId string The datastream of provision type, of the datamodel that define this value.
organization string The organization name to which the datamodel belongs.

Example of use:

var decryptedValue = decryptString('text to decrypt', 'provision.data.encrypt', 'organization_name');

Utils

Utils

The utils object is the main object for utilities.

utils.cancelDelay(ruleName)

Cancels an active delayed action produced by another rule activation.

Returns: void

This function takes as parameter an object with the following fields:

Property Type Default Mandatory Description
ruleName String Yes Name of rule that produce delayed actions.

Example of use:

The example cancels delay of ‘highTemperatureRule’ rule.

utils.cancelDelay('highTemperatureRule');

utils.encryptString(encryptConfig)

Encrypt a value.

Returns: String

This function takes as parameter an object with the following fields:

Property Type Default Mandatory Description
originalValue String Yes The value to encrypt
datastreamId String Yes The datastream of provision type, of datamodel that define this value
organization String Yes The organization name to which the datamodel belongs

Example of use:

encryptConfig = {
    originalValue: 'text to encrypt',
    datastreamId: 'provision.data.encrypt',
    organization: 'organization_name'
}

var encryptedValue = utils.encryptString(encryptConfig);

utils.decryptString(decryptConfig)

Decrypt a value.

Returns: String

This function takes as parameter an object with the following fields:

Property Type Default Mandatory Description
encryptedValue String Yes The value to decrypt
datastreamId String Yes The datastream of provision type, of datamodel that define this value
organization String Yes The organization name to which the datamodel belongs

Example of use:

decryptConfig = {
    encryptedValue: 'text to decrypt',
    datastreamId: 'provision.data.encrypt',
    organization: 'organization_name'
}

var decryptedValue = utils.decryptString(decryptConfig);

Default rules catalog

Name Rule Type Mode Active Description
activityForbiddenDatastream DATASTREAM ADVANCED false Activity detected for an entity with administrative state disabled
activityForbiddenOperation OPERATION ADVANCED false Activity detected for an entity with administrative state disabled
areaInputWithParameter DATASTREAM ADVANCED false Checks if an entity has entered in a geofence
areaOutputWithParameter DATASTREAM ADVANCED false Checks if an entity has exitted of a geofence
batteryThreshold DATASTREAM EASY false Current value of datastream has an unusual value
cancelBatteryThreshold DATASTREAM EASY false Current value of datastream has is returned to usual value
changeCommsModuleOperationalStatusByNokPing DATASTREAM ADVANCED false Put selected operational status to communication module if consecutive NOK Ping reach selected value
changeCommsModuleOperationalStatusByOkPing DATASTREAM ADVANCED false Put selected operational status to communication module if OK Ping received
checkDistance DATASTREAM ADVANCED false Checks if entity is farther than a defined distance
collectAreas DATASTREAM ADVANCED false Calculate entity.area datastream (and its derivatives) based on entity.location datastream
countAccountingStart DATASTREAM ADVANCED false Count accounting start in subscription
countPings DATASTREAM ADVANCED false Count number of ping [OK/NOK/NOK consecutives] to get information in mobile net
diagnosticFailed OPERATION EASY false Diagnostic with error in some operation
messageFlowRateExceeded EVENT EASY false Message flow rate exceeded, not process message
mobileICCMismatch DATASTREAM EASY false Collected ICC does not match with provisioned
mobileICCValueChanged DATASTREAM EASY false Compare current with previous values of one datastream
presenceReachableAllInterfaces DATASTREAM ADVANCED true Current value of datastream has an unusual value with margen temporal or no
presenceUnreachableAllInterfaces DATASTREAM ADVANCED true Current value of datastream has an unusual value with margen temporal or no
receivedBanned DATASTREAM EASY false Received data for a banned entity
securityConfigMismatch EVENT EASY false Security error validate, device validation failedSecurity error validate, device validation failed
subscriptionActivation DATASTREAM ADVANCED false Check if subscription is administrativeState = ACTIVE for a configured operator
subscriptionSuspension DATASTREAM ADVANCED false Check if subscription is administrativeState = SUSPENSION for a configured operator
sumSessionBytes DATASTREAM ADVANCED true Sum traffic bytes can get information in mobile net

Work groups

Introduction

The workgroup entity is employed for the purpose of consolidating users who occupy identical roles within the specified organisation.

API specification

Subsections of Work groups

Work groups relations

Introduction

The workgroup entity enables the consolidation of disparate channels, thereby conferring management permissions upon distinct user roles.

API specification

Geo-clusters

Limited access

This feature is only available to root and super_admin_domain profiles. Ask your administrator for proper user role profiling.

Introduction

A geo-cluster is defined as a grouping of devices belonging to multiple organisations, which are related to work groups.

API specification

Users

Introduction

  • For further details regarding role permissions, please refer to the section on user profiles.

  • For further details regarding the login process in OpenGate, please refer to the user LOG-IN section.

Two-Factor Authentication (2FA)

Two-Factor Authentication (2FA) can be configured at the user level.

The only possible value is “TOTP”. (Time-Based On-Time) as defined in [RFC-6238] (https://www.rfc-editor.org/rfc/rfc6238).

By default, this field will be set to “NONE”. If you wish to deactivate the 2FA, please set the property 2FaType to NONE and perform a PUT on the user.

Please refer to the schema for each attribute used.

Log in with Two-Factor Authentication (2FA)

In the event that two-factor authentication (2FA) has been enabled for a particular user, it is necessary to incorporate the code generated by the associated application into the “2FaCode” attribute of the JSON.

Configure your application

Upon initial login following the configuration of two-factor authentication (2FA), the LOGIN service will respond with a URL location in the headers containing the configuration parameters. These parameters should be used to configure your application to generate the codes.

The URL will be as follows: otpauth://totp/2FA?secret=CAX3VP5O7GWZXUDWQOK4267DGXXSFIDQ&issuer=OpenGate&algorithm=SHA1&digits=6&period=30

Description of the attributes of the URL

  • secret: Contains the secret key to generate codes.
  • period: Defines the time validation period of the code.
  • digits: Defines the length of the generated code.
  • algorithm: Defines the algorithm used to generate the codes.
  • issuer: Defines the subject, the name of the server.

Some applications only require the secret field, while others may need all parameters.

Comprehensive API actions

Reading a user

Please replace {id} with the email address of the user you wish to retrieve. There are two ways to use the GET method:

  1. Administrative: This is the standard use of the GET method as defined in HTTP. In this case, you use GET with the Apikey.
  2. Login: You can use the method GET to log in, adding the password in the field of the header X-ApiPass. The Apikey is not necessary.

Updating a user

An administrator is able to modify another user’s API key or password, update their own API key, or update their own password.

To update the ApiKey or password of another user by an administrator

Any user with administration role is allowed to change the ApiKey / password of any managed user (excluding himself), the same way as any other user’s field.

In this case, the ApiKey or password will be considered as any other basic user data. In this case, it’s allowed to change the ApiKey or password with any other user’s field. If the administrator needs to change his own ApiKey/password, it must be done as explained bellow.

To update your own ApiKey

Any user with an administrative role is permitted to modify the ApiKey/password of any managed user (excluding themselves), in a manner consistent with the process for modifying any other user’s field.

In this instance, the ApiKey or password will be treated in the same way as any other basic user data. It is therefore permitted to change the ApiKey or password with any other user’s field. If the administrator wishes to change their own ApiKey/password, this must be done in accordance with the instructions set out below.

To update your own password

As with updating your own ApiKey, any user is able to change their own password. This is the only method available, regardless of whether the user has an administration profile. In this case, the current user’s password must be included in the X-ApiPass field of the REQUEST HEADERS section (the X-ApiKey field is not required). Additionally, the JSON of the REQUEST BODY should include only the new password as shown in the “Change the user’s own password” option. Please note that it is not permitted to change any other user’s field.

When setting a password…

The password must meet the following criteria for both creating and updating users:

  • It must be between 12 and 25 characters long.
  • It must include upper case letters.
  • It must include lowercase letters.
  • It must include numbers.
  • It must include special characters: !"#$%&’()*+,-./:;<=>?@[]^_`{|}~

The password will have an expiration time of 6 months, by default.

Logging in OpenGate platform.

Note

It is not a requisite to include an API key or JWT token in the header of the request.

The JWT token will be validated by OpenGate under the following conditions:

  1. The JWT token will have an expiration time, typically 24 hours.
  2. The JWT token will be signed with an OpenGate encrypted key. If the token received is not signed with the same encrypted key or has been modified, it will be rejected.

API specification

Subsections of Users

User login

For you are authenticate in OpenGate you have to do LOG-IN to obtain a token JWT or an ApiKey:

Do login

Basic login

Do you need an email and password.

flowchart TD
    CU["CREATE User"] --> V{"Valid User"}
    V -- No --> E400["ERROR 400<br>Json malformed"]
    V -- "Yes, LOG-IN" --> LOGIN["Do LOG-IN<br>email and password"]
    LOGIN --> VC{"Valid<br>email and password"}
    VC -- No --> E401["ERROR 401<br>Bad credentials"]
    VC -- Yes --> OK["Return: 200 OK<br>Return data (JWT and ApiKey)"]

    classDef error fill:#f9d0d0,stroke:#c85a5a,color:#000
    classDef ok fill:#a8ecd0,stroke:#2b9c6e,color:#000
    class E400,E401 error
    class OK ok

Login with Two Factor Authentication

Do you need an email, password and an 2FA Code generated.

How can you generate the 2FA code?

First, you have to configure your application to generate codes.

Configure your application

When you do login in OpenGate, the first time after configuring 2FA, the LOG-IN service responds with an error code 401, but in the headers contains an URL in the attribute location with the parameters of configuration.

You have to use this parameters to configure your application to generate the codes.

The URL of location will be like this otpauth://totp/2FA?secret=CAX3VP5O7GWZXUDWQOK4267DGXXSFIDQ&issuer=OpenGate&algorithm=SHA1&digits=6&period=30

Description of the attributes of the URL:

  • secret: contain the secret key to generate codes.
  • period: define the time of validation of the code.
  • digits: define the length of the code generated.
  • algorithm: define the Algorithm used to generate the codes.
  • issuer: define the subject, the name of the server.

Some applications only need the secret field, and others need all parameters.

You can see the flow of this process in follow diagram:

flowchart TD
    CU["CREATE or UPDATE USER<br>with 2FA"] --> V{"Valid User<br>with 2FA type"}
    V -- No --> E400["ERROR 400<br>Json malformed"]
    V -- "Yes, LOG-IN" --> LOGIN["Do LOG-IN<br>without 2FA Code"]
    LOGIN --> FIRST{"First time"}
    FIRST -- No --> E401A["ERROR 401<br>Bad Credentials<br>or Bad 2Fa Code sent"]
    FIRST -- Yes --> HDR["Return: ERROR 401<br>Headers with URL 2FA"]
    HDR --> APP["With URL - Configure APP"]
    APP --> GEN["Generate 2FA code<br>with the application"]
    GEN --> LOGIN2["Do LOG-IN with 2FA"]
    LOGIN2 --> VC{"Valid<br>email and password"}
    VC -- No --> E401B["ERROR 401<br>Bad Credentials"]
    VC -- Yes --> EXP{"Code expired<br>Code invalid"}
    EXP -- No --> OK["Return 200 OK<br>Return data (JWT and ApiKey)"]
    EXP -- Yes --> E401C["401 ERROR<br>Invalid Code"]

    classDef error fill:#f9d0d0,stroke:#c85a5a,color:#000
    classDef ok fill:#a8ecd0,stroke:#2b9c6e,color:#000
    classDef step fill:#addcf8,stroke:#2b7cb8,color:#000
    class E400,E401A,E401B,E401C,HDR error
    class OK ok
    class LOGIN,APP,GEN,LOGIN2 step

2FA error responses

Every 2FA failure returns 401 Unauthorized, so the error code is what tells the cases apart:

Code Situation Context
0x000065 First login after configuring 2FA. Read the location header to configure your application. 2FA
0x000065 2FA is configured but no code was sent. 2FaCode is null
0x000066 The code sent is invalid or expired. 2FaCode
0x000067 A code was sent but the user has no 2FA configured. Log in without the TOTP code. 2FaCode

An expired password is a different case: it returns 403 with code 0x010063.

User profiles

OpenGate by default incorporates a set of user profiles which is listed below:

New adhoc user profiles can be added to adapt to specific needs.

Profiles

  • root
  • super_admin_domain
  • admin_domain
  • admin
  • advanced
  • viewer

root

Total control for managing all resources in the platform

super_admin_domain

super_admin_domain access to the Provision API

  • Domains (create, update, delete)
  • Subdomains (create and update)
  • Organizations (create, update, delete)
  • Work groups (create, update, delete)
  • Channels (create, update, delete)
  • Users (create, update, delete)
  • Certificates (create, update, delete, download)
  • Data models (create, update, delete)
  • Areas (create, read, update, delete)
  • Bulk of Assets, Devices, subscriptions (create, update, delete)
  • Assets entities (create, read, update, delete)
  • Devices entities (create, read, update, delete)
  • Subscriptions entities (create, read, update, delete)
  • Subscribers entities (create, read, update, delete)
  • APNs (create)
  • Radius Clients (create)
  • Tags (create)
  • Tickets (create, read, update, delete)
  • Manufacturers (create, read, update, delete)
  • Models (create, read, update, delete)
  • Datasets (create, read, update, delete)
  • Provision processors (create, read, update, delete)
  • Timeseries (create, read, update, delete)
  • Artificial Intelligence (create, read, update, delete)

super_admin_domain access to the Search API

Full access.

super_admin_domain access to the Operation API

  • Jobs (create, read, update, delete)
  • Tasks (create, read, update, delete)
  • Alarms (read, attend, close)
  • Rules (read, update, clone, delete)
  • Bundles (create, read, update, delete, execute)
  • Download csv

admin_domain

admin_domain access to the Provision API

  • Domains (create, update, delete)
  • Subdomains (create and update)
  • Organizations (create, update, delete)
  • Work groups (create, update, delete)
  • Channels (create, update, delete)
  • Users (create, update, delete)
  • Certificates (create, update, delete, download)
  • Data models (create, update, delete)
  • Areas (create, read, update, delete)
  • Bulk of Assets, Devices, subscriptions (create, update, delete)
  • Assets entities (create, read, update, delete)
  • Devices entities (create, read, update, delete)
  • Subscriptions entities (create, read, update, delete)
  • Subscribers entities (create, read, update, delete)
  • APNs (create)
  • Radius Clients (create)
  • Tags (create)
  • Tickets (create, read, update, delete)
  • Artificial Intelligence (read)

admin_domain access to the Search API

Full access.

admin_domain access to the Operation API

  • Jobs (create, read, update, delete)
  • Tasks (create, read, update, delete)
  • Alarms (read, attend, close)
  • Rules (read, update, clone, delete)
  • Bundles (create, read, update, delete, execute)
  • Download csv

admin

admin access to the Provision API

  • Work groups (create, update, delete)
  • Channels (create, update, delete)
  • Users (create, update, delete)
  • Certificates (create, update, delete, download)
  • Data models (create, update, delete)
  • Areas (create, read, update, delete)
  • Bulk of Assets, Devices, subscriptions (create, update, delete)
  • Assets entities (create, read, update, delete)
  • Devices entities (create, read, update, delete)
  • Subscriptions entities (create, read, update, delete)
  • Subscribers entities (create, read, update, delete)
  • APNs (create)
  • Radius Clients (create)
  • Tags (create)
  • Tickets (create, read, update, delete)
  • Artificial Intelligence (read)

admin access to the Search APIs

Full access.

admin access to the Operation API

  • Jobs (create, read, update, delete)
  • Tasks (create, read, update, delete)
  • Alarms (read, attend, close)
  • Rules (read, update, clone, delete)
  • Bundles (create, read, update, delete, execute)
  • Download csv

advanced

advanced access to the Provision API

  • Users (update yourself)
  • Certificates (download)
  • Areas (create, read, update, delete)
  • Bulk of Assets, Devices, subscriptions (create, update, delete)
  • Assets entities (create, read, update, delete)
  • Devices entities (create, read, update, delete)
  • Subscriptions entities (create, read, update, delete)
  • Subscribers entities (create, read, update, delete)
  • Tags (create)
  • Tickets (create, read, update, delete)
  • Artificial Intelligence (read)

advanced access to the Search API

Full access.

advanced access to the Operation API

  • Jobs (create, read, update, delete)
  • Tasks (create, read, update, delete)
  • Alarms (read, attend, close)
  • Rules (read, update, clone, delete)
  • Bundles (create, read, update, delete, execute)
  • Download csv

viewer

viewer access to the Provision API

  • Users (update yourself)
  • Certificates (download)
  • Areas (read)
  • Assets entities (read)
  • Devices entities (read)
  • Subscriptions entities (read)
  • Subscribers entities (read)
  • Tickets (read)
  • Artificial Intelligence (read)

viewer access to the Search API

Full access.

viewer access to the Operation API

  • Jobs (read)
  • Tasks (read)
  • Alarms (read)
  • Rules (read)
  • Bundles (read)
  • Download csv

Software and configuration bundles

Software, firmware, configuration. You can rely on OpenGate to update the software, the firmware, or the configuration files of your remote devices.

The updates can be executed using the operations API, but first of all, OpenGate must know the structure of your update bundles.

The following sections show you how to feed OpenGate with your software, firmware, and configuration files.

Bundle object structure

A bundle is a group of deployment elements you want to deploy in a remote device. A bundle can contain four file types:

  1. SOFTWARE
  2. FIRMWARE
  3. CONFIGURATION
  4. PARAMETERS

See Bundle Object

Bundle management workflow

flowchart TD
    START(("Start")) --> B["POST bundle"]
    B --> DE["POST deployment element<br>to the bundle"]
    DE --> Q{"Should the bundle have<br>more deployment elements?"}
    Q -- Yes --> DE
    Q -- No --> END(("End"))

    classDef step fill:#addcf8,stroke:#2b7cb8,color:#000
    classDef terminal fill:#a8ecd0,stroke:#2b9c6e,color:#000
    class B,DE step
    class START,END terminal

We want to make sure you understand the bundle management workflow, because the update operations will use your bundles.

First of all, you must POST a bundle.

Then you must upload, i.e. POST, as many deployment elements as the bundle should have.

Finally, you must set up the state bundle attribute to ACTIVE.

Deployment element

What is a deployment element? A bundle is formed by deployment elements, each of these elements can have files associated or not, depending on the operation associated with the deployment element. In a bundle, through the deployment elements, you can define different actions that you want to perform in the device, such as installing software, updating it, and more.

The operations allowed for a deployment element are:

  1. Install - With this operation, you are trying to include a new deployment (of any type) in the device.
  2. Uninstall - With this operation, you are trying to uninstall a deployment element in the device.
  3. Upgrade - With this operation, you are trying to change the version of a deployment element.

See the structure of a deployment element object at Deployment Element

Attach deployment elements

In order to attach a deployment element to a bundle in the OpenGate API, you must replace {bundle_name} and {version_name} with the identifiers of the bundle and version you want to attach the deployment element to. Because deployment elements need to be uploaded, this POST request differs from others in the OpenGate API. The request must be encoded according to RFC 1867, “Form-based File Upload in HTML”, which OpenGate can parse to “attach” the deployment element to the bundle.

When creating a deployment element, you have three options for attaching a file:

  1. Filling only the downloadUrl field: In this case, the file will be located at the path provided in the downloadUrl field.

  2. Attaching a file without filling the downloadUrl field: Here, the file is uploaded, and the downloadUrl field is automatically populated with the URL of the OpenGate internal file repository.

  3. Attaching a file and filling the downloadUrl field: This option combines the previous two; the file is uploaded to the default path, and the device downloads the file from the path specified in the downloadUrl field.

Important

You must upload at least one deployment element, or your bundle cannot be activated.

Additionally, there is an optional parameter called FileValidationRequired, which forces the platform to validate the file’s integrity. This parameter is only relevant when a valid validator parameter is passed within the accompanying JSON file.

Note that the deployment element file has a maximum size, which can be configured administratively. By default, this limit is set to 22,020,096 bytes.

For the POST request, you must include either the downloadUrl parameter, the associated file, or both.

Comprehensive API actions

Creating a bundle

There are two different ways for creating a bundle:

  • Step by step creating in the first step the bundle and after that creating the different deployment elements included in the bundle
  • Introducing in the post request a zip file with the complete structure of the bundle.

The zip file will have the next content:

  • A file called “manifest.txt” where the content of the bundle is explained
  • The files that will become deployment elements within the bundle.

Updating a bundle

You must replace {bundle_name} with the identifier of the bundle you want to update and {version_name} with the selected version to be updated.

Note

You cannot update a bundle using the file option available in the create option.

You cannot update all the fields of a bundle. The following fields are allowed:

  • description
  • preaction
  • postaction
  • userNotes
  • active
  • Some fields of the deployments elements
Important

If a bundle has been used in an update operation, you can only update the following fields:

  • description
  • userNotes
  • active

Software, firmware, configuration. You can rely on OpenGate to update the software, the firmware, or the configuration files of your remote devices.

The updates can be executed using the operations API, but first of all, OpenGate must know the structure of your update bundles.

The following sections show you how to feed OpenGate with your software, firmware, and configuration files.

Deleting a bundle

Important

If a bundle has been used in an update operation, it can’t be deleted.

API specification

Geo-areas

Introduction

A geographical area is defined as a geographic zone delineated by a GeoJSON. The detection of device entry or exit at a specific location can be facilitated through the utilisation of these areas. Furthermore, automation rules can be devised to generate alerts when a device enters or exits a designated area.

Comprehensive API actions

Creating an area

An area can be created based on the methodology by which the geographic zone is determined: either by a GeoJSON or a group of devices. Subsequently, the option to retrieve information from both (GeoJSON and device group) is provided. Further details can be found in the section on creating an area specification.

Updating an area

It is permissible to modify all of the fields, with the exception of the identifier.

Searching areas

The OpenGate API query enables the retrieval of various platform areas, contingent on the user’s visualization capacity for their respective organization.

API specification

Manufacturers & Models

Each organization has its own hardware manufacturers and model catalogue. This information can be related to entities like devices.

Limited access API

Limited access

The provisioning API of this feature is only available to admin_domain and super_admin_domain profiles; on the other hand, anyone can use the searching API. Ask your administrator for proper user role profiling.

Some information of interest

Unique manufacturer name restriction

When a manufacturer is created, this can be assigned to entities in the same organization, including this one’s children; the non-name repeating restriction applies to the entire tree where that organization is located.

Hardware models and their relationships with entities

Entities such as devices can have their hardware model stored as part of their information. These models will be the ones belonging to the manufacturers available for the organization where the entity is.

When you edit or delete manufacturers’ or models’ information, you can choose whether you want this reflected in the entity’s information.

Follow the following links to check out the OpenAPI specs:

Subsections of Manufacturers & Models

Manufacturers

This is an API that allow to provide and manage the list of hardware models and manufacturers used in an organization. Here you can register manufacturers and models data to be referenced in devices information.

See Manufacturer object bellow on schemas.

Comprehensive API actions

Updating a manufacturer

‘UpdateDevices’ parameter

It is possible that entities may contain references to models that were previously manufactured by a now-deleted manufacturer. Consequently, deleting the manufacturer may result in a new discrepancy between its information and that of the entities. The updateDevices parameter allows the user to choose whether this action should be reflected or not. However, this only affects the manufacturer’s information; models remain unaffected.

Deleting Manufacturer

Warning

In the event that a manufacturer has already deployed models within the OpenGate framework, it is not possible to remove them.

‘UpdateDevices’ parameter

It is possible that entities may contain references to models that were previously manufactured by a now-deleted manufacturer. Consequently, deleting the manufacturer may result in a new discrepancy between its information and that of the entities. The updateDevices parameter allows the user to choose whether this action should be reflected or not. However, this only affects the manufacturer’s information; models remain unaffected.

Reading the organization manufacturer list

Visibility parameter

There are multiple methods for retrieving manufacturer lists, which are controlled by the “visibility” parameter. This parameter has the following possible values:

  • default: In the event that the aforementioned parameter is not transmitted, or if it is transmitted with the default value, the list of manufacturers that are part of the specified organisation, as indicated in the URL, will be returned.
  • assignable: The aforementioned value will yield a list of manufacturers that can be assigned to entities within the specified organisational structure, as indicated by the URL. This list comprises the manufacturers within the aforementioned organisational structure, along with their respective parents.
  • administrable: Upon transmission of this value, a list of manufacturers that can be managed will be returned. In the event that permissions are lacking for the specified action, or if the manufacturer is part of the organisation indicated in the URL and its subsidiaries, the list will be empty.

API specification

Models

Introduction

This API enables the provisioning and management of hardware models that are utilized to associate with the entities within an organizational structure.

Comprehensive API actions

Reading a model

It is possible that entities may contain references to models that were previously manufactured by a now-deleted manufacturer. Consequently, deleting the manufacturer may result in a new discrepancy between its information and that of the entities. The updateDevices parameter allows the user to choose whether this action should be reflected or not. However, this only affects the manufacturer’s information; models remain unaffected.

Deleting a model

It is possible that entities may contain references to models that were previously manufactured by a now-deleted manufacturer. Consequently, deleting the manufacturer may result in a new discrepancy between its information and that of the entities. The updateDevices parameter allows the user to choose whether this action should be reflected or not. However, this only affects the manufacturer’s information; models remain unaffected.

API specification

Data models

Introduction

A data model can be defined as a set of data stream templates. It defines all the variables associated with a device or type of entity for its management and monitoring. These variables represent the information about an individual “measure” that evolves over time, and thus define the main features of a data stream. Further details on this concept can be found in the default data model catalogue. This API enables the management of data models.

Comprehensive API actions

Updating a datamodel

Regarding the datastream (templates), the behavior of this request is:

  • All new data streams are incorporated into the existing data model.
  • For all existing data streams that have been provisioned and are included in the JSON request, all fields can be modified except for the identifier.
  • Please note that all datastreams that have already been provisioned and are not present in the JSON request will be removed. This is only the case if they have not previously been collected as datapoint instances. In the event that at least one datastream with previously collected datapoints is not present in the put option, an error is returned for the entire request.

Default data model catalog edition

Although the above fields are restricted from modification, the following fields of the data model can be adjusted:

  • datamodel.description
  • datamodel.category.datastream.description
  • datamodel.category.datastream.storage
  • datamodel.category.datastream.tags
  • datamodel.category.datastream.unit
  • datamodel.category.datastream.qrating
  • datamodel.category.datastream.views
  • datamodel.category.datastream.icon

The datamodel.category.datastream.schema field can also be modified, but only for the next datastreams:

  • provision.device.specificType
  • provision.device.communicationModules[].specificType
  • provision.device.communicationModules[].subscription.specificType
  • provision.device.communicationModules[].subscriber.specificType
  • provision.asset.specificType
  • device.specificType
  • device.communicationModules[].specificType
  • device.communicationModules[].subscription.specificType
  • device.communicationModules[].subscriber.specificType

This is an example of how to modify the schema field of the datastream provision.device.specificType:

{
   "identifier":"provision.device.specificType",
   "name":"Prov. Specific type",
   "period":"PULSE",
   "access":"READ",
   "schema":{
      "type":"string",
      "enum":[
         "BLOODPRESSURE_SENSOR",
         "COMHUB",
         "CONCENTRATOR"
      ]
   }
}

Deleting a datamodel

It is not possible to delete a data stream if it contains data points that have already been collected.

API specification

Subsections of Data models

Default data models

Introduction

The following list shows all the data models available in the default OpenGate’s catalog.

See data models to learn how to create a new data model for your IoT solution.

Data model catalog

collectionAsset

  • Identifier: collectionAsset
  • Version: 8.0.0.0
  • Description: Specific Datamodel to asset branch
  • Allowed resource types:
    • entity.asset
  • Categories:
    • assetCollectedInfo
      • Data streams:
        • Identifier
          • Identifier: asset.identifier
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm
        • Specific type
          • Identifier: asset.specificType
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • Name
          • Identifier: asset.name
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • Description
          • Identifier: asset.description
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection

provisionAsset

  • Identifier: provisionAsset
  • Version: 8.0.0.0
  • Description: Specific Datamodel to provision asset branch
  • Allowed resource types:
    • entity.asset
  • Categories:
    • assetProvisionedInfo
      • Data streams:
        • Prov. Identifier
          • Identifier: provision.asset.identifier
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. Specific type
          • Identifier: provision.asset.specificType
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. Administrative state
          • Identifier: provision.asset.administrativeState
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | provision
        • Prov. Name
          • Identifier: provision.asset.name
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. Description
          • Identifier: provision.asset.description
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. Location
          • Identifier: provision.asset.location
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: dmm | provision
        • Prov. Image
          • Identifier: provision.asset.image
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | provision
        • Prov. Related
          • Identifier: provision.asset.related
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | provision

bts

  • Identifier: bts
  • Version: 8.0.32.0
  • Description: BTS Datamodel
  • Allowed resource types:
    • entity.asset
  • Categories:
    • btsProvisionedInfo
      • Data streams:
        • btsOperator
          • Identifier: provision.btsOperator
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | provision
    • btsCollectedInfo
      • Data streams:
        • btsIpPercentage
          • Identifier: btsIpPercentage
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: analytics | bts
        • btsDataContextPercentage
          • Identifier: btsDataContextPercentage
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: analytics | collection
        • btsUnknownPercentage
          • Identifier: btsUnknownPercentage
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: analytics | collection
        • btsGsmPercentage
          • Identifier: btsGsmPercentage
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: analytics | collection

collectionChannel

  • Identifier: collectionChannel
  • Version: 8.0.2.0
  • Description: Specific Datamodel to collected channel info
  • Allowed resource types:
    • channel
  • Categories:
    • channelCollectedInfo
      • Data streams:
        • Identifier
          • Identifier: channel.identifier
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: channel

provisionChannel

  • Identifier: provisionChannel
  • Version: 8.0.2.0
  • Description: Specific Datamodel to provision a channel
  • Allowed resource types:
    • channel
  • Categories:
    • channelProvisionInfo
      • Data streams:
        • Prov. Identifier
          • Identifier: provision.channel.identifier
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: channel
        • Prov. Removable
          • Identifier: provision.channel.removable
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: channel
        • Description
          • Identifier: provision.channel.description
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: channel
        • Prov. Certificates
          • Identifier: provision.channel.certificates
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision

collectionDevice

  • Identifier: collectionDevice
  • Version: 8.0.0.0
  • Description: Specific Datamodel to device branch
  • Allowed resource types:
    • entity.device
  • Categories:
    • deviceCollectedInfo
      • Data streams:
        • Identifier
          • Identifier: device.identifier
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm
        • Specific type
          • Identifier: device.specificType
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • Name
          • Identifier: device.name
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • Description
          • Identifier: device.description
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • Birthdate
          • Identifier: device.birthDate
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • Serial number
          • Identifier: device.serialNumber
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • Model
          • Identifier: device.model
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • Software
          • Identifier: device.software
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | collection
        • Operational status
          • Identifier: device.operationalStatus
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | collection
        • Administrative state
          • Identifier: device.administrativeState
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | provision
        • Path
          • Identifier: device.topology.path
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | collection
        • Trusted boot
          • Identifier: device.trustedBoot
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: dmm | collection
        • Up time
          • Identifier: device.upTime
          • Unit: basicSI seconds
          • Period: CUMULATIVE
          • Storage:
          • Tags: dmm | status
        • Clock
          • Identifier: device.clock
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: dmm | status
        • Session type
          • Identifier: device.session.type
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • Session connector UUID
          • Identifier: device.session.connectorUuid
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
    • devicePerformanceCollectedInfo
      • Data streams:
        • Performance
          • Identifier: device.performance
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
    • deviceCpuCollectedInfo
      • Data streams:
        • CPU status
          • Identifier: device.cpu.status
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: dmm | cpu
        • CPU usage
          • Identifier: device.cpu.usage
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: dmm | cpu
        • CPU total
          • Identifier: device.cpu.total
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: dmm | cpu
    • deviceTemperatureCollectedInfo
      • Data streams:
        • Temperature
          • Identifier: device.temperature.value
          • Unit: basicSI degress
          • Period: INSTANT
          • Storage:
          • Tags: dmm | temperature | degrees
        • Temperature status
          • Identifier: device.temperature.status
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: dmm | temperature | status
    • devicePowerSupplyCollectedInfo
      • Data streams:
        • Powersupply status
          • Identifier: device.powersupply.status
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: dmm | power | status
        • Powersupply source
          • Identifier: device.powersupply.source
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: dmm | power | source
        • Powersupply battery status
          • Identifier: device.powersupply.battery.status
          • Unit: basicSI Volts
          • Period: INSTANT
          • Storage:
          • Tags: dmm | power | battery | voltage
        • Powersupply battery charge
          • Identifier: device.powersupply.battery.charge
          • Unit: basicSI percentage
          • Period: INSTANT
          • Storage:
          • Tags: dmm | power | percentage
        • Powersupply battery voltage
          • Identifier: device.powersupply.battery.voltage
          • Unit: basicSI milli Volts
          • Period: INSTANT
          • Storage:
          • Tags: dmm | power | battery | status
        • Powersupply battery
          • Identifier: device.powersupply.battery.current
          • Unit: basicSI Amps
          • Period: INSTANT
          • Storage:
          • Tags: dmm | power | battery | status
        • Powersupply outage
          • Identifier: device.powersupply.outage
          • Unit: basicSI date
          • Period: INSTANT
          • Storage:
          • Tags: dmm | power | outage
    • deviceMemoryCollectedInfo
      • Data streams:
        • RAM usage
          • Identifier: device.ram.usage
          • Unit: basicSI percentage
          • Period: INSTANT
          • Storage:
          • Tags: dmm | ram | memory | percentage
        • RAM total
          • Identifier: device.ram.total
          • Unit: basicSI megabytes
          • Period: INSTANT
          • Storage:
          • Tags: dmm | ram | memory | status
    • deviceRamDiskStorageCollectedInfo
      • Data streams:
        • RAM disk usage
          • Identifier: device.storage.ramDisk.usage
          • Unit: basicSI percentage
          • Period: INSTANT
          • Storage:
          • Tags: dmm | ramDisk | storage | percentage
        • RAM disk total
          • Identifier: device.storage.ramDisk.total
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: dmm | ramDisk | storage | total
    • deviceDiskStorageCollectedInfo
      • Data streams:
        • Disk usage
          • Identifier: device.storage.disk.usage
          • Unit: basicSI percentage
          • Period: INSTANT
          • Storage:
          • Tags: dmm | disk | storage
        • Disk total
          • Identifier: device.storage.disk.total
          • Unit: basicSI megabytes
          • Period: INSTANT
          • Storage:
          • Tags: dmm | disk | total
    • commsModuleCollectedInfo
      • Data streams:
        • CM identifier
          • Identifier: device.communicationModules[].identifier
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • CM specific type
          • Identifier: device.communicationModules[].specificType
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • CM name
          • Identifier: device.communicationModules[].name
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • CM description
          • Identifier: device.communicationModules[].description
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • CM serial number
          • Identifier: device.communicationModules[].serialNumber
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • CM model
          • Identifier: device.communicationModules[].model
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • CM operational status
          • Identifier: device.communicationModules[].operationalStatus
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | status
        • CM software
          • Identifier: device.communicationModules[].software
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • CM IMEI
          • Identifier: device.communicationModules[].mobile.imei
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
    • commsModuleRadioCollectedInfo
      • Data streams:
        • CM frequency band
          • Identifier: device.communicationModules[].mobile.frequencyBand
          • Unit: basicSI Hz
          • Period: PULSE
          • Storage:
          • Tags: dmm | status
        • CM antenna status
          • Identifier: device.communicationModules[].mobile.antenna.status
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | status
    • deviceCountersInfo
      • Data streams:
        • Accounting start last day counter
          • Identifier: device.counters.presence.accountingStartLastDay
          • Unit: basicSI bytes
          • Period: CUMULATIVE
          • Storage: NEVER
          • Tags: dmm | counters
        • Total used bytes last day counter
          • Identifier: device.counters.totalBytesLastDay
          • Unit: basicSI bytes
          • Period: CUMULATIVE
          • Storage: NEVER
          • Tags: dmm | counters
        • Total used bytes last month counter
          • Identifier: device.counters.totalBytesLastMonth
          • Unit: basicSI bytes
          • Period: CUMULATIVE
          • Storage: NEVER
          • Tags: dmm | counters
        • Total sent bytes last day counter
          • Identifier: device.counters.sentBytesLastDay
          • Unit: basicSI bytes
          • Period: CUMULATIVE
          • Storage: NEVER
          • Tags: dmm | counters
        • Total sent bytes last month counter
          • Identifier: device.counters.sentBytesLastMonth
          • Unit: basicSI bytes
          • Period: CUMULATIVE
          • Storage: NEVER
          • Tags: dmm | counters
        • Total received bytes last day counter
          • Identifier: device.counters.receivedBytesLastDay
          • Unit: basicSI bytes
          • Period: CUMULATIVE
          • Storage: NEVER
          • Tags: dmm | counters
        • Total received bytes last month counter
          • Identifier: device.counters.receivedBytesLastMonth
          • Unit: basicSI bytes
          • Period: CUMULATIVE
          • Storage: NEVER
          • Tags: dmm | counters
        • Total ping ok operations last day counter
          • Identifier: device.counters.presence.pingOKLastDay
          • Unit: basicSI bytes
          • Period: CUMULATIVE
          • Storage: NEVER
          • Tags: dmm | counters
        • Total ping nok operations last day counter
          • Identifier: device.counters.presence.pingNOKLastDay
          • Unit: basicSI bytes
          • Period: CUMULATIVE
          • Storage: NEVER
          • Tags: dmm | counters
        • Percentage ping ok operations last day counter
          • Identifier: device.counters.availabilityLastDay
          • Unit: basicSI bytes
          • Period: CUMULATIVE
          • Storage: NEVER
          • Tags: dmm | counters
        • Total consecutive ping nok operations per month counter
          • Identifier: device.counters.presence.consecutivePingNOK
          • Unit: basicSI bytes
          • Period: CUMULATIVE
          • Storage: NEVER
          • Tags: dmm | counters
    • deviceIdentificationUndeterminedInfo
      • Data streams:
        • Identification unknown
          • Identifier: device.identification.unknown
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: device | identification | unknown
        • Identification conflict
          • Identifier: device.identification.conflict
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: device | identification | conflict

provisionDevice

  • Identifier: provisionDevice
  • Version: 8.0.0.0
  • Description: Specific Datamodel to provision device branch
  • Allowed resource types:
    • entity.device
  • Categories:
    • deviceProvisionedInfo
      • Data streams:
        • Prov. Identifier
          • Identifier: provision.device.identifier
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. Certificates
          • Identifier: provision.device.certificates
          • Unit: basicSI
          • Period: INSTANT
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. Specific type
          • Identifier: provision.device.specificType
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. Name
          • Identifier: provision.device.name
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. Description
          • Identifier: provision.device.description
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. Administrative state
          • Identifier: provision.device.administrativeState
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | provision
        • Prov. Serial number
          • Identifier: provision.device.serialNumber
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. Operational status
          • Identifier: provision.device.operationalStatus
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | provision
        • Prov. Model
          • Identifier: provision.device.model
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. Software
          • Identifier: provision.device.software
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. Path
          • Identifier: provision.device.topology.path
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | provision
        • Prov. Location
          • Identifier: provision.device.location
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: dmm | provision
        • Prov. Trusted boot
          • Identifier: provision.device.trustedBoot
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: dmm | provision
        • Prov. Clock
          • Identifier: provision.device.clock
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: dmm | provision
        • Prov. Related
          • Identifier: provision.device.related
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. Image
          • Identifier: provision.device.image
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | provision
        • Prov. connector Id
          • Identifier: provision.device.connectorId
          • Unit:
          • Period: INSTANT
          • Storage:
          • Tags: connector | provision
    • commsModuleProvisionedInfo
      • Data streams:
        • Prov. CM identifier
          • Identifier: provision.device.communicationModules[].identifier
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. CM specific type
          • Identifier: provision.device.communicationModules[].specificType
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. CM name
          • Identifier: provision.device.communicationModules[].name
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. CM description
          • Identifier: provision.device.communicationModules[].description
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. CM serial number
          • Identifier: provision.device.communicationModules[].serialNumber
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. CM model
          • Identifier: provision.device.communicationModules[].model
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. CM operational status
          • Identifier: provision.device.communicationModules[].operationalStatus
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | provision
        • Prov. CM software
          • Identifier: provision.device.communicationModules[].software
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. CM IMEI
          • Identifier: provision.device.communicationModules[].mobile.imei
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision

entity

  • Identifier: entity
  • Version: 8.0.0.0
  • Description: Specific Datamodel to entity
  • Allowed resource types:
    • entity.device
    • entity.asset
  • Categories:
    • entity
      • Data streams:
        • entity.areas
          • Identifier: entity.areas
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm
        • entity.location
          • Identifier: entity.location
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: dmm | collection
        • entity.alarms
          • Identifier: entity.alarms
          • Unit: basicSI
          • Period: INSTANT
          • Storage: NEVER
          • Tags: dmm | collection

provisionGeneric

  • Identifier: provisionGeneric
  • Version: 8.0.2.0
  • Description: Define part of generic provision structure (serviceGroup, plan, defaultFeed)
  • Allowed resource types:
    • entity.asset
    • entity.device
    • entity.subscriber
    • entity.subscription
  • Categories:
    • provisionAdministrationFields
      • Data streams:
        • Service group
          • Identifier: provision.administration.serviceGroup
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Plan
          • Identifier: provision.administration.plan
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Default feed
          • Identifier: provision.administration.defaultFeed
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Username for SSH
          • Identifier: provision.administration.connection.ssh.username
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Password for SSH
          • Identifier: provision.administration.connection.ssh.password
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Port for SSH
          • Identifier: provision.administration.connection.ssh.port
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Transport protocol used in DLMS
          • Identifier: provision.administration.connection.dlms.connectionType
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • TCP or UDP port for DLMS
          • Identifier: provision.administration.connection.dlms.port
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Client transport wrapper port for DLMS
          • Identifier: provision.administration.connection.dlms.cwport
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Server transport wrapper port for DLMS
          • Identifier: provision.administration.connection.dlms.swport
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Authentication algorithm for DLMS
          • Identifier: provision.administration.connection.dlms.authentication
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Authentication password for DLMS
          • Identifier: provision.administration.connection.dlms.password
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Security for DLMS
          • Identifier: provision.administration.connection.dlms.security
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • SecuritySuite for DLMS
          • Identifier: provision.administration.connection.dlms.securitySuite
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • AuthenticationKey for DLMS
          • Identifier: provision.administration.connection.dlms.authenticationKey
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • BlockCipherKey for DLMS
          • Identifier: provision.administration.connection.dlms.blockCipherKey
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Certificate for Kite
          • Identifier: provision.administration.connection.kite.certificate
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: kite | provision
        • Private key for Kite
          • Identifier: provision.administration.connection.kite.privateKey
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: kite | provision
        • Api key for organization
          • Identifier: provision.administration.apiKey
          • Unit: basicSI
          • Period: INSTANT
          • Storage: NEVER
          • Tags: provision

provisionGenericChannel

  • Identifier: provisionGenericChannel
  • Version: 8.0.2.0
  • Description: Define part of generic provision structure (channel)
  • Allowed resource types:
    • entity.asset
    • entity.device
    • entity.subscriber
    • entity.subscription
  • Categories:
    • provisionAdministrationChannel
      • Data streams:
        • Prov. Channel
          • Identifier: provision.administration.channel
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision

provisionGenericIdentifier

  • Identifier: provisionGenericIdentifier
  • Version: 8.0.2.0
  • Description: Define part of generic provision structure (identifier)
  • Allowed resource types:
    • entity.asset
    • entity.device
    • entity.subscriber
    • entity.subscription
    • ticket
    • organization
    • channel
  • Categories:
    • provisionAdministrationIdentifier
      • Data streams:
        • Prov. Identifier
          • Identifier: provision.administration.identifier
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: ticket | dmm | provision

provisionGenericOrganization

  • Identifier: provisionGenericOrganization
  • Version: 8.0.2.0
  • Description: Define part of generic provision structure (organization)
  • Allowed resource types:
    • entity.asset
    • entity.device
    • entity.subscriber
    • entity.subscription
    • ticket
    • channel
  • Categories:
    • provisionAdministrationOrganization
      • Data streams:
        • Prov. Organization
          • Identifier: provision.administration.organization
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: ticket | dmm | provision

human

  • Identifier: human
  • Version: 8.0.21.0
  • Description: Human Provisioned and Collected Datamodel
  • Allowed resource types:
    • entity.asset
  • Categories:
    • humanProvisionedInfo
      • Data streams:
        • Identifier
          • Identifier: provision.human.identifier
          • Unit: basiSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: human | collection
        • Name
          • Identifier: provision.human.name
          • Unit: basiSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: human | collection
        • Surname
          • Identifier: provision.human.surname
          • Unit: basiSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: human | collection
        • Surname2
          • Identifier: provision.human.surname2
          • Unit: basiSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: human | collection
        • Birthdate
          • Identifier: provision.human.birthdate
          • Unit: basiSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: human | collection
        • Image
          • Identifier: provision.human.image
          • Unit: basiSI
          • Period: PULSE
          • Storage:
          • Tags: human | collection
        • Email
          • Identifier: provision.human.email
          • Unit: basiSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: human | collection
        • Telephone
          • Identifier: provision.human.telephone
          • Unit: basiSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: human | collection

  • Identifier:
  • Version:
  • Description:
  • Allowed resource types:
  • Categories:

og.electricity

  • Identifier: ogElectricity
  • Version: 3.5
  • Description: Specific Datamodel to OpenGate electricity
  • Allowed resource types:
    • entity.device
    • entity.asset
  • Categories:
    • electricityEnergy
      • Data streams:
        • Absolute imported active energy diary summary
          • Identifier: eImpActTotDia
          • Unit: SI kilo Watt/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | imported
        • Absolute exported active energy diary summary
          • Identifier: eExpActTotDia
          • Unit: SI kilo Watt/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | exported
        • Absolute quadrant I reactive energy diary summary
          • Identifier: eImpReQ1TotDia
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | imported
        • Absolute quadrant II reactive energy diary summary
          • Identifier: eImpReQ2TotDia
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | imported
        • Absolute quadrant III reactive energy diary summary
          • Identifier: eImpReQ3TotDia
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | imported
        • Absolute quadrant IV reactive energy diary summary
          • Identifier: eImpReQ4TotDia
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | imported
        • Absolute imported active energy
          • Identifier: eImpActTot
          • Unit: SI kilo Watt/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | imported
        • Absolute exported active energy
          • Identifier: eExpActTot
          • Unit: SI kilo Watt/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | exported
        • Absolute quadrant I reactive energy
          • Identifier: eImpReQ1Tot
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | imported
        • Absolute quadrant II reactive energy
          • Identifier: eImpReQ2Tot
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | imported
        • Absolute quadrant III reactive energy
          • Identifier: eImpReQ3Tot
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | imported
        • Absolute quadrant IV reactive energy
          • Identifier: eImpReQ4Tot
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | imported
        • Array de energía activa importada absoluto
          • Identifier: eImpActTotArray
          • Unit:
          • Period: INSTANT
          • Storage:
          • Tags: electricity | imported
        • Increment imported active energy diary summary
          • Identifier: eImpActIncDia
          • Unit: SI kilo Watt/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | imported
        • Increment exported active energy diary summary
          • Identifier: eExpActIncDia
          • Unit: SI kilo Watt/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | exported
        • Increment quadrant I reactive energy diary summary
          • Identifier: eImpReQ1IncDia
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | imported
        • Increment quadrant II reactive energy diary summary
          • Identifier: eImpReQ2IncDia
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | imported
        • Increment quadrant III reactive energy diary summary
          • Identifier: eImpReQ3IncDia
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | imported
        • Increment quadrant IV reactive energy diary summary
          • Identifier: eImpReQ4IncDia
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | imported
        • Increment imported active energy
          • Identifier: eImpActInc
          • Unit: SI kilo Watt/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | imported
        • Increment exported active energy
          • Identifier: eExpActInc
          • Unit: SI kilo Watt/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | exported
        • Increment quadrant I reactive energy
          • Identifier: eImpReQ1Inc
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | imported
        • Increment quadrant II reactive energy
          • Identifier: eImpReQ2Inc
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | imported
        • Increment quadrant III reactive energy
          • Identifier: eImpReQ3Inc
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | imported
        • Increment quadrant IV reactive energy
          • Identifier: eImpReQ4Inc
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | imported
        • Array de energía activa importada incremental
          • Identifier: eImpActIncArray
          • Unit:
          • Period: INSTANT
          • Storage:
          • Tags: electricity | imported
    • electricity.device
      • Data streams:
        • Manufacturer Code
          • Identifier: manufacturerCode
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | device
        • Meter identifier
          • Identifier: contIdentifier
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | device
        • Serial port 1 speed
          • Identifier: serialPort1Speed
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | device
        • Serial port 1 configuration (data bits/parity/stop bits)
          • Identifier: serialPort1Conf
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | device
        • Sending mode of the initialization string of the modem by serial port 1
          • Identifier: serialPort1ShipMode
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | device
        • Ascii string to send via serial port 1
          • Identifier: serialPort1AsciiString
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | device
        • Serial port 2 speed
          • Identifier: serialPort2Speed
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | device
        • Serial port 2 configuration (data bits/parity/stop bits)
          • Identifier: serialPort2Conf
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | device
        • Link address
          • Identifier: elinkAddress
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | device
        • Measure points quantity
          • Identifier: measurePointsQuantity
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | device
        • Measure point
          • Identifier: measurePoint
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | device
        • Access password
          • Identifier: accessPass
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | device
        • Integration period
          • Identifier: intPeriod
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | device
        • Registry depth
          • Identifier: regDepth
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | device
    • deviceReading
      • Data streams:
        • Reading state
          • Identifier: readingState
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | device
    • electricity.voltage
      • Data streams:
        • Value in volts * 10 V primary
          • Identifier: voltPrim
          • Unit: SI Volts
          • Period: INSTANT
          • Storage:
          • Tags: electricity | voltage
        • Value in voltios * 10 V secondary
          • Identifier: voltSec
          • Unit: SI Volts
          • Period: INSTANT
          • Storage:
          • Tags: electricity | voltage
    • electricity.intensity
      • Data streams:
        • Value in amperes * 10 V primary
          • Identifier: intenPrim
          • Unit: SI Ampere
          • Period: INSTANT
          • Storage:
          • Tags: electricity | intensity
        • Value in amperes * 10 V secondary
          • Identifier: intenSec
          • Unit: SI Ampere
          • Period: INSTANT
          • Storage:
          • Tags: electricity | intensity
    • electricity.integration
      • Data streams:
        • Integration period in minutes of the 1st load curve
          • Identifier: IntPerLoadCurve1
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | integration period
        • Integration period in minutes of the 2nd load curve
          • Identifier: IntPerLoadCurve2
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | integration period
        • Integration period in minutes of the 3rd load curve
          • Identifier: IntPerLoadCurve3
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | integration period
    • electricity.contract
      • Data streams:
        • Type of contract
          • Identifier: contractType
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | contract
        • State of contract
          • Identifier: contractState
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | contract
    • electricity.protocol
      • Data streams:
        • Standard date
          • Identifier: protocolDate
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | protocol
        • Date of the version of this protocol
          • Identifier: protocolRevDate
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | protocol
    • rate1Current
      • Data streams:
        • Current absolute energy in tariff period 1
          • Identifier: eRate1ActTotCur
          • Unit: SI kilo Watt/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 1 | current
        • Current increment energy in tariff period 1
          • Identifier: eRate1ActIncCur
          • Unit: SI kilo Watt/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | tariff 1 | current
        • Current absolute inductive reactive energy in tariff period 1
          • Identifier: eRate1ReIndTotCur
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 1 | current
        • Current increment inductive reactive energy in tariff period 1
          • Identifier: eRate1ReIndIncCur
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | tariff 1 | current
        • Current absolute capacitive reactive energy in tariff period 1
          • Identifier: eRate1ReCapTotCur
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 1 | current
        • Current increment capacitive reactive energy in tariff period 1
          • Identifier: eRate1ReCapIncCur
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | tariff 1 | current
        • Current maximum power in tariff period 1
          • Identifier: rate1PowerMaxValCur
          • Unit: SI kilo Watt
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 1 | current
        • Current excess power in tariff period 1
          • Identifier: rate1PowerExValCur
          • Unit: SI kilo Watt
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 1 | current
        • Current init period in tariff period 1
          • Identifier: rate1PricInitPeriCur
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 1 | current
        • Current end period in tariff period 1
          • Identifier: rate1PricEndPeriCur
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 1 | current
        • Total current r.s
          • Identifier: eRate1ActTotArrayCur
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 1 | current
    • rate1Memory
      • Data streams:
        • Memory absolute energy in tariff period 1
          • Identifier: eRate1ActTotMem
          • Unit: SI kilo Watt/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 1 | memory
        • Memory increment energy in tariff period 1
          • Identifier: eRate1ActIncMem
          • Unit: SI kilo Watt/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | tariff 1 | memory
        • Memory absolute inductive reactive energy in tariff period 1
          • Identifier: eRate1ReIndTotMem
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 1 | memory
        • Memory increment inductive reactive energy in tariff period 1
          • Identifier: eRate1ReIndIncMem
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | tariff 1 | memory
        • Memory absolute capacitive reactive energy in tariff period 1
          • Identifier: eRate1ReCapTotMem
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 1 | memory
        • Memory increment capacitive reactive energy in tariff period 1
          • Identifier: eRate1ReCapIncMem
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | tariff 1 | memory
        • Memory maximum power in tariff period 1
          • Identifier: rate1PowerMaxValMem
          • Unit: SI kilo Watt
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 1 | memory
        • Memory excess power in tariff period 1
          • Identifier: rate1PowerExValMem
          • Unit: SI kilo Watt
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 1 | memory
        • Memory init period in tariff period 1
          • Identifier: rate1PricInitPeriMem
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 1 | memory
        • Memory end period in tariff period 1
          • Identifier: rate1PricEndPeriMem
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 1 | memory
        • Total memory r.s
          • Identifier: eRate1ActTotArrayMem
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 1 | current
    • rate2Current
      • Data streams:
        • Current absolute energy in tariff period 2
          • Identifier: eRate2ActTotCur
          • Unit: SI kilo Watt/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 2 | current
        • Current increment energy in tariff period 2
          • Identifier: eRate2ActIncCur
          • Unit: SI kilo Watt/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | tariff 2 | current
        • Current absolute inductive reactive energy in tariff period 2
          • Identifier: eRate2ReIndTotCur
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 2 | current
        • Current increment inductive reactive energy in tariff period 2
          • Identifier: eRate2ReIndIncCur
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | tariff 2 | current
        • Current absolute capacitive reactive energy in tariff period 2
          • Identifier: eRate2ReCapTotCur
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 2 | current
        • Current increment capacitive reactive energy in tariff period 2
          • Identifier: eRate2ReCapIncCur
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | tariff 2 | current
        • Current maximum power in tariff period 2
          • Identifier: rate2PowerMaxValCur
          • Unit: SI kilo Watt
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 2 | current
        • Current excess power in tariff period 2
          • Identifier: rate2PowerExValCur
          • Unit: SI kilo Watt
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 2 | current
        • Current init period in tariff period 2
          • Identifier: rate2PricInitPeriCur
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 2 | current
        • Current end period in tariff period 2
          • Identifier: rate2PricEndPeriCur
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 2 | current
    • rate2Memory
      • Data streams:
        • Memory absolute energy in tariff period 2
          • Identifier: eRate2ActTotMem
          • Unit: SI kilo Watt/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 2 | memory
        • Memory increment energy in tariff period 2
          • Identifier: eRate2ActIncMem
          • Unit: SI kilo Watt/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | tariff 2 | memory
        • Memory absolute inductive reactive energy in tariff period 2
          • Identifier: eRate2ReIndTotMem
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 2 | memory
        • Memory increment inductive reactive energy in tariff period 2
          • Identifier: eRate2ReIndIncMem
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | tariff 2 | memory
        • Memory absolute capacitive reactive energy in tariff period 2
          • Identifier: eRate2ReCapTotMem
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 2 | memory
        • Memory increment capacitive reactive energy in tariff period 2
          • Identifier: eRate2ReCapIncMem
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | tariff 2 | memory
        • Memory maximum power in tariff period 2
          • Identifier: rate2PowerMaxValMem
          • Unit: SI kilo Watt
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 2 | memory
        • Memory excess power in tariff period 2
          • Identifier: rate2PowerExValMem
          • Unit: SI kilo Watt
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 2 | memory
        • Memory init period in tariff period 2
          • Identifier: rate2PricInitPeriMem
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 2 | memory
        • Memory end period in tariff period 2
          • Identifier: rate2PricEndPeriMem
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 2 | memory
    • rate3Current
      • Data streams:
        • Current absolute energy in tariff period 3
          • Identifier: eRate3ActTotCur
          • Unit: SI kilo Watt/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 3 | current
        • Current increment energy in tariff period 3
          • Identifier: eRate3ActIncCur
          • Unit: SI kilo Watt/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | tariff 3 | current
        • Current absolute inductive reactive energy in tariff period 3
          • Identifier: eRate3ReIndTotCur
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 3 | current
        • Current increment inductive reactive energy in tariff period 3
          • Identifier: eRate3ReIndIncCur
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | tariff 3 | current
        • Current absolute capacitive reactive energy in tariff period 3
          • Identifier: eRate3ReCapTotCur
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 3 | current
        • Current increment capacitive reactive energy in tariff period 3
          • Identifier: eRate3ReCapIncCur
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | tariff 3 | current
        • Current maximum power in tariff period 3
          • Identifier: rate3PowerMaxValCur
          • Unit: SI kilo Watt
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 3 | current
        • Current excess power in tariff period 3
          • Identifier: rate3PowerExValCur
          • Unit: SI kilo Watt
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 3 | current
        • Current init period in tariff period 3
          • Identifier: rate3PricInitPeriCur
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 3 | current
        • Current end period in tariff period 3
          • Identifier: rate3PricEndPeriCur
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 3 | current
    • rate3Memory
      • Data streams:
        • Memory absolute energy in tariff period 3
          • Identifier: eRate3ActTotMem
          • Unit: SI kilo Watt/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 3 | memory
        • Memory increment energy in tariff period 3
          • Identifier: eRate3ActIncMem
          • Unit: SI kilo Watt/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | tariff 3 | memory
        • Memory absolute inductive reactive energy in tariff period 3
          • Identifier: eRate3ReIndTotMem
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 3 | memory
        • Memory increment inductive reactive energy in tariff period 3
          • Identifier: eRate3ReIndIncMem
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | tariff 3 | memory
        • Memory absolute capacitive reactive energy in tariff period 3
          • Identifier: eRate3ReCapTotMem
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 3 | memory
        • Memory increment capacitive reactive energy in tariff period 3
          • Identifier: eRate3ReCapIncMem
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | tariff 3 | memory
        • Memory maximum power in tariff period 3
          • Identifier: rate3PowerMaxValMem
          • Unit: SI kilo Watt
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 3 | memory
        • Memory excess power in tariff period 3
          • Identifier: rate3PowerExValMem
          • Unit: SI kilo Watt
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 3 | memory
        • Memory init period in tariff period 3
          • Identifier: rate3PricInitPeriMem
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 3 | memory
        • Memory end period in tariff period 3
          • Identifier: rate3PricEndPeriMem
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 3 | memory
    • rate4Current
      • Data streams:
        • Current absolute energy in tariff period 4
          • Identifier: eRate4ActTotCur
          • Unit: SI kilo Watt/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 4 | current
        • Current increment energy in tariff period 4
          • Identifier: eRate4ActIncCur
          • Unit: SI kilo Watt/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | tariff 4 | current
        • Current absolute inductive reactive energy in tariff period 4
          • Identifier: eRate4ReIndTotCur
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 4 | current
        • Current increment inductive reactive energy in tariff period 4
          • Identifier: eRate4ReIndIncCur
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | tariff 4 | current
        • Current absolute capacitive reactive energy in tariff period 4
          • Identifier: eRate4ReCapTotCur
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 4 | current
        • Current increment capacitive reactive energy in tariff period 4
          • Identifier: eRate4ReCapIncCur
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | tariff 4 | current
        • Current maximum power in tariff period 4
          • Identifier: rate4PowerMaxValCur
          • Unit: SI kilo Watt
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 4 | current
        • Current excess power in tariff period 4
          • Identifier: rate4PowerExValCur
          • Unit: SI kilo Watt
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 4 | current
        • Current init period in tariff period 4
          • Identifier: rate4PricInitPeriCur
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 4 | current
        • Current end period in tariff period 4
          • Identifier: rate4PricEndPeriCur
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 4 | current
    • rate4Memory
      • Data streams:
        • Memory absolute energy in tariff period 4
          • Identifier: eRate4ActTotMem
          • Unit: SI kilo Watt/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 4 | memory
        • Memory increment energy in tariff period 4
          • Identifier: eRate4ActIncMem
          • Unit: SI kilo Watt/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | tariff 4 | memory
        • Memory absolute inductive reactive energy in tariff period 4
          • Identifier: eRate4ReIndTotMem
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 4 | memory
        • Memory increment inductive reactive energy in tariff period 4
          • Identifier: eRate4ReIndIncMem
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | tariff 4 | memory
        • Memory absolute capacitive reactive energy in tariff period 4
          • Identifier: eRate4ReCapTotMem
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 4 | memory
        • Memory increment capacitive reactive energy in tariff period 4
          • Identifier: eRate4ReCapIncMem
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | tariff 4 | memory
        • Memory maximum power in tariff period 4
          • Identifier: rate4PowerMaxValMem
          • Unit: SI kilo Watt
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 4 | memory
        • Memory excess power in tariff period 4
          • Identifier: rate4PowerExValMem
          • Unit: SI kilo Watt
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 4 | memory
        • Memory init period in tariff period 4
          • Identifier: rate4PricInitPeriMem
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 4 | memory
        • Memory end period in tariff period 4
          • Identifier: rate4PricEndPeriMem
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 4 | memory
    • rate5Current
      • Data streams:
        • Current absolute energy in tariff period 5
          • Identifier: eRate5ActTotCur
          • Unit: SI kilo Watt/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 5 | current
        • Current increment energy in tariff period 5
          • Identifier: eRate5ActIncCur
          • Unit: SI kilo Watt/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | tariff 5 | current
        • Current absolute inductive reactive energy in tariff period 5
          • Identifier: eRate5ReIndTotCur
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 5 | current
        • Current increment inductive reactive energy in tariff period 5
          • Identifier: eRate5ReIndIncCur
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | tariff 5 | current
        • Current absolute capacitive reactive energy in tariff period 5
          • Identifier: eRate5ReCapTotCur
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 5 | current
        • Current increment capacitive reactive energy in tariff period 5
          • Identifier: eRate5ReCapIncCur
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | tariff 5 | current
        • Current maximum power in tariff period 5
          • Identifier: rate5PowerMaxValCur
          • Unit: SI kilo Watt
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 5 | current
        • Current excess power in tariff period 5
          • Identifier: rate5PowerExValCur
          • Unit: SI kilo Watt
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 5 | current
        • Current init period in tariff period 5
          • Identifier: rate5PricInitPeriCur
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 5 | current
        • Current end period in tariff period 5
          • Identifier: rate5PricEndPeriCur
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 5 | current
    • rate5Memory
      • Data streams:
        • Memory absolute energy in tariff period 5
          • Identifier: eRate5ActTotMem
          • Unit: SI kilo Watt/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 5 | memory
        • Memory increment energy in tariff period 5
          • Identifier: eRate5ActIncMem
          • Unit: SI kilo Watt/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | tariff 5 | memory
        • Memory absolute inductive reactive energy in tariff period 5
          • Identifier: eRate5ReIndTotMem
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 5 | memory
        • Memory increment inductive reactive energy in tariff period 5
          • Identifier: eRate5ReIndIncMem
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | tariff 5 | memory
        • Memory absolute capacitive reactive energy in tariff period 5
          • Identifier: eRate5ReCapTotMem
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 5 | memory
        • Memory increment capacitive reactive energy in tariff period 5
          • Identifier: eRate5ReCapIncMem
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | tariff 5 | memory
        • Memory maximum power in tariff period 5
          • Identifier: rate5PowerMaxValMem
          • Unit: SI kilo Watt
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 5 | memory
        • Memory excess power in tariff period 5
          • Identifier: rate5PowerExValMem
          • Unit: SI kilo Watt
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 5 | memory
        • Memory init period in tariff period 5
          • Identifier: rate5PricInitPeriMem
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 5 | memory
        • Memory end period in tariff period 5
          • Identifier: rate5PricEndPeriMem
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 5 | memory
    • rate6Current
      • Data streams:
        • Current absolute energy in tariff period 6
          • Identifier: eRate6ActTotCur
          • Unit: SI kilo Watt/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 6 | current
        • Current increment energy in tariff period 6
          • Identifier: eRate6ActIncCur
          • Unit: SI kilo Watt/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | tariff 6 | current
        • Current absolute inductive reactive energy in tariff period 6
          • Identifier: eRate6ReIndTotCur
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 6 | current
        • Current increment inductive reactive energy in tariff period 6
          • Identifier: eRate6ReIndIncCur
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | tariff 6 | current
        • Current absolute capacitive reactive energy in tariff period 6
          • Identifier: eRate6ReCapTotCur
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 6 | current
        • Current increment capacitive reactive energy in tariff period 6
          • Identifier: eRate6ReCapIncCur
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | tariff 6 | current
        • Current maximum power in tariff period 6
          • Identifier: rate6PowerMaxValCur
          • Unit: SI kilo Watt
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 6 | current
        • Current excess power in tariff period 6
          • Identifier: rate6PowerExValCur
          • Unit: SI kilo Watt
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 6 | current
        • Current init period in tariff period 6
          • Identifier: rate6PricInitPeriCur
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 6 | current
        • Current end period in tariff period 6
          • Identifier: rate6PricEndPeriCur
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 6 | current
    • rate6Memory
      • Data streams:
        • Memory absolute energy in tariff period 6
          • Identifier: eRate6ActTotMem
          • Unit: SI kilo Watt/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 6 | memory
        • Memory increment energy in tariff period 6
          • Identifier: eRate6ActIncMem
          • Unit: SI kilo Watt/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | tariff 6 | memory
        • Memory absolute inductive reactive energy in tariff period 6
          • Identifier: eRate6ReIndTotMem
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 6 | memory
        • Memory increment inductive reactive energy in tariff period 6
          • Identifier: eRate6ReIndIncMem
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | tariff 6 | memory
        • Memory absolute capacitive reactive energy in tariff period 6
          • Identifier: eRate6ReCapTotMem
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 6 | memory
        • Memory increment capacitive reactive energy in tariff period 6
          • Identifier: eRate6ReCapIncMem
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | tariff 6 | memory
        • Memory maximum power in tariff period 6
          • Identifier: rate6PowerMaxValMem
          • Unit: SI kilo Watt
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 6 | memory
        • Memory excess power in tariff period 6
          • Identifier: rate6PowerExValMem
          • Unit: SI kilo Watt
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 6 | memory
        • Memory init period in tariff period 6
          • Identifier: rate6PricInitPeriMem
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 6 | memory
        • Memory end period in tariff period 6
          • Identifier: rate6PricEndPeriMem
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff 6 | memory
    • rateTotalCurrent
      • Data streams:
        • Current absolute energy in tariff period total
          • Identifier: eRateTotActTotCur
          • Unit: SI kilo Watt/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff total | current
        • Current increment energy in tariff period total
          • Identifier: eRateTotActIncCur
          • Unit: SI kilo Watt/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | tariff total | current
        • Current absolute inductive reactive energy in tariff period total
          • Identifier: eRateTotReIndTotCur
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff total | current
        • Current increment inductive reactive energy in tariff period total
          • Identifier: eRateTotReIndIncCur
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | tariff total | current
        • Current absolute capacitive reactive energy in tariff period total
          • Identifier: eRateTotReCapTotCur
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff total | current
        • Current increment capacitive reactive energy in tariff period total
          • Identifier: eRateTotReCapIncCur
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | tariff total | current
        • Current maximum power in tariff period total
          • Identifier: rateTotPowerMaxValCur
          • Unit: SI kilo Watt
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff total | current
        • Current excess power in tariff period total
          • Identifier: rateTotPowerExValCur
          • Unit: SI kilo Watt
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff total | current
        • Current init period in tariff period total
          • Identifier: rateTotPricInitPeriCur
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff total | current
        • Current end period in tariff period total
          • Identifier: rateTotPricEndPeriCur
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff total | current
    • rateTotalMemory
      • Data streams:
        • Memory absolute energy in tariff period total
          • Identifier: eRateTotActTotMem
          • Unit: SI kilo Watt/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff total | memory
        • Memory increment energy in tariff period total
          • Identifier: eRateTotActIncMem
          • Unit: SI kilo Watt/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | tariff total | memory
        • Memory absolute inductive reactive energy in tariff period total
          • Identifier: eRateTotReIndTotMem
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff total | memory
        • Memory increment inductive reactive energy in tariff period total
          • Identifier: eRateTotReIndIncMem
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | tariff total | memory
        • Memory absolute capacitive reactive energy in tariff period total
          • Identifier: eRateTotReCapTotMem
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff total | memory
        • Memory increment capacitive reactive energy in tariff period total
          • Identifier: eRateTotReCapIncMem
          • Unit: SI kilo Volt Ampere Reactive/hour
          • Period: PULSE
          • Storage:
          • Tags: electricity | tariff total | memory
        • Memory maximum power in tariff period total
          • Identifier: rateTotPowerMaxValMem
          • Unit: SI kilo Watt
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff total | memory
        • Memory excess power in tariff period total
          • Identifier: rateTotPowerExValMem
          • Unit: SI kilo Watt
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff total | memory
        • Memory init period in tariff period total
          • Identifier: rateTotPricInitPeriMem
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff total | memory
        • Memory end period in tariff period total
          • Identifier: rateTotPricEndPeriMem
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | tariff total | memory
    • PrimeConcentratorState
      • Data streams:
        • S24 state
          • Identifier: cS24State
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Concentrator | PRIME
        • S11 state
          • Identifier: cS11State
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Concentrator | PRIME
        • S02 state
          • Identifier: cS02State
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Concentrator | PRIME
        • S03 state
          • Identifier: cS03State
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Concentrator | PRIME
        • S09 state
          • Identifier: cS09State
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Concentrator | PRIME
        • S18 state
          • Identifier: cS18State
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Concentrator | PRIME
        • S23 state
          • Identifier: cS23State
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Concentrator | PRIME
        • Protocol version
          • Identifier: protVersion
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Concentrator | PRIME
    • PrimeConcentratorBaseNodePLC_S11
      • Data streams:
        • MacSNA
          • Identifier: macSNA
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Concentrator | PRIME
        • macBeaconsPerFrame
          • Identifier: macBeaconsPerFrame
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Concentrator | PRIME
        • MacState
          • Identifier: macState
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Concentrator | PRIME
        • MacSCPLength
          • Identifier: macSCPLength
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Concentrator | PRIME
        • MacNodeHierarchyLevel
          • Identifier: macNodeHierarchyLevel
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Concentrator | PRIME
        • MacBeaconSlotCount
          • Identifier: macBeaconSlotCount
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Concentrator | PRIME
        • MacBeaconTxSlot
          • Identifier: macBeaconTxSlot
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Concentrator | PRIME
        • MacBeaconTxFrequency
          • Identifier: macBeaconTxFrequency
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Concentrator | PRIME
        • MacCSMAChBusyCount
          • Identifier: macCSMAChBusyCount
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Concentrator | PRIME
    • PrimeConcentratorMacList_S11
      • Data streams:
        • macListRegDevices
          • Identifier: macListRegDevices
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Concentrator | PRIME
        • macListActiveConn
          • Identifier: macListActiveConn
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Concentrator | PRIME
        • macListMcastEntries
          • Identifier: macListMcastEntries
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Concentrator | PRIME
        • macListSwitchTable
          • Identifier: macListSwitchTable
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Concentrator | PRIME
        • macListDirectConn
          • Identifier: macListDirectConn
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Concentrator | PRIME
        • macListDirectTable
          • Identifier: macListDirectTable
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Concentrator | PRIME
        • macListAvailableSwitches
          • Identifier: macListAvailablesSwitches
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Concentrator | PRIME
    • PrimeMeter
      • Data streams:
        • comStatus
          • Identifier: meterComState
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Meter | PRIME
        • Date
          • Identifier: lastAcDCtoMeter
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Meter | PRIME
        • Active
          • Identifier: DCActive
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Meter | PRIME
        • Meter state
          • Identifier: MeterState
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Meter | PRIME
        • Meter event
          • Identifier: MeterEvent
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Meter | PRIME
        • resOperation
          • Identifier: resOperation
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | meter | PRIME
    • provisionDevice
      • Data streams:
        • IP
          • Identifier: provision.ip
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags:
        • Port
          • Identifier: provision.port
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags:
        • User
          • Identifier: provision.user
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags:
        • Password
          • Identifier: provision.password
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags:
        • Port config
          • Identifier: provision.portConfig
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags:
        • Speed
          • Identifier: provision.speed
          • Unit: basicSI Baudios
          • Period: INSTANT
          • Storage:
          • Tags:
        • Parity
          • Identifier: provision.parity
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags:
        • Stop bits
          • Identifier: provision.stopBits
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags:
        • Data bits
          • Identifier: provision.dataBits
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags:
        • Control flow
          • Identifier: provision.flowControl
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags:
        • Hardware control flow
          • Identifier: provision.hwFlowControl
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags:
    • provisionSmartMeter
      • Data streams:
        • Type of meter
          • Identifier: provision.type
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | type
        • Distributor name
          • Identifier: provision.distributorName
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity
        • Link address
          • Identifier: provision.linkAddress
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags:
        • Measure point
          • Identifier: provision.measurePoint
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags:
        • Password access
          • Identifier: provision.passwordAccess
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags:
        • IEC102 connection timeout
          • Identifier: provision.timeoutIEC102
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags:
        • Password write
          • Identifier: provision.passwordWrite
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags:
        • CUPS
          • Identifier: provision.cups
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags:
        • Rate
          • Identifier: provision.rate
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags:
        • Backoffice code
          • Identifier: provision.backofficeCode
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags:
        • Start date
          • Identifier: provision.startDate
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags:
        • End date
          • Identifier: provision.endDate
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags:
        • Telemetry signature
          • Identifier: provision.telemetrySigned
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags:
        • Activation date
          • Identifier: provision.activationDate
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags:
        • Meter owner
          • Identifier: provision.meterOwner
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags:
        • Customer name
          • Identifier: provision.customerName
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags:
    • provisionPrimeRequestTypeConcentrator
      • Data streams:
        • Type of request S24
          • Identifier: provision.requestTypeS24
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Concentrator | PRIME
        • Type of request S11
          • Identifier: provision.requestTypeS11
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Concentrator | PRIME
        • Type of request S02
          • Identifier: provision.requestTypeS02
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Concentrator | PRIME
        • Type of request S03
          • Identifier: provision.requestTypeS03
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Concentrator | PRIME
        • Type of request S09
          • Identifier: provision.requestTypeS09
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Concentrator | PRIME
        • Type of request S18
          • Identifier: provision.requestTypeS18
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Concentrator | PRIME
        • Type of request S23
          • Identifier: provision.requestTypeS23
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Concentrator | PRIME
        • Type of request B03
          • Identifier: provision.requestTypeB03
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Concentrator | PRIME
        • Type of request B02
          • Identifier: provision.requestTypeB02
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Concentrator | PRIME
        • Protocol version
          • Identifier: provision.protVersion
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Concentrator | PRIME
    • provisionPrimeFtpConcentrator
      • Data streams:
        • FTP user
          • Identifier: provision.ftpUser
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Concentrator | PRIME
        • FTP password
          • Identifier: provision.ftpPass
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Concentrator | PRIME
        • FTP IP
          • Identifier: provision.ftpIp
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Concentrator | PRIME
        • FTP port
          • Identifier: provision.ftpPort
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Concentrator | PRIME
        • FTP path
          • Identifier: provision.ftpPath
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Concentrator | PRIME
        • Soap port
          • Identifier: provision.soapPort
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Concentrator | PRIME
        • Soap IP
          • Identifier: provision.soapIp
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Concentrator | PRIME
    • S18
      • Data streams:
        • Order Execution Time
          • Identifier: orderExecutionTime
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Meter | PRIME
        • Executed Order
          • Identifier: executedOrder
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Concentrator | meter | PRIME
    • S23
      • Data streams:
        • Present Contract Power Activation Date
          • Identifier: presentContPowerActDate
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Meter | PRIME
        • Potencia Contrato 1 periodo de tarificación 1
          • Identifier: pCr1Tr1
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Meter | PRIME
        • Potencia Contrato 1 periodo de tarificación 2
          • Identifier: pCr1Tr2
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Meter | PRIME
        • Potencia Contrato 1 periodo de tarificación 3
          • Identifier: pCr1Tr3
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Meter | PRIME
        • Potencia Contrato 1 periodo de tarificación 4
          • Identifier: pCr1Tr4
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Meter | PRIME
        • Potencia Contrato 1 periodo de tarificación 5
          • Identifier: pCr1Tr5
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Meter | PRIME
        • Potencia Contrato 1 periodo de tarificación 6
          • Identifier: pCr1Tr6
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Meter | PRIME
        • Potencia residual Contrato 1 periodo de tarificación 1
          • Identifier: pResTr1
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Meter | PRIME
        • Potencia residual Contrato 1 periodo de tarificación 2
          • Identifier: pResTr2
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Meter | PRIME
        • Potencia residual Contrato 1 periodo de tarificación 3
          • Identifier: pResTr3
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Meter | PRIME
        • Potencia residual Contrato 1 periodo de tarificación 4
          • Identifier: pResTr4
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Meter | PRIME
        • Potencia residual Contrato 1 periodo de tarificación 5
          • Identifier: pResTr5
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Meter | PRIME
        • Potencia residual Contrato 1 periodo de tarificación 6
          • Identifier: pResTr6
          • Unit: SI
          • Period: INSTANT
          • Storage:
          • Tags: electricity | Meter | PRIME

collectionOrganization

  • Identifier: collectionOrganization
  • Version: 8.0.2.0
  • Description: Specific Datamodel to collected organization info
  • Allowed resource types:
    • organization
  • Categories:
    • organizationCollectedInfo
      • Data streams:
        • Identifier
          • Identifier: organization.identifier
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: organization

provisionOrganization

  • Identifier: provisionOrganization
  • Version: 8.0.1.0
  • Description: Specific Datamodel to provision an organization
  • Allowed resource types:
    • organization
  • Categories:
    • organizationProvisionedInfo
      • Data streams:
        • Prov. Identifier
          • Identifier: provision.organization.identifier
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: organization
        • Prov. Description
          • Identifier: provision.organization.description
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: organization
        • Prov. Country code
          • Identifier: provision.organization.countryCode
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: organization
        • Prov. Lang code
          • Identifier: provision.organization.langCode
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: organization
        • Prov. Timezone
          • Identifier: provision.organization.timezone
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: organization
        • Prov. Domain
          • Identifier: provision.organization.domain
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: organization
        • Map
          • Identifier: provision.organization.mapDefault
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: organization
        • Prov. Plan
          • Identifier: provision.organization.plan
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: organization
        • Prov. Assigned certificates
          • Identifier: provision.organization.onlyAssignedDomainCertificates
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: organization

collectionSubscriber

  • Identifier: collectionSubscriber
  • Version: 8.0.0.0
  • Description: Specific Datamodel to subscriber branch
  • Allowed resource types:
    • entity.device
    • entity.subscriber
  • Categories:
    • subscriberCollectedInfo
      • Data streams:
        • Identifier
          • Identifier: device.communicationModules[].subscriber.identifier
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Specific type
          • Identifier: device.communicationModules[].subscriber.specificType
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • Name
          • Identifier: device.communicationModules[].subscriber.name
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • Description
          • Identifier: device.communicationModules[].subscriber.description
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • Serial number
          • Identifier: device.communicationModules[].subscriber.serialNumber
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • Model
          • Identifier: device.communicationModules[].subscriber.model
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • Software
          • Identifier: device.communicationModules[].subscriber.software
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • Administrative state
          • Identifier: device.communicationModules[].subscriber.administrativeState
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | provision
        • ICC
          • Identifier: device.communicationModules[].subscriber.mobile.icc
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • EIS availableForProfiles
          • Identifier: device.communicationModules[].subscriber.eis.availableForProfiles
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • EIS eid
          • Identifier: device.communicationModules[].subscriber.eis.eid
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • EIS cattpSupport
          • Identifier: device.communicationModules[].subscriber.eis.euiccCapabilities.cattpSupport
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • EIS httpSupport
          • Identifier: device.communicationModules[].subscriber.eis.euiccCapabilities.httpSupport
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • EIS httpVersion
          • Identifier: device.communicationModules[].subscriber.eis.euiccCapabilities.httpVersion
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • EIS remoteProvisioningVersion
          • Identifier: device.communicationModules[].subscriber.eis.euiccCapabilities.remoteProvisioningVersion
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • EIS securePacketVersion
          • Identifier: device.communicationModules[].subscriber.eis.euiccCapabilities.securePacketVersion
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • EIS eumCertificateId
          • Identifier: device.communicationModules[].subscriber.eis.eumCertificateId
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • EIS eumId
          • Identifier: device.communicationModules[].subscriber.eis.eumId
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • EIS isdpLoadfileAid
          • Identifier: device.communicationModules[].subscriber.eis.isdpLoadfileAid
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • EIS isdpModuleAid
          • Identifier: device.communicationModules[].subscriber.eis.isdpModuleAid
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • EIS platformType
          • Identifier: device.communicationModules[].subscriber.eis.platformType
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • EIS platformVersion
          • Identifier: device.communicationModules[].subscriber.eis.platformVersion
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • EIS productionDate
          • Identifier: device.communicationModules[].subscriber.eis.productionDate
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • EIS remainingMemory
          • Identifier: device.communicationModules[].subscriber.eis.remainingMemory
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • EIS signature
          • Identifier: device.communicationModules[].subscriber.eis.signature
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • EIS signatureAlgorithm
          • Identifier: device.communicationModules[].subscriber.eis.signatureAlgorithm
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • EIS smsrId
          • Identifier: device.communicationModules[].subscriber.eis.smsrId
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • EIS lastOperationDate
          • Identifier: device.communicationModules[].subscriber.eis.lastOperationDate
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • EIS lastOperationStatus
          • Identifier: device.communicationModules[].subscriber.eis.lastOperationStatus
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • EIS lastSMTransactionStatus
          • Identifier: device.communicationModules[].subscriber.eis.lastSMTransactionStatus
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • EIS status
          • Identifier: device.communicationModules[].subscriber.eis.status
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • EIS cardGroupId
          • Identifier: device.communicationModules[].subscriber.eis.cardGroupId
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • EIS currentSubscription
          • Identifier: device.communicationModules[].subscriber.eis.currentSubscription
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • EIS profileList
          • Identifier: device.communicationModules[].subscriber.eis.profileList
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • device.communicationModules[].subscriber.alarms
          • Identifier: device.communicationModules[].subscriber.alarms
          • Unit: basicSI
          • Period: INSTANT
          • Storage: NEVER
          • Tags: dmm | collection

provisionSubscriber

  • Identifier: provisionSubscriber
  • Version: 8.0.0.0
  • Description: Specific Datamodel to provision subscriber branch
  • Allowed resource types:
    • entity.device
    • entity.subscriber
  • Categories:
    • subscriberProvisionedInfo
      • Data streams:
        • Prov. Identifier
          • Identifier: provision.device.communicationModules[].subscriber.identifier
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. Specific type
          • Identifier: provision.device.communicationModules[].subscriber.specificType
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. Name
          • Identifier: provision.device.communicationModules[].subscriber.name
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. Description
          • Identifier: provision.device.communicationModules[].subscriber.description
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. Administrative state
          • Identifier: provision.device.communicationModules[].subscriber.administrativeState
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | provision
        • Prov. Serial number
          • Identifier: provision.device.communicationModules[].subscriber.serialNumber
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. Model
          • Identifier: provision.device.communicationModules[].subscriber.model
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. Software
          • Identifier: provision.device.communicationModules[].subscriber.software
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. ICC
          • Identifier: provision.device.communicationModules[].subscriber.mobile.icc
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. EIS availableForProfiles
          • Identifier: provision.device.communicationModules[].subscriber.eis.availableForProfiles
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. EIS eid
          • Identifier: provision.device.communicationModules[].subscriber.eis.eid
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. EIS cattpSupport
          • Identifier: provision.device.communicationModules[].subscriber.eis.euiccCapabilities.cattpSupport
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. EIS httpSupport
          • Identifier: provision.device.communicationModules[].subscriber.eis.euiccCapabilities.httpSupport
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. EIS httpVersion
          • Identifier: provision.device.communicationModules[].subscriber.eis.euiccCapabilities.httpVersion
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. EIS remoteProvisioningVersion
          • Identifier: provision.device.communicationModules[].subscriber.eis.euiccCapabilities.remoteProvisioningVersion
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. EIS securePacketVersion
          • Identifier: provision.device.communicationModules[].subscriber.eis.euiccCapabilities.securePacketVersion
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. EIS eumCertificateId
          • Identifier: provision.device.communicationModules[].subscriber.eis.eumCertificateId
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. EIS eumId
          • Identifier: provision.device.communicationModules[].subscriber.eis.eumId
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. EIS isdpLoadfileAid
          • Identifier: provision.device.communicationModules[].subscriber.eis.isdpLoadfileAid
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. EIS isdpModuleAid
          • Identifier: provision.device.communicationModules[].subscriber.eis.isdpModuleAid
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. EIS platformType
          • Identifier: provision.device.communicationModules[].subscriber.eis.platformType
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. EIS platformVersion
          • Identifier: provision.device.communicationModules[].subscriber.eis.platformVersion
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. EIS productionDate
          • Identifier: provision.device.communicationModules[].subscriber.eis.productionDate
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. EIS remainingMemory
          • Identifier: provision.device.communicationModules[].subscriber.eis.remainingMemory
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. EIS signature
          • Identifier: provision.device.communicationModules[].subscriber.eis.signature
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. EIS signatureAlgorithm
          • Identifier: provision.device.communicationModules[].subscriber.eis.signatureAlgorithm
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. EIS smsrId
          • Identifier: provision.device.communicationModules[].subscriber.eis.smsrId
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. EIS lastOperationDate
          • Identifier: provision.device.communicationModules[].subscriber.eis.lastOperationDate
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. EIS lastOperationStatus
          • Identifier: provision.device.communicationModules[].subscriber.eis.lastOperationStatus
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. EIS lastSMTransactionStatus
          • Identifier: provision.device.communicationModules[].subscriber.eis.lastSMTransactionStatus
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. EIS status
          • Identifier: provision.device.communicationModules[].subscriber.eis.status
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. EIS cardGroupId
          • Identifier: provision.device.communicationModules[].subscriber.eis.cardGroupId
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. EIS currentSubscription
          • Identifier: provision.device.communicationModules[].subscriber.eis.currentSubscription
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. EIS profileList
          • Identifier: provision.device.communicationModules[].subscriber.eis.profileList
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision

collectionSubscription

  • Identifier: collectionSubscription
  • Version: 8.0.21.0
  • Description: Specific Datamodel to subscription branch
  • Allowed resource types:
    • entity.device
    • entity.subscription
  • Categories:
    • subscriptionCollectedInfo
      • Data streams:
        • Identifier
          • Identifier: device.communicationModules[].subscription.identifier
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • Administrative state
          • Identifier: device.communicationModules[].subscription.administrativeState
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | collection
        • Specific type
          • Identifier: device.communicationModules[].subscription.specificType
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • Name
          • Identifier: device.communicationModules[].subscription.name
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • Description
          • Identifier: device.communicationModules[].subscription.description
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • IMSI
          • Identifier: device.communicationModules[].subscription.mobile.imsi
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • Home PLMN
          • Identifier: device.communicationModules[].subscription.mobile.homePlmn
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • Home operator
          • Identifier: device.communicationModules[].subscription.mobile.homeOperator
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • MSISDN
          • Identifier: device.communicationModules[].subscription.mobile.msisdn
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • Voice MSISDN
          • Identifier: device.communicationModules[].subscription.mobile.voice.msisdn
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • Address
          • Identifier: device.communicationModules[].subscription.address
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | collection
        • device.communicationModules[].subscription.alarms
          • Identifier: device.communicationModules[].subscription.alarms
          • Unit: basicSI
          • Period: INSTANT
          • Storage: NEVER
          • Tags: dmm | collection
    • subscriptionNetworkCollectedInfo
      • Data streams:
        • Rat type
          • Identifier: device.communicationModules[].subscription.mobile.ratType
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | mobile
        • VLR
          • Identifier: device.communicationModules[].subscription.mobile.vlr.globalTitle
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | mobile
        • VLR PLMN
          • Identifier: device.communicationModules[].subscription.mobile.vlr.plmn
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | mobile
        • VLR IP
          • Identifier: device.communicationModules[].subscription.mobile.vlr.ipAddress
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | mobile
        • VLR operator
          • Identifier: device.communicationModules[].subscription.mobile.vlr.operatorName
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | mobile
        • VLR country name
          • Identifier: device.communicationModules[].subscription.mobile.vlr.countryName
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | mobile
        • VLR country code
          • Identifier: device.communicationModules[].subscription.mobile.vlr.countryCode
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | mobile
        • MSC
          • Identifier: device.communicationModules[].subscription.mobile.msc.globalTitle
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | mobile
        • MSC PLMN
          • Identifier: device.communicationModules[].subscription.mobile.msc.plmn
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | mobile
        • MSC IP
          • Identifier: device.communicationModules[].subscription.mobile.msc.ipAddress
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | mobile
        • MSC operator
          • Identifier: device.communicationModules[].subscription.mobile.msc.operatorName
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | mobile
        • MSC country name
          • Identifier: device.communicationModules[].subscription.mobile.msc.countryName
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | mobile
        • MSC country code
          • Identifier: device.communicationModules[].subscription.mobile.msc.countryCode
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | mobile
        • SGSN
          • Identifier: device.communicationModules[].subscription.mobile.sgsn.globalTitle
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | mobile
        • SGSN PLMN
          • Identifier: device.communicationModules[].subscription.mobile.sgsn.plmn
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | mobile
        • SGSN IP
          • Identifier: device.communicationModules[].subscription.mobile.sgsn.ipAddress
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | mobile
        • SGSN operator
          • Identifier: device.communicationModules[].subscription.mobile.sgsn.operatorName
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | mobile
        • SGSN country name
          • Identifier: device.communicationModules[].subscription.mobile.sgsn.countryName
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | mobile
        • SGSN country code
          • Identifier: device.communicationModules[].subscription.mobile.sgsn.countryCode
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | mobile
        • GGSN
          • Identifier: device.communicationModules[].subscription.mobile.ggsn.globalTitle
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | mobile
        • GGSN PLMN
          • Identifier: device.communicationModules[].subscription.mobile.ggsn.plmn
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | mobile
        • GGSN IP
          • Identifier: device.communicationModules[].subscription.mobile.ggsn.ipAddress
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | mobile
        • GGSN operator
          • Identifier: device.communicationModules[].subscription.mobile.ggsn.operatorName
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | mobile
        • GGSN country name
          • Identifier: device.communicationModules[].subscription.mobile.ggsn.countryName
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | mobile
        • GGSN country code
          • Identifier: device.communicationModules[].subscription.mobile.ggsn.countryCode
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | mobile
    • subscriptionMobileCellCollectedInfo
      • Data streams:
        • Registered MCC
          • Identifier: device.communicationModules[].subscription.mobile.registeredMcc
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: dmm | mcc
        • Registered MNC
          • Identifier: device.communicationModules[].subscription.mobile.registeredMnc
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: dmm | mnc
        • Registered PLMN
          • Identifier: device.communicationModules[].subscription.mobile.registeredPlmn
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: dmm | plmn
        • LAC
          • Identifier: device.communicationModules[].subscription.mobile.registeredLac
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: dmm | lac
        • Registered operator
          • Identifier: device.communicationModules[].subscription.mobile.registeredOperator
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: dmm | operator
        • ULI cellId
          • Identifier: device.communicationModules[].subscription.mobile.uli.cellId
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: dmm | cell
        • ULI rac
          • Identifier: device.communicationModules[].subscription.mobile.uli.rac
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: dmm | cell
        • ULI eci
          • Identifier: device.communicationModules[].subscription.mobile.uli.eci
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: dmm | cell
        • ULI cgi
          • Identifier: device.communicationModules[].subscription.mobile.uli.cgi
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: dmm | cell
        • ULI cgiLac
          • Identifier: device.communicationModules[].subscription.mobile.uli.cgiLac
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: dmm | cell
        • ULI SAI
          • Identifier: device.communicationModules[].subscription.mobile.uli.sai
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: dmm | cell
        • ULI saiLac
          • Identifier: device.communicationModules[].subscription.mobile.uli.saiLac
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: dmm | cell
        • ULI saiSac
          • Identifier: device.communicationModules[].subscription.mobile.uli.saiSac
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: dmm | cell
        • ULI RAI
          • Identifier: device.communicationModules[].subscription.mobile.uli.rai
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: dmm | cell
        • ULI raiLac
          • Identifier: device.communicationModules[].subscription.mobile.uli.raiLac
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: dmm | cell
        • ULI raiRac
          • Identifier: device.communicationModules[].subscription.mobile.uli.raiRac
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: dmm | cell
        • ULI tai
          • Identifier: device.communicationModules[].subscription.mobile.uli.tai
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: dmm | cell
        • ULI taiTac
          • Identifier: device.communicationModules[].subscription.mobile.uli.taiTac
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: dmm | cell
        • ULI ecgi
          • Identifier: device.communicationModules[].subscription.mobile.uli.ecgi
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: dmm | cell
        • ULI ecgiEci
          • Identifier: device.communicationModules[].subscription.mobile.uli.ecgiEci
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: dmm | cell
        • MR
          • Identifier: device.communicationModules[].subscription.mobile.mr
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: dmm | cell
        • BCCH
          • Identifier: device.communicationModules[].subscription.mobile.bcch
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: dmm | cell
        • Timing advance
          • Identifier: device.communicationModules[].subscription.mobile.timingAdvance
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: dmm | cell
    • subscriptionMobileNetworkSignalCollectedInfo
      • Data streams:
        • Signal strength
          • Identifier: device.communicationModules[].subscription.mobile.signalStrength
          • Unit: basicSI Dbm
          • Period: INSTANT
          • Storage:
          • Tags: dmm | dbm | total
        • Signal strength status
          • Identifier: device.communicationModules[].subscription.mobile.signalStrengthStatus
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: dmm | dbm | status
        • Signal quality
          • Identifier: device.communicationModules[].subscription.mobile.signalQuality
          • Unit: basicSI percentage
          • Period: INSTANT
          • Storage:
          • Tags: dmm | signal | percentage
        • Signal quality status
          • Identifier: device.communicationModules[].subscription.mobile.signalQualityStatus
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: dmm | signal | status
    • subscriptionMobilePresenceCollectedInfo
      • Data streams:
        • GSM presence
          • Identifier: device.communicationModules[].subscription.mobile.presence.gsm
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | presence
        • GPRS presence
          • Identifier: device.communicationModules[].subscription.mobile.presence.gprs
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | presence
        • IP presence
          • Identifier: device.communicationModules[].subscription.presence.ip
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | presence | ip
        • IP RTT presence
          • Identifier: device.communicationModules[].subscription.presence.ipRtt
          • Unit: basicSI milliseconds
          • Period: INSTANT
          • Storage:
          • Tags: dmm | presence | ip
        • Unified presence
          • Identifier: device.communicationModules[].subscription.presence.unifiedPresence
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | presence
    • subscriptionTrafficCollectedInfo
      • Data streams:
        • Sent bytes
          • Identifier: device.communicationModules[].subscription.traffic.sentBytes
          • Unit: basicSI bytes
          • Period: INSTANT
          • Storage:
          • Tags: dmm | traffic
        • Received bytes
          • Identifier: device.communicationModules[].subscription.traffic.receivedBytes
          • Unit: basicSI bytes
          • Period: INSTANT
          • Storage:
          • Tags: dmm | traffic
        • Sent packets
          • Identifier: device.communicationModules[].subscription.traffic.sentPackets
          • Unit: basicSI bytes
          • Period: INSTANT
          • Storage:
          • Tags: dmm | traffic
        • Received packets
          • Identifier: device.communicationModules[].subscription.traffic.receivedPackets
          • Unit: basicSI bytes
          • Period: INSTANT
          • Storage:
          • Tags: dmm | traffic
        • Session
          • Identifier: device.communicationModules[].subscription.session
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: dmm | traffic
        • ICC
          • Identifier: device.communicationModules[].subscription.mobile.icc
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • Radius user name
          • Identifier: device.communicationModules[].subscription.mobile.radius.userName
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: radius | collection
        • Radius user password
          • Identifier: device.communicationModules[].subscription.mobile.radius.userPassword
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: radius | collection
        • Radius frame Ip netmask
          • Identifier: device.communicationModules[].subscription.mobile.radius.framedIpNetmask
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: radius | collection
        • Radius activation
          • Identifier: device.communicationModules[].subscription.mobile.radius.activation
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: radius | collection
    • subscriptionCountersInfo
      • Data streams:
        • Accounting start last day counter by subscription
          • Identifier: device.communicationModules[].subscription.counters.presence.accountingStartLastDay
          • Unit: basicSI bytes
          • Period: CUMULATIVE
          • Storage: NEVER
          • Tags: dmm | counters
        • Total used bytes last day counter by subscription
          • Identifier: device.communicationModules[].subscription.counters.totalBytesLastDay
          • Unit: basicSI bytes
          • Period: CUMULATIVE
          • Storage: NEVER
          • Tags: dmm | counters
        • Total used bytes last month counter by subscription
          • Identifier: device.communicationModules[].subscription.counters.totalBytesLastMonth
          • Unit: basicSI bytes
          • Period: CUMULATIVE
          • Storage: NEVER
          • Tags: dmm | counters
        • Total received bytes last day counter by subscription
          • Identifier: device.communicationModules[].subscription.counters.receivedBytesLastDay
          • Unit: basicSI bytes
          • Period: CUMULATIVE
          • Storage: NEVER
          • Tags: dmm | counters
        • Total received bytes last month counter by subscription
          • Identifier: device.communicationModules[].subscription.counters.receivedBytesLastMonth
          • Unit: basicSI bytes
          • Period: CUMULATIVE
          • Storage: NEVER
          • Tags: dmm | counters
        • Total sent bytes last day counter by subscription
          • Identifier: device.communicationModules[].subscription.counters.sentBytesLastDay
          • Unit: basicSI bytes
          • Period: CUMULATIVE
          • Storage: NEVER
          • Tags: dmm | counters
        • Total sent bytes last month counter by subscription
          • Identifier: device.communicationModules[].subscription.counters.sentBytesLastMonth
          • Unit: basicSI bytes
          • Period: CUMULATIVE
          • Storage: NEVER
          • Tags: dmm | counters
        • Ping OK executions counter
          • Identifier: device.communicationModules[].subscription.counters.presence.pingOKLastDay
          • Unit: basicSI bytes
          • Period: CUMULATIVE
          • Storage: NEVER
          • Tags: dmm | counters
        • Ping non OK executions counter
          • Identifier: device.communicationModules[].subscription.counters.presence.pingNOKLastDay
          • Unit: basicSI bytes
          • Period: CUMULATIVE
          • Storage: NEVER
          • Tags: dmm | integer
        • Consecutive ping non OK executions counter
          • Identifier: device.communicationModules[].subscription.counters.presence.consecutivePingNOK
          • Unit: basicSI
          • Period: CUMULATIVE
          • Storage: NEVER
          • Tags: dmm | counters
        • Percentage ping OK executions counter
          • Identifier: device.communicationModules[].subscription.counters.availabilityLastDay
          • Unit: basicSI
          • Period: CUMULATIVE
          • Storage: NEVER
          • Tags: dmm | counters
        • EIS allocatedMemory
          • Identifier: device.communicationModules[].subscription.eis.allocatedMemory
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • EIS dpId
          • Identifier: device.communicationModules[].subscription.eis.dpId
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • EIS fallback
          • Identifier: device.communicationModules[].subscription.eis.fallback
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • EIS freeMemory
          • Identifier: device.communicationModules[].subscription.eis.freeMemory
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • EIS isdpAid
          • Identifier: device.communicationModules[].subscription.eis.isdpAid
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • EIS profileType
          • Identifier: device.communicationModules[].subscription.eis.profileType
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection
        • EIS status
          • Identifier: device.communicationModules[].subscription.eis.status
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | collection

provisionSubscription

  • Identifier: provisionSubscription
  • Version: 8.0.21.0
  • Description: Specific Datamodel to provision subscription branch
  • Allowed resource types:
    • entity.device
    • entity.subscription
  • Categories:
    • subscriptionProvisionedInfo
      • Data streams:
        • Prov. Identifier
          • Identifier: provision.device.communicationModules[].subscription.identifier
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. Specific type
          • Identifier: provision.device.communicationModules[].subscription.specificType
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. Name
          • Identifier: provision.device.communicationModules[].subscription.name
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. Description
          • Identifier: provision.device.communicationModules[].subscription.description
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. Administrative state
          • Identifier: provision.device.communicationModules[].subscription.administrativeState
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | provision
        • Prov. Ticket ID
          • Identifier: provision.device.communicationModules[].subscription.ticketId
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | provision
        • Prov. IMSI
          • Identifier: provision.device.communicationModules[].subscription.mobile.imsi
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. MSISDN
          • Identifier: provision.device.communicationModules[].subscription.mobile.msisdn
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. Voice MSISDN
          • Identifier: provision.device.communicationModules[].subscription.mobile.voice.msisdn
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. Address
          • Identifier: provision.device.communicationModules[].subscription.address
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | provision
        • Prov. Home operator
          • Identifier: provision.device.communicationModules[].subscription.mobile.homeOperator
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: dmm | provision
        • Prov. Registered operator
          • Identifier: provision.device.communicationModules[].subscription.mobile.registeredOperator
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. ICC
          • Identifier: provision.device.communicationModules[].subscription.mobile.icc
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. Radius user name
          • Identifier: provision.device.communicationModules[].subscription.mobile.radius.userName
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: radius | collection
        • Prov. Radius user password
          • Identifier: provision.device.communicationModules[].subscription.mobile.radius.userPassword
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: radius | collection
        • Prov. Radius frame Ip netmask
          • Identifier: provision.device.communicationModules[].subscription.mobile.radius.framedIpNetmask
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: radius | collection
        • Prov. EIS allocatedMemory
          • Identifier: provision.device.communicationModules[].subscription.eis.allocatedMemory
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. EIS dpId
          • Identifier: provision.device.communicationModules[].subscription.eis.dpId
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. EIS fallback
          • Identifier: provision.device.communicationModules[].subscription.eis.fallback
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. EIS freeMemory
          • Identifier: provision.device.communicationModules[].subscription.eis.freeMemory
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. EIS isdpAid
          • Identifier: provision.device.communicationModules[].subscription.eis.isdpAid
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. EIS profileType
          • Identifier: provision.device.communicationModules[].subscription.eis.profileType
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision
        • Prov. EIS status
          • Identifier: provision.device.communicationModules[].subscription.eis.status
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: dmm | provision

ticket

  • Identifier: ticket
  • Version: 8.0.21.0
  • Description: Specific Datamodel to provision a ticket
  • Allowed resource types:
    • ticket
  • Categories:
    • ticketInfo
      • Data streams:
        • Identifier
          • Identifier: provision.ticket.identifier
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: ticket
        • Name
          • Identifier: provision.ticket.name
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: ticket
        • Description
          • Identifier: provision.ticket.description
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: ticket
        • Location
          • Identifier: provision.ticket.location
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: dmm | provision
        • Label
          • Identifier: provision.ticket.label
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: ticket
        • Type
          • Identifier: provision.ticket.type
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: ticket
        • Severity
          • Identifier: provision.ticket.severity
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: ticket
        • Priority
          • Identifier: provision.ticket.priority
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: ticket
        • Reporter
          • Identifier: provision.ticket.reporter
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: ticket
        • Owner
          • Identifier: provision.ticket.owner
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: ticket
        • Assignee
          • Identifier: provision.ticket.assignee
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: ticket
        • Status
          • Identifier: provision.ticket.status
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: ticket
        • Specific type
          • Identifier: provision.ticket.specificType
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: ticket
        • Section
          • Identifier: provision.ticket.section
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: ticket
        • Entity
          • Identifier: provision.ticket.entity
          • Unit: basicSI
          • Period: PULSE
          • Storage:
          • Tags: ticket
        • Creation date
          • Identifier: provision.ticket.creationDate
          • Unit: basicSI
          • Period: INSTANT
          • Storage: NEVER
          • Tags: ticket
        • Reporter date
          • Identifier: provision.ticket.reporterDate
          • Unit: basicSI
          • Period: INSTANT
          • Storage: NEVER
          • Tags: ticket
        • Assigned date
          • Identifier: provision.ticket.assignedDate
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: ticket
        • Answered date
          • Identifier: provision.ticket.answeredDate
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: ticket
        • Updated date
          • Identifier: provision.ticket.updatedDate
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: ticket
        • Restoration date
          • Identifier: provision.ticket.restorationDate
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: ticket
        • Resolution date
          • Identifier: provision.ticket.resolutionDate
          • Unit: basicSI
          • Period: INSTANT
          • Storage:
          • Tags: ticket
        • Closed date
          • Identifier: provision.ticket.closedDate
          • Unit: basicSI
          • Period: INSTANT
          • Storage: NEVER
          • Tags: ticket
        • Parent ticket
          • Identifier: provision.ticket.parentTicket
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: ticket
        • Identifier
          • Identifier: provision.ticket.isOnSLA
          • Unit: basicSI
          • Period: PULSE
          • Storage: NEVER
          • Tags: ticket
        • Assignation time
          • Identifier: provision.ticket.assignationTime
          • Unit: basicSI
          • Period: INSTANT
          • Storage: NEVER
          • Tags: ticket
        • Answering time
          • Identifier: provision.ticket.answeringTime
          • Unit: basicSI
          • Period: INSTANT
          • Storage: NEVER
          • Tags: ticket
        • Restoration time
          • Identifier: provision.ticket.restorationTime
          • Unit: basicSI
          • Period: INSTANT
          • Storage: NEVER
          • Tags: ticket
        • Resolution time
          • Identifier: provision.ticket.resolutionTime
          • Unit: basicSI
          • Period: INSTANT
          • Storage: NEVER
          • Tags: ticket
        • Confirmation time
          • Identifier: provision.ticket.confirmationTime
          • Unit: basicSI
          • Period: INSTANT
          • Storage: NEVER
          • Tags: ticket
        • Closed time
          • Identifier: provision.ticket.closedTime
          • Unit: basicSI
          • Period: INSTANT
          • Storage: NEVER
          • Tags: ticket

Data streams default schemas

It is possible to utilise the predefined types (JSON schemas) for custom OpenGate data streams.

Tags

Tag entity object structure

In certain instances, it may be desirable to execute the same operation on a multitude of devices simultaneously.

The question then arises as to how one might select all the target devices. In this context, the answer lies in the use of tags.

It is possible to tag all the devices and other entities that are to be included in the operation, and then to execute it. The tag is employed as the target. This section will demonstrate the process of creating tags and applying them to OpenGate entities. The provisioning API.

Further information on the utilisation of tags can be found in the operations section.

Comprehensive API actions

Creating a tag

There are two alternatives to include entities in a tag:

  • Choose a specific list of entities
  • Using a previously created tag.
Warning

In regard to operational issues, the service is constrained by a limitation in the array size of the JSON. The aforementioned limit may be configured at the administrative level. The default limit is 5,000 elements in the array. It is recommended that you consult with your administrator to ascertain the configured limit. In order to ascertain the configured limit, it is necessary to consult with the administrator.

In the event that a large number of entities must be operated upon, the recommended course of action is to utilise the updating function. A PUT operation may be employed to append new entities to the target, taking the aforementioned limit into accoun

It is not possible for a user to include entities that are not in the same workgroup as themselves in the label that they create.

API specification

Tickets

Introduction

A ticket is a resource type on the platform. It allows users to register and track on-field deployments, incidents or requests (required needs).

Comprehensive API actions

Updating a ticket

Please note that the following fields cannot be modified:

  • identifier
  • type
  • reporter
  • entity: If the ticket does not contain the entity, it can be updated.

Please be advised that the dates will be updated by the platform internally, depending on the status of the ticket. Please note that these dates cannot be modified.

  • creationDate
  • assignedDate
  • answeredDate
  • updatedDate
  • restorationDate
  • resolutionDate
  • closedDate

Searching tickets

The OpenGate API query enables the retrieval of the list of tickets.

The results can be obtained in two different formats, as detailed in the HTTP Header Options:

  • JSON Format (default)
  • CSV Format

API specification

Manufacturer & Model Catalog

OpenGate has its own hardware manufacturers and models catalog, available for being queried by users. You are allowed to use this information to extend your organization’s catalog.

Limited access API

Limited access

The provision API of this feature is only available to root profile, on the other hand, anyone can use the searching API. Ask your administrator for proper user role profiling.

Catalog Provision

API specification

Search the global hardware catalog (manufacturers and models) and get a summary count of results.

Subsections of Manufacturer & Model Catalog

Manufacturers catalog API Spec

Introduction

The application programming interface (API) permits the provision of hardware manufacturers as a foundation for organisational catalogues. Images can be associated with the manufacturers as logos or documentation.

Manufacturer Media Files

A media file is defined as a file that is associated with a particular manufacturer, typically through the use of a manufacturer logo. There is no limit to the number of files that can be added, and the process is straightforward. For further details on the structure of a media object, please refer to the relevant schemas.

Comprehensive API actions

Reading a single media file element

The process of downloading a previously uploaded media file is a relatively straightforward one. In order to do so, it is simply necessary to send the same GET request that was used to extract the media file meta-information, with the addition of a format parameter equal to raw.

Updating a manufacturer

It is possible to update all manufacturer fields, with the exception of the identifier field.

API specification

Models catalog API Spec

Introduction

The application programming interface (API) permits the provision of hardware manufacturers as a foundation for organisational catalogues. Images can be associated with the manufacturers as logos or documentation.

Comprehensive API actions

mediaTypes

Reading a single media file element

The process of downloading a previously uploaded media file is a relatively straightforward one. In order to do so, it is simply necessary to send the same GET request that was used to extract the media file meta-information, with the addition of a format parameter equal to raw.

Models

Updating a model

With the exception of the Identifier field, all model fields may be updated.

API specification

Usage plans

Introduction

The OpenGate API query enables the retrieval of the available plans that have been provisioned under the domain of the user who has initiated the request.

API specification

Certificates

Introduction

The application programming interface (API) enables the administration of security certificates, which may be utilised for a variety of purposes, including file signing validation, communication encryption, access control, and others.

Supported File Types

  • type: PEM
  • mime-type: x-pem-file
  • file extension: .pem

How trustChains parameter works

The trustChains parameter represents an array of trust chains. The initial array comprises a series of string arrays, arranged from left to right, which collectively represent the path traversed by a certificate’s parents from the root or self-signed certificate to the certificate’s immediate parent.

To illustrate, if a certificate C is signed by a certificate B, which in turn is signed by a certificate A, the path will be A→B→C. The trustChain will contain the identifier of the certificate A in the initial position of the array, followed by the identifier of the certificate B in the subsequent position. Please refer to the example below, which assumes that:

  • Identifier of A: 1427353136
  • Identifier of B: 1427353426

trustChains parameter single path example “trustChains” : [ [ “1427353136”, “1427353426” ] ]

In the aforementioned example, if the same C certificate is present but with an alternative trust chain, namely A→B2→C,

  • Identifier of B2: 1427353447

trustChains parameter multiple path example “trustChains” : [ [ “1427353136”, “1427353426” ], [ “1427353136”, “1427353447” ] ]

Comprehensive API actions

It is possible for devices to establish a connection with OpenGate through the utilisation of an authentication system based on a Public Key Infrastructure (PKI). The Certificate Provision API facilitates the administration of certificates.

Creating a certificate

Warning

It is necessary to upload the files (JSON request and certificate) with the content-type header as multipart/form-data. For further information regarding supported file types, please refer to the Supported File Types section.

In order to create new certificates, it is first necessary to be aware of the following tips:

  • A user is permitted to upload a certificate to the platform, which may be in their own domain or in any of the domains with a low hierarchy that are managed by the user.
  • A certificate can only be signed by a certificate uploaded to the platform with the usage code CERT_SIGN. Furthermore, the aforementioned certificate must be in the same domain or in a domain with a visible upper hierarchy.
  • It is permissible to upload the same certificate to the platform on numerous occasions, provided that the identification data is different on each occasion.
  • In the event of a change to the domain of a certificate, the trust chain will be updated in a manner that is consistent with the principle of least privilege. This entails the inclusion of only those certificates that are associated with visible domains within the new domain.

Reading a certificate

A user is only permitted to access the certificates in their possession.

Deleting a certificate

A user is only permitted to remove certificates in respect of which they are the owner.

Searching certificates

Fetch parameter

The fetch parameter in the URL request, /north/v80/search/certificates?fetch={value}, enables the retrieval of different response objects. The value of this parameter can be any of the following:

  • 0: In the absence of the aforementioned parameter, the default value is as stated. The result is delineated in the section pertaining to the Certificate object structure.

  • 1: A comprehensive account of the data pertaining to the certificates exhibited in the “trust chains” object, inclusive of the “entities” object.

Visibility parameter

The utilisation of the visibility parameter within the URL request, /north/v80/search/certificates?visibility={value}, enables the retrieval of disparate response objects. The value of the parameter, {value}, can be:

  • assignable: In this instance, the relevant certificates will be issued, which can then be assigned to domains, channels and devices. It should be noted that these certificates are associated with the user’s domain or, where applicable, the user’s domain or domains with a visible upper hierarchy.

  • administrable: In the absence of the parameter, the default value is returned. Consequently, the user will receive the certificates that can be administered, that is to say, the certificates that can be managed, including the option to update or delete them. The certificate in question belongs to the user’s domain or to domains with a low hierarchy managed by the user.

Note

It is anticipated that the option with a summary will be available in future versions.

API specification

Subsections of Mobile operators

APN

Limited access

This feature is only available to root and super_admin_domain profiles. Ask your administrator for proper user role profiling.

Introduction

An APN (Access Point Name) functions as a conduit between a mobile network and the Internet. The APN entity stores information pertaining to the access point names of M2M networks, which devices utilise to establish a connection with IoT applications.

API specification

GGSN

Limited access

This feature is only available to root and super_admin_domain profiles. Ask your administrator for proper user role profiling.

Introduction

The OpenGate platform has the capacity to receive information regarding the operational status of M2M communications networks from either the Remote Access Servers or delegated Radius Servers.

These diverse types of nodes are able to relay Radius information to the platform, specifically Radius Accounting packets.

GGSN - RADIUS clients

Gateway GPRS support nodes are integral components of the mobile operator’s network, possessing the capability to forward RADIUS requests.

API specification

Data retrieval

Everything OpenGate stores about your fleet is queryable through one consistent mechanism: POST a JSON query, get rows back. There is no query string to assemble and no SQL to learn — the resource lives in the URL, and the conditions live in a JSON body.

How a query is built

flowchart LR
    URL["<b>The URL</b><br>what you are querying<br>/north/v80/search/devices"] --> REQ(["POST"])
    BODY["<b>The JSON body</b><br>which rows you want<br>filter, select, sort, group, limit"] --> REQ
    REQ --> RES["<b>Rows</b><br>JSON or CSV"]

Two things to learn, and this section is organized around exactly that:

  1. What you can query — the index of every search endpoint, so you know which URL to POST to.
  2. Data Lake — the query language: filter, select, sort, group and limit.

Then, because three kinds of storage answer slightly differently, Query dialects lays their differences side by side.

Your first query in 60 seconds

Ask for your devices. No filter, no options — just the resource:

curl --request POST \
     --header "X-ApiKey: <your-api-key>" \
     --header "Content-Type: application/json" \
     --data '{}' \
     https://api.opengate.es/north/v80/search/devices

You get an array named after the resource. Each row is a flat map of dotted field paths, and each value is wrapped in _value._current.value — the same shape the platform uses to hold a current value and its metadata:

{
  "devices": [
    {
      "provision.administration.identifier": {
        "_value": { "_current": { "value": "device_battery_id" } }
      },
      "provision.administration.channel": {
        "_value": { "_current": { "value": "battery_channel" } }
      },
      "provision.device.location": {
        "_value": { "_current": { "value": {
          "position": { "type": "Point", "coordinates": [-3.7028, 40.41675] },
          "postal": "28013"
        } } }
      }
    }
  ],
  "page": { "number": 1 }
}

Those dotted paths are also the field names you filter and sort on. Narrow the query with a filter tree and page it with limit:

{
  "filter": {
    "and": [
      { "like": { "provision.device.administrativeState": "NORMAL" } },
      { "like": { "provision.device.communicationModules[].mobile.imei": "351873000102290" } }
    ]
  },
  "limit": { "start": 1, "size": 50 }
}
Discovering field names

Run the query with an empty body first. The paths you see in the response are exactly the paths you can filter, sort and select on — which is the fastest way to learn any resource’s fields.

Swap devices in the URL for datapoints, entities/alarms or any resource from What you can query, and the same body shape applies — only the field names change.

Reading the answer

You want Use Where
Rows The search endpoint Data Lake
How many, not which The same endpoint with /summary Summary
Only some fields select Selecting
Rows in pages limit Pagination
Rows grouped and aggregated group Grouping
A CSV file instead of JSON An HTTP header option Query dialects

What each store is for

Store Holds Query it when
Data streams The current value of each measurement You want the latest reading, not the history
Alarms Alarms raised on entities You are monitoring what went wrong
Time series Values pre-aggregated into fixed time buckets per device You want history at scale: hourly or daily aggregates already computed
Data sets A tabular projection of chosen data streams You want a flat table, typically to export as CSV
Notebook scheduler Notebooks run unattended, once or on a schedule Your analysis is code, not a query
Data points Every raw value a device ever sent Deprecated. Superseded by time series

Subsections of Data retrieval

What you can query

Every query in OpenGate is a POST to a URL that names what you are querying, with a JSON body that says which rows you want. This page is the index of that first half: find your resource, take the URL, and write the body using the query language.

The URL pattern

POST https://api.opengate.es/north/v80/search/<resource>

That covers most resources, which are global or scoped by your API key. Two families depart from it, and knowing which one you are in saves a lot of guessing.

Time series and data sets — you query one named store, so the organization and its identifier are part of the URL:

POST /north/v80/timeseries/provision/organizations/{organization}/{identifier}/data
POST /north/v80/datasets/provision/organizations/{organization}/{identifier}/data

Operations — note the missing north prefix, which the operations service predates:

POST /v80/search/jobs

Three more resources invert the shape into /<resource>/search: rules, provision processors and operation types.

The /summary variant

Most search endpoints have a twin ending in /summary that returns aggregated counters instead of rows. Same URL, same body, different answer: use it when you want how many, not which ones. See Summary. Endpoints offering it are marked below.

Paths in the tables below

Paths are shown relative to /north/v80, except in the operations table, where they are relative to /v80. A + in the Summary column means the endpoint also has a /summary twin. {org} is the organization name and {id} the identifier of the time series or data set.

Collected data

What the devices have sent you.

To query POST to Summary Documented in
Current data stream values search/datastreams Data streams
Historical data points — deprecated search/datapoints Data points
All raised alarms search/entities/alarms + Alarms
Alarms on devices search/entities/devices/alarms + Alarms
Alarms on subscriptions search/entities/subscriptions/alarms + Alarms
Data of one time series timeseries/provision/organizations/{org}/{id}/data Time series
A time series aggregated per device timeseries/provision/organizations/{org}/{id}/dataset Time series
A time series as a Parquet export timeseries/provision/organizations/{org}/{id}/export Time series
Data of one data set datasets/provision/organizations/{org}/{id}/data Data sets
The data set catalog search/catalog/datasets Data sets

Entities and provisioning

What you have registered on the platform.

To query POST to Summary Documented in
Any entity, whatever its type search/entities + Entities
Devices search/devices + Devices
Assets search/assets + Assets
Subscribers search/subscribers + Subscribers
Subscriptions search/subscriptions + Subscriptions
Channels search/channels + Channels
Organizations search/organizations + Organizations
Work groups search/workgroups + Work groups
Users search/users + Users
Geo-areas search/areas Geo-areas
Tickets search/tickets + Tickets
Data models search/datamodels Data models
Software and configuration bundles search/bundles Bundles
Certificates search/certificates Certificates
Hardware catalog search/catalog/hardwares + Hardware catalog
Mobile operators catalog search/catalog/operators Operators
Rules rules/search Rules
Provision processors provisionProcessors/bulk/search Provision functions
Asynchronous bulk requests search/bulk/async Bulk

Operations

What you have asked the devices to do. Note the missing north prefix.

To query POST to Summary Documented in
Jobs search/jobs + Jobs
Tasks search/tasks Tasks
Operations on devices search/entities/devices/operations + Jobs
Operations on subscribers search/entities/subscribers/operations + Jobs
Operations on subscriptions search/entities/subscriptions/operations + Jobs
Closed operations history search/entities/operations/history + Jobs
Operation types operationTypes/search Operation types

Which fields can I filter on?

The clause syntax is the same everywhere, but the field names depend on the resource. They are dotted paths, and entity searches expose two families of them:

Field family Example Holds
provision.* provision.device.administrativeState Provisioned configuration
<entity>.* device.serialNumber Entity attributes, including collected ones
<resource>.* datapoints.datastreamId, jobs.report.summary.status The fields of a non-entity resource
A column name Prov Identifier Data sets and time series, where you define the columns yourself

Arrays are addressed with [], optionally indexed: provision.device.communicationModules[].mobile.imei.

Each resource’s filterable fields are listed in its own API specification, rendered on the page named in the tables above. The fastest shortcut, though, is to run the query with an empty body {} and read the paths off the response: those are exactly the paths you can filter, sort and select on.

Data Lake

Searching data with OpenGate API

The searching API lets you retrieve provisioned and collected information from the entities registered on the platform.

Using search API, you can manage many situations in which you need to get information, collected by OpenGate, about your remote devices.

Some examples of questions you can answer using the searching API are:

  • Where is my lost truck?
  • Is my vending machine connected to Internet?
  • What is the software version of this smart meter which is rebooting all the time?
  • How is the signal strength of this weather station which is off-line most of the time?
  • What are the latest operations launched over different devices and their current status?
  • What are the latest raised alarms associated with my in-field resources?
  • What is the latest value and history of different sensors and machine parameters?

Searching Features

Where are the FROM and WHERE?

Well, if you’re still thinking in SQL, then you’ll expect to find the word FROM anywhere. Remember, OpenGate exposes its API through a REST interface, so in this case the word FROM is in the URL suffix.

That suffix is the resource you are querying, and every available one is listed in What you can query. The WHERE — and the ORDER BY, the SELECT and the GROUP BY — is the JSON body described below.

In all response cases, you must POST a valid JSON query and you’ll get an array with the matched specific resources. The query could have next main objects:

  • filter: Allows to select the resources that meets with desired information, see Filtering
  • limit: Allows paginating the response, see Pagination
  • sort: Allows sorting the results, see Sorting
  • select: Allows selecting only the parameters you need, see Selecting
  • group: Allows grouping the results, see Grouping
{
  "filter": {}, // filter document omitted
  "limit": {}, // limit document omitted
  "sort": {}, // sort document omitted
  "select": {}, // select document omitted
  "group": {} // group document omitted
}

Procedure

Searching in OpenGate platform is pretty easy. You have to send a HTTP request to the API using the POST method, the prefix always is /north/v80/search. Optionally you can attach a JSON file (in the HTTP body) if you need to use paging, sorting, selecting, grouping or filtering features.

You can use the URL above for searching information. So for the impatient, let’s suppose you’re trying to search over your previously provisioned device list, and you’re thinking in a SQL WHERE clause like that:

name like 'device_name' AND (
    serialNumber like '82A75D494B0EBF7A95587285AE78E83F' OR
    serialNumber like '08D83B1864A1F9CFED76DAF426EB04D7')

in this case you must use https://api.opengate.es/north/v80/search/devices URL and POST a JSON payload like that:

{
  "filter": {
    "and": [
      {
        "like": {
          "device.name": "device_name"
        }
      },
      {
        "or": [
          {
            "like": {
              "device.serialNumber": "82A75D494B0EBF7A95587285AE78E83F"
            }
          },
          {
            "like": {
              "device.serialNumber": "08D83B1864A1F9CFED76DAF426EB04D7"
            }
          }
        ]
      }
    ]
  },
  "limit": {
    "start": 26,
    "size": 50
  }
}

Requesting with curl:

curl --request POST \
     --data-binary @search-query.json \
     --header "X-ApiKey: YOUR_API_KEY_HERE" \
     --verbose \
     https://[your_opengate_address]/north/v80/search/devices \
     -H "Content-type: application/json"

Then you’ll receive the device list matching with your query, the response body should be something like that.

{
  "devices": [
    {}, // device body omitted
    {}, // device body omitted
    // a number of other devices
    {}
  ]
}

Where to go next

The clauses above are documented one page each, below. Two things live outside this section:

  • Which URL to POST to: What you can query indexes every search endpoint.
  • Where the clauses behave differently: time series and data sets accept the same syntax with stricter rules and a different response shape. The differences are collected in Query dialects.

Subsections of Data Lake

Filtering

The search API uses the following filtering options to facilitate the search and allow to perform a wide range of consultations.

Several techniques solve the filtering issue when you’re querying over a RESTful interface. For example, you can use standard HTTP parameters to add filtering capabilities to your query. It’s pretty simple but doesn’t cover complex needs. We require a SQL-like approach, with typical operators like AND, OR, EQUAL, NOT EQUAL, etc. OpenGate allows you to filter your queries by sending a POST request to a specific URI. In the POST request, you must send a JSON document with a fashionable DSL structure. It is a command pattern approach in contrast with the entity/collection pattern used in the provisioning API.

Filtering operators

Filtering comparison operator list

  • eq: Equals.
  • neq: Not equals.
  • like: Regex pattern like.
  • gt: Greater than.
  • lt: Lower than.
  • gte: Greater than or equals.
  • lte: Lower than or equals.
  • in[]: Included in a concrete group.
  • nin[]: Not included in a concrete group.
  • exists: Exists.
  • within: Included in an areas.geometry GeoJson (exclusive for Area search).
See supported identifiers for existing comparison operator.
  • asset: identifier
  • channel: identifier
  • device:
    • identifier
    • serialNumber
  • device.communicationModules[]:
    • identifier
    • mobile.imei
  • device.communicationModules[].subscriber:
    • identifier
  • device.communicationModules[].subscription:
    • identifier
    • address
    • mobile.imsi
    • mobile.msisdn
    • mobile.icc
    • presence.ipRtt
    • presence.unifiedPresence
  • entity:
    • areas
    • location
  • organization: identifier
  • provision.asset:
    • identifier
    • location
  • provision.device:
    • identifier
    • location
  • provision.device.communicationModules[]: identifier
  • provision.device.communicationModules[].subscriber: identifier
  • provision.device.communicationModules[].subscription:
    • identifier
    • address
    • mobile
    • imsi
    • mobile
    • msisdn
    • mobile.icc
  • provision.organization:
    • identifier
    • plan
  • provision.ticket:
    • identifier
    • location
    • owner
    • assignee
    • specificType
    • section
    • entity
    • assignedDate
    • answeredDate
    • updatedDate
    • restorationDate
    • resolutionDate
    • closedDate
    • parentTicket

Filtering logical operators list

  • and[]: And
  • or[]: Or

How to use filters

Let’s suppose we want to filter devices with device.operationalStatus equals to NORMAL and with device.communicationModules[].mobile.imei starting with 351873000102290.

If we were dealing with a SQL database we’d write the following SQL sentence:

SELECT * FROM device
WHERE device.operationalStatus LIKE 'NORMAL'
AND device.communicationModules[].mobile.imei LIKE '351873000102290'
Note

Remember, you can use all the data streams defined in the default data models and your own data streams in the WHERE clause.

Translating the previous SQL sentence to OpenGate searching API we’ll have:

{
  "filter": {
    "and": [
      {
        "like": {
          "provision.device.administrativeState": "NORMAL"
        }
      },
      {
        // The result will contain all devices with collected operational Status that
        // contains NORMAL and are related with communications modules with collected
        // imei containing 351873000102290
        "like": {
          "provision.device.communicationModules[].mobile.imei": "351873000102290"
        }
      }
    ]
  }
}

The result will contain all devices with collected operational Status that contains NORMAL and are related to communications modules with collected imei containing 351873000102290.

Another example comparing SQL to JSON, searching all devices except the one with serialNumber equal to 82A75D494B0EBF7A95587285AE78E83F:

SELECT * FROM device WHERE serialNumber <> '82A75D494B0EBF7A95587285AE78E83F'
/north/v80/search/devices
{
  "filter": {
    "neq": { "device.serialNumber": "82A75D494B0EBF7A95587285AE78E83F" }
  },
  "limit": {
    "start": 2
  }
}

More filtering examples

Click on any of the following links to expand the contents.

Searching using in and nin operators like an aggregation of ids
{
  "filter": {
    "and": [
      { "in": { "device.name": ["device_1", "device_2"] } },
      { "nin": { "device.description": ["device default description"] } }
    ]
  },
  "limit": {
    "start": 26,
    "size": 50
  }
}
Searching using the tag attribute
{
  "filter": {
    "eq": { "tag": "my_sticky_tag" }
  },
  "limit": {
    "start": 26,
    "size": 50
  }
}
Searching for collected hardware fields
{
  "filter": {
    "and": [
      { "like": { "device.model": "EF5" } },
      { "exists": { "device.identifier": true } }
    ]
  },
  "limit": {
    "start": 1,
    "size": 10
  }
}
Searching for software field (device whose software has this regex chain)
{
  "filter": {
    "like": { "device.software": "1.0" }
  },
  "limit": {
    "start": 1,
    "size": 10
  }
}
Retrieve all the operations in the catalog applicable to the Subscription & Asset entities
{
  "filter": {
    "in": { "operationEntityType": ["SUBSCRIPTION", "ASSET"] }
  },
  "limit": {
    "start": 1,
    "size": 10
  }
}
Searching for device alarms, /north/v80/search/entities/devices/alarms
{
  "filter": {
    "in": { "device.name": ["DEVICE22"] }
  },
  "limit": {
    "start": 1,
    "size": 10
  }
}
Searching for a particular data of a complex value
{
  "filter": {
    "like": {
      "provision.device.location._current.value.postal": "41015"
    }
  }
}

Selecting

By default, the search response includes all the data streams of the searched entities. You can retrieve only the information you need using the select sub-document in the search JSON.

The select sub-document can be used only on entity searching and must not be empty.

You can also use this sub-document when you search for information in CSV format.

Warning

If the size of the CSV file exceeds 18MB, you must paginate your searchings using the following parameters as HTTP headers:

  • page: It sets the CSV page you want.
  • size: It sets the number of rows you want in the CSV.

If the select clause isn’t in the filter, the behavior is the following:

  • In JSON format, the response will contain all the data streams collected or provisioned in the devices you are searching.
  • In CSV format, the search API raises an error in the response, asking for the select clause.

As described above, any data stream of the default data models or data models defined by the user can be used as select fields.

The order to apply the filters is securitization and next the following fields whenever there are resourceType, sort, filter, select (the data streams to show)

Select JSON object

  • select[]: Array of parameters to be selected.

    • name: String. Data stream name in the default or user-defined data models.

    • fields[]: Array of strings with the name of the fields to be retrieved.

      The possible values are: (See current object attributes table for field description):

      • value
      • date
      • at
      • from
      • tags
      • feedId
      • scoring.performance
      • scoring.qrating
      • provType
      • value.simplexAttribute: where simplexAttribute is an attribute of the complex object. For example, the provision.device.location is a complex data stream. If you need only de postal code, the value would be value.postal
    • alias: String. Shortname replaces the parameter’s full name when a CSV format is required. Example:

      • Using “alias”=“imei”
      • The device.communicationModules[].mobile.imei becomes imei in the CSV header

      The complete data stream name in the CSV header will appear if this field doesn’t exist. The CSV format shows this field, but the JSON format ignores it.

Select examples

Here’s how to search devices with a filter with a select clause

The following snippet shows the request using curl:

curl --request POST \
     --data-binary @subscription.json \
     --header "X-ApiKey: YOUR_API_KEY_HERE" \
     --verbose \
     https://[your_opengate_address]/north/v80/search/devices \
     -H "Content-type: application/json"

You include the filter with the select clause in the request’s body.

Filter using predefined device fields

{
  "select": [
    {
      "name": "provision.device.identifier",
      "fields": [
        {
          "field": "value",
          "alias": "id"
        },
        {
          "field": "date",
          "alias": "date"
        }
      ]
    }
  ]
}

Filter obtaining a field of a complex value

{
  "select": [
    {
      "name": "provision.device.location",
      "fields": [
        {
          "field": "value.postal",
          "alias": "Postal code"
        }
      ]
    }
  ]
}

Depending on the parameter header, the response can be in two different formats, see HTTP Header Options:

  • JSON Format (Default)
  • CSV Format

Response to the filter in JSON format example

{
  "devices": [
    {
      "id": "bca8cbbb-b151-442b-8b0d-96ed77789c45",
      "device": {
        "operationalStatus": {
          "current": {
            "value": "NORMAL",
            "date": "2017-02-02T09:05:58Z",
            "performance": 75
          }
        },
        "communicationsModules": [
          {
            "identifier": "351873000102290",
            "mobile": {
              "imei": {
                "current": {
                  "value": "351873000102290",
                  "date": "2017-02-02T09:05:58Z"
                }
              }
            }
          }
        ]
      },
      "health": {
        "heart": {
          "rate": {
            "current": {
              "value": 60,
              "date": "2017-02-02T09:05:58Z",
              "performance": 78
            }
          }
        }
      }
    }
  ]
}

Response to the Filter in CSV format example

device.operationalStatus.current.value;device.operationalStatus.current.updated;device.operationalStatus.current.performance;imei.current.value;imei.current.updated;imei.current.performance;rate.current.value;rate.current.updated;rate.current.performance;
"NORMAL";"2017-02-02T09:05:58Z";75;"351873000102290";"2017-02-02T09:05:58Z";;60;"2017-02-02T09:05:58Z";78

Sorting

The searching API allows ordering of the results. You can sort your search results, including an order object to the JSON.

Quick sort example

{
  "filter": {},
  "sort": {
    // Array of ordering parameters
    "parameters": [
      {
        // Name of parameter defined in the Default Datamodels
        "name": "provision.administration.identifier",
        // Enumeration string with ordering type. Valid values are:
        // - ASCENDING
        // - DESCENDING
        "type": "ASCENDING"
      }
    ]
  }
}

Grouping

Thanks to the group keyword in the search JSON, it is possible to group by some parameters of the default data models. This keyword is optional.

Quick grouping example:

{
  "filter": {},
  // Group sub-document
  "group": {
    // List of data streams to group by
    "parameters": [
      {
        "name": "provision.device.model"
      }
    ]
  }
}
List of data streams with grouping support
  • All enum values
  • device.model
  • device.software
  • device.communicationModules[].model
  • device.communicationModules[].software
  • device.communicationModules[].subscriber.model
  • device.communicationModules[].subscriber.software
  • device.communicationModules[].subscription.mobile.homePlmn
  • device.communicationModules[].subscription.mobile.homeOperator
  • device.communicationModules[].subscription.mobile.vlr.plmn
  • device.communicationModules[].subscription.mobile.vlr.operatorName
  • device.communicationModules[].subscription.mobile.vlr.countryName
  • device.communicationModules[].subscription.mobile.vlr.countryCode
  • device.communicationModules[].subscription.mobile.msc.plmn
  • device.communicationModules[].subscription.mobile.msc.operatorName
  • device.communicationModules[].subscription.mobile.msc.countryName
  • device.communicationModules[].subscription.mobile.msc.countryCode
  • device.communicationModules[].subscription.mobile.sgsn.plmnd
  • device.communicationModules[].subscription.mobile.sgsn.operatorName
  • device.communicationModules[].subscription.mobile.sgsn.countryName
  • device.communicationModules[].subscription.mobile.sgsn.countryCode
  • device.communicationModules[].subscription.mobile.ggsn.plmn
  • device.communicationModules[].subscription.mobile.ggsn.operatorName
  • device.communicationModules[].subscription.mobile.ggsn.countryName
  • device.communicationModules[].subscription.mobile.ggsn.countryCode
  • device.communicationModules[].subscription.mobile.registeredPlmn
  • device.communicationModules[].subscription.mobile.registeredOperator
  • provision.device.model
  • provision.device.software
  • provision.device.communicationModules[].model
  • provision.device.communicationModules[].software
  • provision.device.communicationModules[].subscriber.model
  • provision.device.communicationModules[].subscriber.software
  • provision.device.communicationModules[].subscription.mobile.homeOperator
  • provision.device.communicationModules[].subscription.mobile.registeredOperator
  • provision.administration.channel
  • provision.administration.organization
  • provision.administration.serviceGroup
  • provision.administration.plan

Group examples

Click on any of the following links to expand the contents.

Group Search Request example
{
  "filter": {
    "and": [
      {
        "like": {
          "provision.administration.organization": "battery_organization"
        }
      }
    ]
  },
  "group": {
    "parameters": [
      {
        "name": "provision.device.model"
      }
    ]
  }
}
Group Search Response example
{
  "summary": {
    "count": 6,
    "summaryGroup": [
      {
        "provision.administration.organization": {
          "count": 6,
          "list": [
            {
              "count": 6,
              "name": "battery_organization"
            }
          ]
        }
      },
      {
        "provision.administration.channel": {
          "count": 6,
          "list": [
            {
              "count": 6,
              "name": "battery_channel"
            }
          ]
        }
      },
      {
        "provision.device.model.name": {
          "count": 6,
          "list": [
            {
              "count": 1,
              "name": "model_name-7"
            },
            {
              "count": 2,
              "name": "model_name-4"
            },
            {
              "count": 1,
              "name": "model_name-10"
            },
            {
              "count": 1,
              "name": "model_name-5"
            },
            {
              "count": 1,
              "name": "model_name-11"
            }
          ]
        }
      }
    ]
  }
}

Pagination

The API allows you obtaining the response to a search in blocks with predefined number of results.

  • limit:
    • start: Page number you request. The count starts with the number 1
    • size: The number of entities that you can see on the page
Default number of items returned

The search API limits the page size to 50 items by default, but you probably have thousands of devices. How do you walk through all your devices?

Well, let’s suppose you have exactly 2500 devices matching your query. Obviously, your result exceeds the default limit. In this case, you’ll find a page object in your response.

Paginated examples

Paginated example response

{
    "page" : { "number" : 1 },
    "resources" : [
        { ... },
        { ... },
        { ... },
        { ... },
        ...
        { ... }
    ]
}

Warning about the previous example

Warning

Please, take the resources field on the previous example as a placeholder for any reserved word into the scope of the searched resource: entities, devices, subscriptions, data models, bundles, data streams, data points, etc.

The number attribute is the current number of pages based on the limit setup.

What can you do to get the following page? It’s easy. You only have to include a limit object in your query. See next example.

Pagination example request

{
  "limit": {
    "start": 2
  }
}

Paginated example generic response

{
   "page" : { "number" : 2 },
   "resources" : [
       { ... },
       { ... },
       { ... },
       { ... },
       ...
       { ... }
   ]
}

See previous warning about the resources word in the example.

You can change the page limit from the beginning. Supposing you want to retrieve 50 items per query, you must set up the limit object with a starting point and the page size you want.

Paginated example request

Changing the starting page and the limit

{
  "limit": {
    "start": 2,
    "size": 50
  }
}

The top margin for the page size in the limit object is 1000. You’ll receive a server error response if you set up a size attribute over this limit.

Another example of pagination response

With the starting page and the limit changed

{
    "page" : { "number" : 2},
    "resources" : [
         { ... },
         { ... },
         { ... },
         { ... },
         ...
         { ... }
    ]
}

See previous warning about the resources word in the example.

Summary

Responses to all search requests include a summary object with different counters regarding the results obtained. It is closely related to the grouping feature.

By default, the summary always shows the total count, the organization’s grouping counter, and the channel grouping counter.

  • count (field): number of occurrences found in the whole search
  • summaryGroup []: array of type of summarized specific object structure
    • SpecificObjectParameterDatamodel: object inside the Parameter of the data models
      • count: number of these specific elements found
      • list: array of each type of summarized element
        • count: number of these specific elements found
        • name: value of the parameter of the data model

Here’s how to search devices with a summary without a group clause

This is the request using curl:

curl --request POST \
     --data-binary @subscription.json \
     --header "X-ApiKey: YOUR_API_KEY_HERE" \
     --verbose \
     https://[your_opengate_address]/north/v80/search/devices/summary \
     -H "Content-type: application/json"

Some grouping examples

Response summary without grouping

{
  "summary": {
    "count": 6,
    "summaryGroup": [
      {
        "provision.administration.organization": {
          "count": 6,
          "list": [
            {
              "count": 6,
              "name": "organization1"
            }
          ]
        }
      },
      {
        "provision.administration.channel": {
          "count": 6,
          "list": [
            {
              "count": 6,
              "name": "channel1"
            }
          ]
        }
      }
    ]
  }
}

This is the request using curl:

curl --request POST \
     --data-binary @subscription.json \
     --header "X-ApiKey: YOUR_API_KEY_HERE" \
     --verbose \
     https://[your_opengate_address]/north/v80/search/devices/summary \
     -H "Content-type: application/json"

In the body of the request, you include the filter with the select clause.

Example Filter using group clause

{
  "filter": {
    "and": [
      {
        "like": {
          "provision.administration.organization": "battery_organization"
        }
      }
    ]
  },
  "group": {
    "parameters": [
      {
        "name": "provision.device.model"
      }
    ]
  }
}

Response summary with group clause

{
  "summary": {
    "count": 6,
    "summaryGroup": [
      {
        "provision.administration.organization": {
          "count": 6,
          "list": [
            {
              "count": 6,
              "name": "battery_organization"
            }
          ]
        }
      },
      {
        "provision.administration.channel": {
          "count": 6,
          "list": [
            {
              "count": 6,
              "name": "battery_channel"
            }
          ]
        }
      },
      {
        "provision.device.model.name": {
          "count": 6,
          "list": [
            {
              "count": 1,
              "name": "model_name-7"
            },
            {
              "count": 2,
              "name": "model_name-4"
            },
            {
              "count": 1,
              "name": "model_name-10"
            },
            {
              "count": 1,
              "name": "model_name-5"
            },
            {
              "count": 1,
              "name": "model_name-11"
            }
          ]
        }
      }
    ]
  }
}

Query dialects

The five clauses — filter, select, sort, group, limit — look the same everywhere, but three kinds of store answer them slightly differently. This page is the diff, so you do not have to read three long pages to find it.

The three dialects at a glance

Generic search Time series Data sets
URL /north/v80/search/<resource> /north/v80/timeseries/provision/organizations/{org}/{id}/data /north/v80/datasets/provision/organizations/{org}/{id}/data
Field names Dotted paths of the resource bucketColumn, identifierColumn, columns.name, context.name identifierColumn, columns.name
filter Full operator set Same syntax, only on filterable columns Same syntax, only on filterable columns
select Objects with name and fields Same keys as filter Array of column names
sort An object of parameters, each a field and a direction A string: the identifier of a sort declared in the definition A string: the identifier of a sort declared in the definition
group Supported Not applicable Does not exist
limit start and size Same, with CSV caveat below Same, with CSV caveat below
Response Array named after the resource columns plus data matrix columns plus data matrix
CSV output Yes Yes

Why time series and data sets are stricter

Both are pre-computed projections: you declare their columns up front, and the platform builds indexes for exactly those. That is what makes them fast, and it is also why you cannot filter or sort on an arbitrary field.

Sorting is declared, not composed. A generic search accepts any field in its sort object. A time series or a data set accepts only the identifier of a sort declared in its definition — a named, ordered list of columns with directions — plus the reverse of each one, which the platform exposes automatically because the same index serves it backwards. There is no per-column sortable flag and no cap on how many sorts a definition may hold.

{ "sort": { "parameters": [ { "name": "provision.device.identifier", "type": "ASCENDING" } ] } }   // generic
{ "sort": "sortByDeviceAsc" }                                                                      // time series, data sets

The real limit is a budget, not a number. Each filterable column and each declared sort consumes optimization units, and each definition has a budget of them. Both stores offer an optimizationPlan endpoint that reports what a definition would consume before you commit, and expose usedSearchOptimizationUnits and freeSearchOptimizationUnits on the definition itself.

See Defining a time series and Defining a data set.

Filters have four modes, not two: NO, YES for optional equality, ALWAYS for a filter every query must supply, and RANGE for >, < and BETWEEN. RANGE applies to numeric columns only; date-time columns are always range-searchable.

The matrix response

Generic searches return objects, one per row. Time series and data sets return a matrix instead: a columns array naming the fields, and a data array of rows, each row an array of values in that same order.

{
  "page": { "number": 26 },
  "columns": ["Prov Identifier", "Coll manufacturer", "Coll model"],
  "data": [
    ["MyDevice1", "OpenGate", "OpenGate"],
    ["MyDevice2", "OpenGate", "OpenGate"]
  ]
}

Read the values off columns rather than hardcoding positions. If you do rely on the order, this is what it is when you omit select:

Store Column order without select
Time series bucketColumn, then identifierColumn, then the context columns, then the aggregated columns
Data sets identifierColumn, then the defined columns.name in declaration order

Time series additionally offer an aggregated read, POST .../{id}/dataset, which collapses every bucket of a device into a single output row. There select.columns takes a column, an alias and an aggregation function per output variable, and the result is always sorted ascending by identifierColumn, which is included whether you ask for it or not. See Time series.

CSV output changes the rules

Time series and data sets can answer in CSV instead of JSON, and that switch changes two behaviours that surprise people:

limit flips meaning. In JSON, omitting limit applies the configured defaults. In CSV, omitting it means give me everything:

Body JSON response CSV response
{"filter": {}, "limit": {"size": 500, "start": 1}} 500 rows from row 1 500 rows from row 1
{"filter": {}} Configured default page The complete data set
{"filter": {}, "limit": {}} Configured default page Error: an incomplete limit is rejected

Sorting is disabled. CSV retrieval turns sorting off deliberately, to keep large exports fast. If you need ordered output, either sort downstream or use the JSON response.

Complete retrieval is expensive

Omitting limit in CSV mode downloads the entire store. On a large time series that is a long, heavy request. Page it unless you genuinely want everything.

CSV formatting — the quoting character, the escape character, the end-of-line sequence and how nulls are represented — is customizable through HTTP header options, and you are responsible for the result being well-formed CSV.

Undocumented header names

The specific header names for those CSV options are not currently published in the API specification. Until they are, ask your platform contact for the exact names.

What stays the same

Worth stating plainly, because it is most of the surface:

  • POST with a JSON body, always.
  • X-ApiKey for authentication.
  • The filter operatorseq, neq, like, gt, lt, gte, lte, in, nin, exists, and, or — behave identically in all three dialects.
  • limit uses start and size everywhere.
  • The utc=true header option returns date fields in UTC in all of them.

Alarms

An alarm is what OpenGate raises when a rule detects something worth a human’s attention: a device that stopped reporting, a value out of range, an identification conflict. This API is how a back-office application finds them, counts them, and records that somebody dealt with them.

The alarm life cycle

stateDiagram-v2
    direction LR
    [*] --> OPEN: a rule raises the alarm
    OPEN --> ATTENDED: action ATTEND
    OPEN --> CLOSED: action CLOSE
    ATTENDED --> CLOSED: action CLOSE
    CLOSED --> [*]
Status Meaning
OPEN The alarm is active
ATTENDED An operator is dealing with it
CLOSED The alarm is closed

Two more attributes tell you how much it matters:

Attribute Values
severity INFORMATIVE (only informative) · URGENT (needs attention soon) · CRITICAL (critical for service operation)
priority LOW · MEDIUM · HIGH

Endpoints

To POST to
Search alarms on any entity /north/v80/search/entities/alarms
Search alarms on devices /north/v80/search/entities/devices/alarms
Search alarms on subscriptions /north/v80/search/entities/subscriptions/alarms
Count instead of list The same three URLs with /summary
Attend or close alarms /north/v80/alarms

Searches follow the standard query language: filter, select, sort, group and limit, with results in JSON by default or CSV through header options.

Finding alarms

curl --request POST \
     --header "X-ApiKey: <your-api-key>" \
     --header "Content-Type: application/json" \
     --data '{"filter": {"like": {"alarm.channel": "default_channel"}}}' \
     https://api.opengate.es/north/v80/search/entities/alarms
{
  "alarms": [
    {
      "identifier": "6c6c3bcb-633e-4418-ae6d-ed69a1db7e96",
      "name": "alarmForDevice",
      "severity": "CRITICAL",
      "priority": "HIGH",
      "status": "CLOSED",
      "entityIdentifier": "device_ogmapiXXX9",
      "organization": "org_ogmapiXXX9",
      "channel": "chn_ogmapiXXX9",
      "openingDate": "2020-08-21T10:42:35.507Z",
      "closureDate": "2020-08-21T10:42:54.186Z"
    }
  ],
  "page": { "number": 1 }
}

Fields you can filter and sort on

Group Fields
Identity alarm.identifier · alarm.name · alarm.rule · alarm.description
Classification alarm.severity · alarm.priority · alarm.status
Where alarm.organization · alarm.channel · alarm.entityIdentifier · alarm.subEntityIdentifier · alarm.resourceType
Opening alarm.openingDate
Attention alarm.attentionDate · alarm.attentionUser · alarm.attentionNote
Closure alarm.closureDate · alarm.ClosureUser · alarm.closureNote

Everyday queries follow from those: everything still open and critical, everything a given operator attended, everything raised on one device last week.

{
  "filter": {
    "and": [
      { "eq": { "alarm.status": "OPEN" } },
      { "eq": { "alarm.severity": "CRITICAL" } }
    ]
  },
  "sort": { "parameters": [ { "name": "alarm.openingDate", "type": "DESCENDING" } ] }
}

Counting alarms

The /summary endpoints answer how many, which is what a dashboard needs. An empty filter summarizes everything:

{ "filter": {} }

The response counts alarms and breaks them down by group:

{
  "summary": {
    "date": "2020-08-14T11:06:26.04Z",
    "count": 6,
    "summaryGroup": [
      { "severity": { "count": 6, "list": [
        { "count": 1, "name": "URGENT" },
        { "count": 3, "name": "CRITICAL" },
        { "count": 2, "name": "INFORMATIVE" }
      ] } },
      { "rule": { "count": 3, "list": [
        { "count": 1, "name": "alarmForSubsInDevice" },
        { "count": 1, "name": "alarmForDevice" },
        { "count": 1, "name": "alarmForSubscription" }
      ] } },
      { "status": { "count": 3, "list": [ { "count": 3, "name": "OPEN" } ] } },
      { "name": { "count": 3, "list": [ { "count": 3, "name": "identificationConflict" } ] } }
    ]
  }
}
Only four fields can group a summary

Summaries group by alarm.name, alarm.rule, alarm.status and alarm.severity. Any other field returns 400 Bad Request.

Attending and closing

Alarms are not deleted, they are moved along their life cycle. One request handles a batch, and the notes field records why — which is what makes the alarm history auditable afterwards:

curl --request POST \
     --header "X-ApiKey: <your-api-key>" \
     --header "Content-Type: application/json" \
     --data '{"action": "CLOSE", "alarms": ["50dca9ab-f552-4805-9cff-019090d5b92b"], "notes": "notes of the reason"}' \
     https://api.opengate.es/north/v80/alarms
Field Holds
action ATTEND or CLOSE
alarms The identifiers to act on, one or many
notes The reason, stored as attentionNote or closureNote

The user performing the action is recorded in attentionUser or ClosureUser, with its timestamp, so you can query later who handled what.

API specification

Data points

Deprecated — superseded by Time series

Data points are superseded by time series, and their availability in future versions of OpenGate is not guaranteed.

Do not build new integrations on this API. If you are querying data points today, plan the move: define a time series with the columns and aggregation you need, and query that instead.

What a data point is

A data point is one instance of a data stream at one instant. Its at attribute is when the measurement was taken, and the whole set of data points for a data stream is the raw history of that measurement.

Why time series replaces it

Both hold history, but they answer differently:

Data points Time series
Granularity Every raw value Values aggregated per time bucket
Aggregation You fetch everything and compute it Computed on ingestion
Cost of a month of data Every value crosses the wire One row per device per bucket
Future support Not guaranteed The supported path

The practical difference shows up at fleet scale: asking a month of readings for ten thousand devices means millions of data points to transfer and reduce yourself, versus a pre-aggregated table that answers in one request.

Querying data points

While the API remains available, it is a standard Data Lake search:

POST /north/v80/search/datapoints
curl --request POST \
     --header "X-ApiKey: <your-api-key>" \
     --header "Content-Type: application/json" \
     --data '{"filter": {"and": [{"like": {"datapoints.datastreamId": "batteryPercentage"}}]}}' \
     https://api.opengate.es/north/v80/search/datapoints
{
  "datapoints": [
    {
      "organization": "battery_organization",
      "channel": "battery_channel",
      "datastreamId": "batteryPercentage",
      "entityIdentifier": "device_1ADA8F",
      "_current": {
        "value": 82,
        "date": "2018-06-04T12:18:11.147+02:00",
        "at": "2018-06-04T12:18:10+02:00",
        "source": "DEVICE_SIGFOX"
      }
    }
  ],
  "page": { "number": 1 }
}

Filter fields are prefixed datapoints., so datapoints.datastreamId, datapoints.entityIdentifier and the _current fields of the value.

Response format

Results come back as JSON by default or as CSV through header options. A flattened parameter returns each data point flat instead of nested, which is easier to feed into a table — see the datapoint parameters in the specification below.

API specification

Data sets

Limited access

This feature is only available to root and super_admin_domain profiles. Ask your administrator for proper user role profiling.

What a data set is

A data set is a flat table over your devices: one row per device, one column per value you chose. You pick the data streams that become columns, and the platform keeps the table current.

It is the answer to “give me a spreadsheet of my fleet” — the identifier, the model, the ICC, the last reading — without writing a query that walks each device’s data streams and flattens the result.

Data sets Time series Data points
Shape One row per device One row per device per period One row per measurement
Time Current values Aggregated history Full raw history
Best for Exports, inventories, tabular views Trends at scale Auditing exact readings

Column values are limited to strings, numbers and booleans. If a data stream holds an object or an array, the column definition has to include a path down to one of those primitive values. Devices with communication modules need one column per module.

The two halves of the API

Defining a data set is administration: choose the columns, their paths, and which of them are filterable, and declare the sorts a query may ask for. Done once.

Querying a data set is the daily work: POST a filter, read rows back as JSON or CSV.

API specification

Subsections of Data sets

Defining a data set

Defining a data set means choosing which data streams become columns. This is administration work, done once per data set.

The identifier column

Every data set needs an identifierColumn. It maps to provision.administration.identifier._current.value, with filtering enabled and sorting available, and it identifies the device each row belongs to.

Column paths

A column’s path has three parts, and the third is only required when the data stream is not a primitive value.

1. The data stream identifier — the datastreamId you want. If it contains communicationModules[], include the index of the module you mean:

device.communicationModules[0].subscription.mobile.imsi._current.value

2. The data stream field — one of:

_current.value · _current.date · _current.at · _current.feedId · _current.source · _current.sourceInfo

3. The value path — when the data stream holds an object or an array, a path down to a primitive value.

What a column can be filtered by

Every column carries a filter value that decides how queries may use it:

Value Meaning
NO Not filterable. The default
YES Optional equality filter
ALWAYS Required equality filter: every query must constrain this column
RANGE Range filter, >, < and BETWEEN, as well as equality

RANGE is only allowed on numeric columns, integer and number. Columns of type date-time are always range-searchable whatever the value says.

The sorts section

Sorting is declared in the definition, not composed at query time. The sorts section holds a list of named sorts, each an ordered list of columns with a direction, and a query asks for one by its identifier.

"sorts": [
  {
    "identifier": "sortByDeviceAsc",
    "description": "Sort by device identifier ascending",
    "columns": [
      { "name": "Prov Identifier", "direction": "ASC" }
    ]
  }
]
Field Rules
identifier Required, unique within the list. Letters, digits, spaces, _ and -. Generated as a UUID if omitted, so name it
description Optional free text
columns Required, at least one. A column name from the columns section plus ASC or DESC

At least one sort is mandatory, and the order inside columns is the sort precedence.

The reverse of every sort comes for free

For each sort you declare, OpenGate also exposes its reverse, served by the same index through a reverse scan. Those come back marked derived: true, which is read-only: the platform sets it and the web console uses it. Never declare a derived sort yourself — flipping the direction of one you already have just spends optimization units on an index you were given.

Limits

There is no fixed maximum number of filterable columns or declared sorts. Each filterable column and each declared sort consumes optimization units, and the data set has a budget of them — that budget is the limit.

Where to look What it tells you
The searchOptimizationInfo of a data set usedSearchOptimizationUnits and freeSearchOptimizationUnits
POST .../optimizationPlan What a definition would consume, before committing to it
POST /north/v80/datasets/provision/organizations/{organizationName}/optimizationPlan

Creating

POST /north/v80/datasets/provision/organizations/{organizationName}

Updating

PUT /north/v80/datasets/provision/organizations/{organizationName}/{identifier}

Updating can affect the data already stored or the structure holding it, which starts an adaptation process. Until it completes, dirty values may be present.

These fields can be modified:

Name · Description · IdentifierColumn · Columns · Sorts

Rules for columns:

  • Names are unique. You cannot add or rename a column to a name already in use.
  • filter: ALWAYS is immutable. You cannot add or remove a column that has it, you cannot set it on an existing column, and you cannot change it away once set.
  • Paths cannot be edited. Remove the column and create it again, which gets you the same result.

The optimization unit budget applies to updates as well, so run optimizationPlan before adding filterable columns or sorts to a definition that is already close to it.

Listing and deleting

GET    /north/v80/datasets/provision/organizations/{organizationName}
GET    /north/v80/datasets/provision/organizations/{organizationName}/{identifier}
DELETE /north/v80/datasets/provision/organizations/{organizationName}/{identifier}

Read the organization’s data sets:

curl --request GET \
     --header "X-ApiKey: <your-api-key>" \
     https://api.opengate.es/north/v80/datasets/provision/organizations/{organizationName}

Querying a data set

Reading a data set is a POST with the data set identifier in the URL:

POST /north/v80/datasets/provision/organizations/{organizationName}/{identifier}/data

Copy this and change the identifiers:

curl --request POST \
     --header "X-ApiKey: <your-api-key>" \
     --header "Content-Type: application/json" \
     --data '{"filter": {"eq": {"Prov Identifier": "MyDevice1"}}}' \
     https://api.opengate.es/north/v80/datasets/provision/organizations/{organizationName}/{identifier}/data

The response names its columns and gives you rows in that order:

{
  "page": { "number": 26 },
  "columns": ["Coll Mobile ICC value", "Coll Mobile ICC date", "Prov Identifier", "Coll manufacturer", "Coll model", "Prov Mobile ICC value"],
  "data": [
    ["icc1", "2021-04-06T12:35:22.784Z", "MyDevice1", "OpenGate", "OpenGate", "icc1"],
    ["icc2", "2021-04-06T07:45:57.468Z", "MyDevice2", "OpenGate", "OpenGate", "icc2"]
  ]
}

Without a select clause, columns holds the identifier column first, then the defined columns in declaration order.

The request body

Data set queries use the same clauses as any other search, with two differences worth memorising:

Clause In a data set query
filter Standard operators, keyed by identifierColumn or a column name
sort A string: the identifier of a sort declared in the data set — see below
select An array of column names, not the object form used elsewhere
limit start and size, as everywhere else
group Does not exist for data sets

The full comparison against the other query dialects is in Query dialects.

Asking for a sort

You do not compose an ordering in the request. You name one that already exists:

{ "filter": {}, "sort": "sortByDeviceAsc" }

Valid values are the identifier of any sort in the data set definition, plus the automatically exposed reverse of each one, so declaring an ascending sort gives you the descending direction too.

Omit sort and results come back sorted by the identifier column, ascending.

There is no fixed limit on how many sorts a definition can hold; the constraint is the optimization unit budget, described in Defining a data set.

Pagination and CSV

Data sets answer in JSON or CSV, and the format changes what an absent limit means:

Body JSON CSV
{"filter": {}, "limit": {"size": 500, "start": 1}} 500 rows from row 1 500 rows from row 1
{"filter": {}} Configured default page The complete data set
{"filter": {}, "limit": {}} Configured default page Error — an incomplete limit is rejected

CSV retrieval turns sorting off on purpose: it is what makes large exports fast, and CSV output is usually consumed by something that will sort it anyway.

Complete retrieval is expensive

Omitting limit in CSV mode downloads the whole data set. Page it unless you truly want everything.

CSV formatting is customizable through HTTP header options — the quoting character (double quotes by default), the escape character (a backslash by default), the end-of-line sequence (\n by default) and how nulls are represented. You are responsible for the combination producing well-formed CSV. The exact header names are not currently published, so ask your platform contact for them.

The other data set endpoints

Three more endpoints exist, and one of them is not what its URL suggests:

POST /north/v80/search/catalog/datasets
POST /north/v80/search/organizations/{organizationName}/datasets/{datasetId}
POST /north/v80/search/organizations/{organizationName}/datasets/{datasetId}/summary

search/catalog/datasets lists the data sets available to you.

The other two are not a mirror of the .../data read above: they take a different request body. The .../data endpoint uses the data set’s own dialect — sort as a declared identifier, select as an array of column names, no group. These two take the generic Data Lake search body, with sort as the {"parameters": [{"name": ..., "type": ...}]} object, select in its object form, and group available.

Endpoint Request body
datasets/provision/.../{identifier}/data Data set dialect: sort is a declared sort identifier
search/organizations/.../datasets/{datasetId} Generic Data Lake search body

Use .../data unless you specifically need the generic clauses. Which of the two is intended to be the long-term path has not been confirmed by the product team.

Data streams

A data stream is one measurement of a device — battery percentage, temperature, signal strength — and this API returns its current value, not its history.

Each instance has an alphanumeric identifier unique within its device. When that identifier matches a data stream template of the device’s data model, the instance inherits the template’s characteristics: units, period, tags and the rest. That is why a response carries not just a value but the metadata to interpret it.

Which store do I want?

You want Use
The latest reading of a measurement Data streams, this page
Values aggregated per hour, day or any period Time series
A flat table of chosen values across devices Data sets
Every raw value ever collected Data points, deprecated

Querying data streams

A standard Data Lake search:

POST /north/v80/search/datastreams
curl --request POST \
     --header "X-ApiKey: <your-api-key>" \
     --header "Content-Type: application/json" \
     --data '{"filter": {"eq": {"datastreams.datastreamId": "batteryPercentage"}}}' \
     https://api.opengate.es/north/v80/search/datastreams
{
  "page": { "number": 1 },
  "datastreams": [
    {
      "entityIdentifier": "device_battery_id",
      "datastreamId": "batteryPercentage",
      "name": "batteryPercentage",
      "unit": {
        "label": "%",
        "symbol": "%",
        "type": "basicSI"
      },
      "period": "INSTANT",
      "datamodelId": "teliot",
      "access": "READ",
      "channel": "battery_channel",
      "organization": "battery_organization",
      "_current": {
        "value": 100,
        "date": "2019-04-15T09:18:43.926Z",
        "at": "2019-04-15T09:18:43.926Z"
      }
    }
  ]
}

Reading the response

Field Holds
datastreamId, name The measurement’s identifier and display name
entityIdentifier The device the value belongs to
unit Label, symbol and type, so the number is interpretable
period How often the value is expected, INSTANT for on-change values
datamodelId The data model the definition comes from
access Whether the stream is readable, writable or both
_current.value The value itself
_current.date When the platform recorded it
_current.at When the measurement was actually taken

The distinction between date and at matters when a device buffers readings and reports them later: at is the truth about the measurement, date is when OpenGate learned about it.

Filter fields are prefixed datastreams., and results come back as JSON by default or as CSV through header options.

API specification

Time series

Limited access

This feature is only available to root and super_admin_domain profiles. Ask your administrator for proper user role profiling.

What a time series is

A time series turns the stream of values a device sends into a table of rows over time: one row per device per time period, with each column holding a value aggregated over that period.

Ask for the average temperature per hour of ten thousand devices for the last month. Over data points that is millions of raw values to fetch and aggregate yourself. Over a time series it is already computed — the engine aggregated each hour as the data arrived.

That is the trade: you declare up front what you want aggregated and how, and in exchange the query is cheap.

Time buckets

The aggregation period is called a time bucket, and two fields define it:

Field Meaning
origin The starting date of the time series
timeBucket The length of each period in seconds, counted from origin

With an origin of 2022-01-01T00:00:00.000Z and a one hour bucket, the first period runs from 2022-01-01T00:00:00.001Z to 2022-01-01T01:00:00.000Z, the second from 2022-01-01T01:00:00.001Z to 2022-01-01T02:00:00.000Z, and so on:

2022-01-01T00:00:00.000Z -> 2022-01-01T01:00:00.000Z -> 2022-01-01T02:00:00.000Z ->...

Setting timeBucket to 0 seconds switches the engine into a different mode, storing every value instead of aggregating:

  • With only context columns defined, one record is saved per event received, and only when a column value actually changed — so you get a change log over time.
  • With aggregated columns defined, data is grouped by the at field of the incoming data points, and the aggregation function is applied when a new event arrives with the same at.

Which store do I want?

Time series Data points Data sets
Holds Values aggregated per period Every raw value Latest values, flat table
Rows One per device per bucket One per measurement One per device
Aggregation Computed on ingestion You compute it None
Best for Trends and history at scale Auditing exact readings Exports and tabular views

The two halves of the API

Defining a time series is administration: you declare the columns, their aggregation functions, the bucket length and the retention. Done once, usually by an administrator.

Querying a time series is what applications do every day: POST a filter and read rows back, as JSON or CSV.

The aggregation functions available to columns come from the time series functions catalog, which also lets you register your own.

API specification

Subsections of Time series

Defining a time series

Defining a time series is declaring, up front, what the engine should compute as data arrives. This is administration work: done once, changed rarely, and with consequences for data already stored — the last section of this page covers those.

Columns

A time series has four kinds of column, and only the first two are yours to name freely.

Aggregated columns (columns)

These hold a value aggregated over each time bucket. Each one names an aggregation function, and the engine re-applies it every time new data lands in an existing row. The available functions come from the time series functions catalog.

When timeBucket is 0, all received data is stored instead of aggregated, and only FIRST (keep the first value) or LAST (overwrite with the newest) make sense. Two consequences worth knowing:

  1. The search endpoint returns all the historical data collected.
  2. Several data streams can land in different columns of the same row when they share an at value.

When timeBucket is greater than 0, bucketColumn becomes required: it names the column the engine adds to search responses holding the end date of each bucket.

Context columns (context)

Context columns capture the value at the moment the bucket was created, and are never updated afterwards even if the aggregated columns keep changing. That is why they take no aggregation function. Use them for the things you want to know about the device at that point in time — its serial number, its firmware version, its subscription — so that a row is self-describing.

Identifier column (identifierColumn)

Required. It names the column that identifies the device, and always maps to provision.administration.identifier._current.value with filter=YES. The engine adds it to every row of every search result, using the name you chose.

Bucket columns (bucketColumn, bucketInitColumn)

Named by you, filled by the engine, holding the end and start instants of the bucket.

The path field

Every column and context needs a path, which the engine uses as a query to extract a data stream value and project it into the column. A path has two or three parts:

1. The data stream identifier — a data stream defined in an OpenGate data model.

Communication modules need an index

If the data stream id contains communicationModules[], the index is required: device.communicationModules[0].subscription.mobile.imsi

2. The data stream field — appended with a dot, one of:

_current.value · _current.date · _current.at · _current.feedId · _current.source · _current.sourceInfo

3. The value path — only when the data stream holds a JSON object or array, a JSONPath down to a primitive value.

What a column can be filtered by

Every column and context carries a filter value that decides how queries may use it:

Value Meaning
NO Not filterable. The default
YES Optional equality filter
ALWAYS Required equality filter: every query must constrain this column
RANGE Range filter, >, < and BETWEEN, as well as equality

RANGE is only allowed on numeric columns, integer and number. Columns of type date-time are always range-searchable whatever the value says, so you do not need RANGE for a bucket or a timestamp.

Retention

retention sets how long rows stay in the time series, in seconds. It cannot exceed the retention allowed by your organization’s policies.

The sorts section

Sorting is declared in the definition, not composed at query time. The sorts section holds a list of named sorts, each one an ordered list of columns with a direction, and a query then asks for a sort by its identifier.

"sorts": [
  {
    "identifier": "signalStrengthAsc",
    "description": "Sort by average signal strength ascending",
    "columns": [
      { "name": "Average Signal strength", "direction": "ASC" }
    ]
  },
  {
    "identifier": "bucket_id_desc",
    "columns": [
      { "name": "bucket_id", "direction": "DESC" }
    ]
  }
]
Field Rules
identifier Required, unique within the list. Letters, digits, spaces, _ and -. Generated as a UUID if you omit it, which makes it awkward to use, so name it
description Optional free text, for whoever reads the definition later
columns Required, at least one. Each entry is a column name from the columns or context sections plus a direction of ASC or DESC

At least one sort is mandatory. Order matters inside columns: the list is the sort precedence.

The reverse of every sort comes for free

For each sort you declare, OpenGate also exposes its reverse, served by the same index through a reverse scan. Those appear in the definition marked derived: true, which is read-only: the platform sets it and the web console uses it. Never declare a derived sort yourself on create or update — flip the direction of an existing one and you are duplicating an index you already have.

Filtering and sorting limits

There is no fixed maximum number of filterable columns or declared sorts. Instead, each filterable column, each context and each declared sort consumes optimization units, and each time series has a budget of them. That budget is the real limit, and it is what keeps queries fast.

Where to look What it tells you
The searchOptimizationInfo section of a time series usedSearchOptimizationUnits and freeSearchOptimizationUnits
POST .../optimizationPlan What a definition would consume, before you commit to it

Simulate with optimizationPlan while you are still designing. It is much cheaper than discovering the budget is spent after the fact — and since the reverse of each sort is free, declaring both directions wastes units for nothing.

Creating and updating

Creating a time series starts collecting data from devices into it. Updating one is where care is needed: changes can affect the data already stored or its structure, which triggers an adaptation process. Until that process finishes, dirty values can be present.

These fields can be modified:

Name · Description · IdentifierColumn · BucketColumn · BucketInitColumn · Retention · TimeBucket · Context · Columns · Sorts

Simulate the update before applying it

PUT accepts an onlyPlan query parameter. With onlyPlan=true nothing is modified: the response is a plan that summarizes the changes you asked for and explains their consequences, warning you where necessary. Default is false.

Use it on any non-trivial change. It is the difference between reading about dirty values and causing them.

Rules for columns and contexts:

  • Names are unique across all columns, contexts, the identifier and both bucket columns. You cannot rename something to a name already in use.
  • filter: ALWAYS is immutable. You cannot add or remove a column or context that has it, you cannot set it on an existing one, and you cannot change it away once it is set.
  • Paths cannot be edited. Remove the column and create it again, which gets you the same result.

Creation example

A daily time series (timeBucket: 86400) retained for 30 days, with one context column and one aggregated column summing the bytes a device sent:

curl --request POST \
     --header "X-ApiKey: <your-api-key>" \
     --header "Content-Type: application/json" \
     --data @timeserie.json \
     https://api.opengate.es/north/v80/timeseries/provision/organizations/{organizationName}

Content of timeserie.json:

{
  "name": "basic_timeserie",
  "organizationId": "organizationName",
  "description": "time series description",
  "timeBucket": 86400,
  "retention": 2592000,
  "origin": "2021-01-01 00:00:00+00:00",
  "bucketColumn": "bucket_id",
  "identifierColumn": "Admin Identifier",
  "context": [
    {
      "path": "provision.device.serialNumber._current.value",
      "name": "Prov serial",
      "filter": "YES"
    }
  ],
  "columns": [
    {
      "path": "device.communicationModules[].subscription.traffic.sentBytes._current.value",
      "name": "Daily sent bytes",
      "filter": "NO",
      "aggregationFunction": "SUM"
    }
  ],
  "sorts": [
    {
      "identifier": "bucket_id_desc",
      "description": "Most recent bucket first",
      "columns": [
        { "name": "bucket_id", "direction": "DESC" }
      ]
    }
  ]
}

The reverse of that sort, oldest bucket first, is available without declaring it.

Changing the time bucket

Buckets have a fixed length, so changing timeBucket changes the length of new ones. As a precaution, buckets in the future are deleted when you do this. The situations below are the edge cases worth understanding before you change it on a live time series.

Buckets that started before the change and end after it

The engine closes them at the instant of the update, and if needed the next bucket starts at that same instant and runs until the following one would start according to the new definition.

Changing time bucket to a lower value Changing the time bucket to a lower value

Changing time bucket to a bigger value Changing the time bucket to a bigger value

Devices with no buckets yet

Adaptation only applies to devices that collected data before the change. A device whose first data arrives after the update simply gets a bucket following the new definition.

Changing time bucket before first device data collection Changing the time bucket before the first data collection of a device

Both at once

Combine the two and different devices end up with buckets that do not line up with each other. A device can also collect data belonging to a bucket in the past: if that bucket exists the engine uses it as is, otherwise it creates a new one following the new definition. Both are the price of changing the bucket length.

Two devices with different buckets after changing time bucket Two devices with different buckets after changing the time bucket

Two devices with different buckets in the past after changing time bucket Two devices with different buckets in the past after changing the time bucket

From zero to a higher value

Going from timeBucket: 0 to a real length means each collection now creates a bucket of the new length. Zero-length buckets that the new bucket would overlap are absorbed rather than left behind, and their values feed the aggregation functions of each column.

Changing time bucket from zero to higher value Changing the time bucket from zero to a higher value

Deleting

DELETE /north/v80/timeseries/provision/organizations/{organizationName}/{identifier}

Removes the time series identified in the URL. Confirm the identifier before sending the request.

Querying a time series

Reading a time series is a POST with a JSON body, like every other OpenGate query:

POST /north/v80/timeseries/provision/organizations/{organizationName}/{identifier}/data

Copy this and change the identifiers:

curl --request POST \
     --header "X-ApiKey: <your-api-key>" \
     --header "Content-Type: application/json" \
     --data '{"filter": {"eq": {"Prov Identifier": "MyDevice1"}}, "sort": "EntityAscBucketDesc"}' \
     https://api.opengate.es/north/v80/timeseries/provision/organizations/{organizationName}/{identifier}/data

The response is a columns array naming the fields and a data array of rows in that order:

{
  "page": { "number": 26 },
  "columns": ["Bucket id", "Prov identifier", "Manufacturer", "ICC", "Daily sent bytes", "Daily received bytes", "Last presence", "Average Signal strength"],
  "data": [
    ["2021-04-06T12:00:00.000Z", "MyDevice1", "OpenGate", "icc1", 23500, 532, "IP", 75],
    ["2021-04-06T12:01:00.000Z", "MyDevice1", "OpenGate", "icc1", 3500, 14532, "IP", 65]
  ]
}

The request body

Clause Accepts
filter The standard operators, keyed by bucketColumn, identifierColumn, columns.name or context.name
sort A string: the identifier of one of the sorts declared in the time series, not a list of fields
select The same keys as filter
limit start and size, as everywhere else

Two things differ from a plain Data Lake search, and both come from the time series being pre-computed: you can only filter on columns declared filterable, and you can only sort by sorts declared in the definition. See Defining a time series for how those are declared, and Query dialects for the full comparison.

Column order when you omit select

columns tells you the order, so read values off it rather than hardcoding positions. If you do depend on the order, it is:

  1. The bucketColumn, holding the end date of the bucket
  2. The identifierColumn, holding provision.administration.identifier._current.value
  3. The context columns
  4. The aggregated columns

Asking for a sort

You do not compose an ordering in the request. You name one that already exists:

{ "filter": {}, "sort": "bucket_id_desc" }

Valid values are the identifier of any sort in the time series definition, plus the automatically exposed reverse of each one. So a definition declaring bucket_id_desc gives you both directions without declaring the second.

Read the definition to see what is available — GET the time series, or use expand=sorts, and the sorts list comes back with the derived ones included. There is no fixed limit on how many sorts a definition can hold; the constraint is the optimization unit budget, described in Defining a time series.

Pagination and CSV

The response format changes what limit means, which catches people out:

Body JSON CSV
{"filter": {}, "limit": {"size": 500, "start": 1}} 500 rows from row 1 500 rows from row 1
{"filter": {}} Configured default page Everything
{"filter": {}, "limit": {}} Configured default page Error — an incomplete limit is rejected

CSV retrieval also turns sorting off, deliberately, so that large exports stay fast. If you need ordered output, sort downstream or read JSON.

Complete retrieval is expensive

Omitting limit in CSV mode downloads the whole time series. Page it unless you truly want everything.

The CSV formatting itself — quoting character, escape character, end-of-line sequence and how nulls are represented — is set through HTTP header options, and you are responsible for the result being well-formed. The exact header names are not currently published, so ask your platform contact for them.

Aggregated read: one row per device

Besides reading buckets, you can collapse every bucket of a device into a single row:

POST /north/v80/timeseries/provision/organizations/{organizationName}/{identifier}/dataset

Here select.columns describes the output variables, each with the source column, an alias for the output name, and the aggregation function to apply across buckets:

{
  "filter": {
    "gt": { "bucket_id": "device_200" }
  },
  "limit": { "start": 1, "size": 50 },
  "select": {
    "columns": [
      { "column": "temperature", "alias": "first", "aggregation": "FIRST" },
      { "column": "temperature", "alias": "last",  "aggregation": "LAST" },
      { "column": "temperature", "alias": "avg",   "aggregation": "AVG" },
      { "column": "temperature", "alias": "max",   "aggregation": "MAX" },
      { "column": "temperature", "alias": "min",   "aggregation": "MIN" },
      { "column": "cpu",         "alias": "p_avg", "aggregation": "AVG" },
      { "column": "cpu",         "alias": "p_count", "aggregation": "COUNT" }
    ]
  }
}

filter and limit behave as above, and CSV output is available too. Two rules are specific to this endpoint:

  • The output is always sorted ascending by identifierColumn.
  • The identifierColumn is always included, added as the first column if you did not ask for it.

Parquet export

For bulk analytical work, a time series can be exported to a Parquet file:

POST /north/v80/timeseries/provision/organizations/{organizationName}/{identifier}/export
GET  /north/v80/timeseries/provision/organizations/{organizationName}/{identifier}/export

POST starts the export, GET reports the state of the current one. The output order is decided internally and cannot be changed.

Time Series Functions

Limited access

This feature is only available to root and super_admin_domain profiles. Ask your administrator for proper user role profiling.

Introduction

The objective of custom time series functions is to augment the capabilities of the default functions (see Common Platform Functions) through the addition of bespoke functions written in JavaScript. These functions will be managed through the creation of a catalogue tailored to the specific requirements of each organisation.

Common Platform Functions

A common catalogue will be established for all organisations, comprising default platform time series functions. The following functions have been defined:

  • FIRST: Please note that the engine will store only the first received value per time bucket. Consequently, the collection engine will ignore the following values obtained in the same time bucket.
  • LAST: Please note that the engine will store only the last received value per time bucket, overwriting the previous ones.
  • AVG: The engine will calculate the arithmetic mean of all values received within the specified time interval. This feature is only available for numeric values.
  • MAX: The engine will save the maximum value of all received values within the configured time frame. Please note that this feature is only available for numeric values.
  • MIN: The engine will save the lowest value of all received values within the configured time frame. This feature is only available for numeric values.
  • SUM: The engine will accumulate the total of all received values within the specified time interval. This feature is only available for numeric values.
  • COUNT: The engine will record the total number of values received in each time bucket for subsequent analysis.
  • MEDIAN: The engine will calculate the median of all received values within the configured time bucket. Please note that this feature is only available for numeric values.
  • GEO_AVG: The engine will calculate the geometric average of all received values within the configured time bucket. Please note that this feature is only available for numeric values.
  • VARIANCE: The engine will calculate the variance of all received values within the configured time bucket. Please note that this feature is only available for numeric values.
  • STD_DEVIATION: The engine will calculate the standard deviation of all received values within the configured time bucket. Please note that this feature is only available for numeric values.
Note

Please note that these functions will be available for querying with the API defined below. However, please be aware that it will not be possible to modify or delete them.

Custom Catalog

Each organisation will have access to a custom time series functions catalogue, which will enable them to manage their functions effectively. These functions can be used to define time series columns, which can then be referenced in the aggregationFunction field. The following example illustrates this process:

{
  "name": "basic_timeserie",
  "organizationId": "organizationName",
  "description": "time series description",
  "timeBucket": 86400,
  "retention": 2592000,
  "origin": "2021-01-01T00:00:00.000Z",
  "bucketColumn": "bucket_id",
  "identifierColumn": "Admin Identifier",
  "context": [
    ...
  ],
  "columns": [
      {
          "path":"some.path.A.value._current.value",
          "name":"columnaA",
          ...
          ...
          "aggregationFunction":"AVG", //platform aggregation function
      },
      
      
      {
          "path":"some.path.B.value._current.value",
          "name":"columnaB",
          ...
          ...
          "aggregationFunction":"myCustomTimeserieFunction" //custom function
      }
  ]
}
Warning

The defined API enables the modification of the script for the custom aggregation function. It should be noted that such modifications may result in changes to the aggregated data. Consequently, there is a possibility of inconsistencies between the new aggregated data and the previous values.

Note

The defined API permits the deletion of a custom aggregation function, provided that it is not utilised in any time series.

Custom Time series Function script

Considerations when developing Custom Aggregation Function:

The following are the code’s implicit input parameters:

  • receivedValues: an array of new values to be used for the final value calculation.

  • currentValue: the column’s current value.

  • extra: JSON object containing the current extra variables for the column, used for the value calculation. The code should utilise implicit input values to calculate the final value and subsequently construct the result object. It will be possible to use helper functions defined in the JS API. The code must return a JSON with three specific properties:

  • executionResult: If the execution was completed successfully, the OK value must be returned. If not, an error description must be provided.

  • value: The calculated value

  • extra: A JSON with the updated extra variables

    ```json
    {
      "executionResult": "OK",
      "value": 5, 
      "extra":{
        "sum": 10,
        "count": 2
      }
    }
    ```
    
Note

Any datetime values included in the ‘receivedValues’ input parameter will be formatted as an ISO string.

Note

For further details on how to implement custom aggregation functions, please refer to the JavaScript API documentation, specifically the section on aggregation functions.

Functions values types

To confirm that a time series function can be assigned to a time series column, the valueTypes field will be used. This field is an array of strings that accepts the following values:

  • integer
  • number
  • string
  • boolean
  • date-time

These types are the same as those specified for time series column type fields. When assigning a time series function to a specific column, the system will verify that the time series function in the array matches the type specified for that column.

Note

Please note that this field is not mandatory. If it is not defined by default, it will be set to an empty array. In the event that the time series function has empty valueTypes, no validation will be carried out when assigning to a column.

Note

Please note that it will not be possible to update the time series function and remove one of the ‘valueTypes’ if the function is being used by some column whose type is the removed value. However, if all valueTypes are removed, this should not cause any issues.

Comprehensive API actions

Existing Timeseries Functions List

Getting custom timeserie functions full catalog

In both instances, only the metadata will be retrieved (no script) from both the organisations’ custom timeseries functions and the platform timeseries functions.

Usage examples

Get the full time series functions catalog (organization custom functions plus platform functions, metadata only):

curl --request GET \
     --header "X-ApiKey: <your-api-key>" \
     https://api.opengate.es/north/v80/timeseries/provision/organizations/{organizationName}/catalog

Trimmed JSON response:

[
  {
    "id": "01234567890abcdeffffffff",
    "name": "customAvg",
    "description": "Custom implementation for avg function.",
    "valueType": ["integer", "number"],
    "catalog": "ORGANIZATION"
  },
  {
    "id": "AVG",
    "name": "AVG",
    "description": "The engine will calculate the arithmetic average of all received values in the configured time bucket. Only available in numeric values.",
    "valueType": ["integer", "number"],
    "catalog": "PLATFORM"
  }
]

Create a new custom function (multipart request with a metadata JSON part and a script plain text part):

curl --request POST \
     --header "X-ApiKey: <your-api-key>" \
     --form 'metadata={"name": "customAvg", "description": "Custom implementation for avg function."};type=application/json' \
     --form 'script=@custom_avg.js;type=text/plain' \
     https://api.opengate.es/north/v80/timeseries/provision/organizations/{organizationName}/catalog

API specification

Subsections of Time Series Functions

JavaScript API

Timeseries functions JS API guide

This guide describes how to write Custom Timeseries Functions and the contents of the JS API.

The API contains both the implementation of some predefined timeseries functions and some useful functions that can be used when writing Custom Aggregation Functions.

Writing Custom Aggregation Function

Input parameters

All functions will have three implicit input parameters that must be used for value calculation.

  • receivedValues: Array of Json of collected values. Each value will have two fields:
    • value: collected value. value type depends on Column’s datastream type (please note that any datetime value will be formatted as an ISO string).
    • at: datetime of collected value. This value will be defined in ISO string.
  • currentValue: Columns current aggregated value. The type depends on aggregation function behavior.
  • extra: Json with useful data for aggregated value updating. In some cases, when aggregated value must be updated, some previous auxiliary data must be used to calculate new values. The fields and their format will be defined taking into account the requirements of the function. For example, if an average data must be updated, previously received number of elements and their sum are necessary to calculate correctly new average value.

receivedValues example:

"receivedValues":[
    {
        "value": 3,
        "at": "2023-03-01T00:30:00.000Z"
    },{
        "value": 5,
        "at": "2023-03-01T01:30:00.000Z"
    },{
        "value": 6,
        "at": "2023-03-01T02:30:00.000Z"
    },{
        "value": 8,
        "at": "2023-03-01T02:30:00.000Z"
    }
];

currentValue example:

"currentValue": 4;

extra example:

"extra": {
  "sum": 8,
  "count": 2  
};

Timeserie function result

Defined function must return a result with specific format. It will be a json with two parameters:

  • value: New calculated value.
  • extra: A JSON with auxiliary data updated. The content of this JSON will be the same of the extra input parameter.

Result example:

return {
    "executionResult": "OK",
    "value": 5,
    "extra": {
      "sum": 30,
      "count": 5  
    }
};

There is an auxiliary function that takes value and extra fields as parameters and returns the json with correct format. For further description of this function check documentation.

Result example using auxiliary function:

return result.ok(5, {"sum":30}, {"count":6});

If some timeserie function execution throws an exception it will be internally caught. In this case result object will be like this:

return {
    "executionResult": "Some javascript execution error message"
}

This behavior can be forced using result.error function with an Error object or an string message. For example:

return result.error(new Error("Custom error message"));
// or
return result.error("Custom error message");

Function implementation example

Taking described Input parameters and the Result to be returned into account, AVG Aggregation Function implementation example is shown here:

var newCount = receivedValues.length;
var newSum = 0;
for(var recVal in receivedValues){
    newSum = newSum + receivedValues[recVal].value;
}
if (extra) {
    if(data.exists(extra.count)) newCount = newCount + extra.count;
    if(data.exists(extra.sum)) newSum = newSum + extra.sum;
}
var newValue = newSum / newCount;
return result.ok(newValue, {"sum":newSum}, {"count":newCount});

JS API

data.exists(value)

Aux method to check if some value has value. If value is undefined or null it will return false.

Kind: global function
Returns: Boolean - Json with result.

Param Type Description
value any value to be checked.

Example of use:

if(data.exists(receivedValues[recVal].value)){
    newSum = newSum + receivedValues[recVal].value;
}

data.undefined2null(value)

Aux method to replace all undefined fields with null values. Internally used to avoid issues when processing execution result.

Kind: global function
Returns: Any - Json with result.

Param Type Description
value any value to be checked and transformed.

Example of use:

var newValue = data.undefined2null(undefined);

console.log(newValue) // null

result.ok(value, …extraParams)

Used to build aggregation function result object

Kind: global function
Returns: Object - Json with result.

Param Type Description
value any value to be used to update column data.
extraParams any List of parameters to be used to compound extra json. Each parameter must be a Json with unique parameter and value.

Example of use:

var newValue = result.ok(5, {"sum":30}, {"count":6});

result.error(error)

Internally used to build aggregation function result object when some execution exception is caught.

Kind: global function
Returns: Object - Json with result.

Param Type Description
error any Caught error. It can be Error type or String type

Example of use:

var newValue = result.error(new Error("Custom error message"));

aggFunct.AVG(receivedValues, currentValue, extra)

The engine will calculate the arithmetic average of all received values in the configured time bucket. Only available in numeric values.

Kind: global function
Returns: Object - Json with result.

Param Type Description
receivedValues Array Array of objects with new values to be used for final value calculation.
currentValue any Column’s current value.
extra Object JSON with auxiliary parameters for final value calculation.

Example of use:

var newValue = aggFunct.AVG(receivedValues, currentValue, extra);

aggFunct.COUNT(receivedValues, currentValue, extra)

The engine will store the count of total number values received per time bucket.

Kind: global function
Returns: Object - Json with result.

Param Type Description
receivedValues Array Array of objects with new values to be used for final value calculation.
currentValue any Column’s current value.
extra Object JSON with auxiliary parameters for final value calculation.

Example of use:

var newValue = aggFunct.COUNT(receivedValues, currentValue, extra);

aggFunct.FIRST(receivedValues, currentValue, extra)

The engine will store only the first received value per time bucket. The collection engine ignores the following values obtained in the same time bucket.

Kind: global function
Returns: Object - Json with result.

Param Type Description
receivedValues Array Array of objects with new values to be used for final value calculation.
currentValue any Column’s current value.
extra Object JSON with auxiliary parameters for final value calculation.

Example of use:

var newValue = aggFunct.FIRST(receivedValues, currentValue, extra);

aggFunct.GEO_AVG(receivedValues, currentValue, extra)

The engine will calculate the geometric average of all received values in the configured time bucket. Only available in numeric values.

Kind: global function
Returns: Object - Json with result.

Param Type Description
receivedValues Array Array of objects with new values to be used for final value calculation.
currentValue any Column’s current value.
extra Object JSON with auxiliary parameters for final value calculation.

Example of use:

var newValue = aggFunct.GEO_AVG(receivedValues, currentValue, extra);

aggFunct.LAST(receivedValues, currentValue, extra)

The engine will store only the last received value per time bucket, overwriting the previous ones.

Kind: global function
Returns: Object - Json with result.

Param Type Description
receivedValues Array Array of objects with new values to be used for final value calculation.
currentValue any Column’s current value.
extra Object JSON with auxiliary parameters for final value calculation.

Example of use:

var newValue = aggFunct.LAST(receivedValues, currentValue, extra);

aggFunct.MAX(receivedValues, currentValue, extra)

The engine will save the maximum value of all received values in the configured time bucket. Only available for numeric values.

Kind: global function
Returns: Object - Json with result.

Param Type Description
receivedValues Array Array of objects with new values to be used for final value calculation.
currentValue any Column’s current value.
extra Object JSON with auxiliary parameters for final value calculation.

Example of use:

var newValue = aggFunct.MAX(receivedValues, currentValue, extra);

aggFunct.MEDIAN(receivedValues, currentValue, extra)

The engine will calculate the median of all received values in the configured time bucket. Only available in numeric values.

Kind: global function
Returns: Object - Json with result.

Param Type Description
receivedValues Array Array of objects with new values to be used for final value calculation.
currentValue any Column’s current value.
extra Object JSON with auxiliary parameters for final value calculation.

Example of use:

var newValue = aggFunct.MEDIAN(receivedValues, currentValue, extra);

aggFunct.MIN(receivedValues, currentValue, extra)

The engine will save the minimum value of all received values in the configured time bucket. Only available for numeric values.

Kind: global function
Returns: Object - Json with result.

Param Type Description
receivedValues Array Array of objects with new values to be used for final value calculation.
currentValue any Column’s current value.
extra Object JSON with auxiliary parameters for final value calculation.

Example of use:

var newValue = aggFunct.MIN(receivedValues, currentValue, extra);

aggFunct.STD_DEVIATION(receivedValues, currentValue, extra)

The engine will calculate the standard deviation of all received values in the configured time bucket. Only available in numeric values.

Kind: global function
Returns: Object - Json with result.

Param Type Description
receivedValues Array Array of objects with new values to be used for final value calculation.
currentValue any Column’s current value.
extra Object JSON with auxiliary parameters for final value calculation.

Example of use:

var newValue = aggFunct.STD_DEVIATION(receivedValues, currentValue, extra);

aggFunct.SUM(receivedValues, currentValue, extra)

The engine will save the sum of all received values in the configured time bucket. Only available for numeric values.

Kind: global function
Returns: Object - Json with result.

Param Type Description
receivedValues Array Array of objects with new values to be used for final value calculation.
currentValue any Column’s current value.
extra Object JSON with auxiliary parameters for final value calculation.

Example of use:

var newValue = aggFunct.SUM(receivedValues, currentValue, extra);

aggFunct.VARIANCE(receivedValues, currentValue, extra)

The engine will calculate the variance of all received values in the configured time bucket. Only available in numeric values.

Kind: global function
Returns: Object - Json with result.

Param Type Description
receivedValues Array Array of objects with new values to be used for final value calculation.
currentValue any Column’s current value.
extra Object JSON with auxiliary parameters for final value calculation.

Example of use:

var newValue = aggFunct.VARIANCE(receivedValues, currentValue, extra);

log.trace(…msg)

Creates TRACE level logging messages. It concatenates msg parameters to compound message to be logged.

Kind: global function

Param Type Description
…msg any The function takes as parameters a list of elements to be concatenated to generate the string message to be printed.

Example of use:

log.trace("This is a trace message");

log.debug(…msg)

Creates DEBUG level logging messages. It concatenates msg parameters to compound message to be logged.

Kind: global function

Param Type Description
…msg any The function takes as parameters a list of elements to be concatenated to generate the string message to be printed.

Example of use:

log.debug("This is a debug message");

log.info(…msg)

Creates INFO level logging messages. It concatenates msg parameters to compound message to be logged.

Kind: global function

Param Type Description
…msg any The function takes as parameters a list of elements to be concatenated to generate the string message to be printed.

Example of use:

log.info("This is an info message");

log.warn(…msg)

Creates WARN level logging messages. It concatenates msg parameters to compound message to be logged.

Kind: global function

Param Type Description
…msg any The function takes as parameters a list of elements to be concatenated to generate the string message to be printed.

Example of use:

log.warn("This is a warn message");

log.error(…msg)

Creates ERROR level logging messages. It concatenates msg parameters to compound message to be logged.

Kind: global function

Param Type Description
…msg any The function takes as parameters a list of elements to be concatenated to generate the string message to be printed.

Example of use:

log.error("This is an error message");

date.fromString(stringDate)

Create Date object from ISO string.

Kind: global function

Param Type Description
stringDate string Iso string date

Example of use:

var parsedDate = date.fromString("2022-01-01T00:00:00.000Z");

date.toString(date)

Returns iso string representation of Date object.

Kind: global function

Param Type Description
date Date Date object

Example of use:

var isoDate = date.toString(new Date());

date.compare(date1, date2)

Compares two dates. These dates can be passed as strings in ISO format or as Date objects. The result is:

  • 0: when both are equal.
  • negative: when date1 is lower than date2
  • positive: when date1 is higher than date2

Kind: global function

Param Type Description
date1 Date Date object
date2 Date Date object

Example of use:

var date1 = date.fromString("2022-01-01T00:00:00.000Z");
var date2 = date.fromString("2022-01-02T00:00:00.000Z");
var result = date.compare(date1, date2);

Analytics

Limited access

This feature is only available to root and super_admin_domain profiles. Ask your administrator for proper user role profiling.

Analytic tasks

An analytic task is a JSON document that describes an analysis over your stored data. The platform turns that document into the query it runs against the data store, so the task is a declaration of what to compute rather than code you write. Some of its fields are mandatory.

Where analytics actually happens

Analytics in OpenGate spans more than this API, and the working documentation lives elsewhere:

To Go to
Write and run analysis interactively, in Jupyter Lab Analytics and Datalab
Read and write platform data from Python The opengate-data library, in OpenGate Libraries
Run a notebook unattended, once or on a schedule Notebook scheduler
Query stored data directly over REST What you can query
Configure the platform’s AI settings The Analytics section of the web console

If you are looking for how to analyse your data, the Datalab how-to and the notebook scheduler are the practical route. This page covers only the analytic task API object.

Specification not currently published

The API specification for analytic tasks is not shipped with the documentation at the moment, so the endpoint reference is unavailable here. Ask your platform contact for the endpoint details in the meantime.

Notebook scheduler

Limited access

This feature is only available to root and super_admin_domain profiles. Ask your administrator for proper user role profiling.

What it is for

The notebooks you write in the OpenGate Data Lab are interactive by nature: you open Jupyter Lab, run cells, look at results. The notebook scheduler takes a notebook out of that interactive loop and runs it unattended — once, or on a repeating schedule — with parameters supplied from outside and an optional report kept for a number of days.

That turns a notebook into a scheduled job: a nightly aggregation, a weekly report, a periodic model retraining. See the Analytics and Datalab how-to for writing the notebooks themselves.

Each scheduled execution becomes a cron job in the platform’s Kubernetes cluster, which is why the API talks about cron jobs and cron patterns.

Endpoints

Authentication uses the Authorization header, not X-ApiKey.

To Call
List the notebooks available to you GET /planner/notebooks
Run one notebook now POST /planner/notebooks/{notebookId}/execute
Schedule a notebook POST /planner/schedulers
List your scheduled executions GET /planner/schedulers
Delete a scheduled execution DELETE /planner/schedulers/{cronjobId}
Check the service is up GET /planner/health-check
Read the service version GET /planner/nsversion

Running a notebook once

The body carries the parameters the notebook needs and what to do with its report:

{
  "generateReport": true,
  "reportRetentionDays": 2,
  "params": [
    { "name": "DB_URL", "value": "..." }
  ]
}
Field Meaning
generateReport Whether to produce a report of the execution
reportRetentionDays How many days to keep that report
params Name and value pairs passed to the notebook as environment parameters

Scheduling a notebook

Same body plus the notebook and a standard cron pattern:

{
  "notebookId": "12345678",
  "cronPattern": "*/5 * * * *",
  "generateReport": true,
  "reportRetentionDays": 2,
  "params": [
    { "name": "DB_URL", "value": "..." }
  ]
}

*/5 * * * * runs every five minutes. The five fields are, in order, minute, hour, day of month, month and day of week.

Reading your scheduled executions

GET /planner/schedulers returns the cron jobs belonging to the current user. Each one reports:

Field Holds
id The cron job identifier, which is what DELETE takes
notebook The notebook being run
schedule The cron pattern
lastExecutionTime When it last ran
params The parameters it passes
generateReport, reportRetentionDays The report settings
user The owner

A 204 No Content means you have no scheduled executions, not an error.

API specification

Operations

What is an operation?

An operation is an action that OpenGate executes on a remote entity: reboot a device, update its firmware, read or write its configuration parameters, run a diagnostic, change its administrative status. If data collection is how the platform reads from the field, operations are how it writes to it.

Operations are the answer to a question every IoT deployment eventually asks: I have fifty thousand devices in the field — how do I make them all do something, and how do I know whether it worked?

Why operations matter

They work at fleet scale. A single API request can target one device or every device matching a tag or a filter. OpenGate explodes that request into one operation per entity, tracks each one independently, and gives you both an aggregated summary and the per-entity detail.

They are asynchronous by nature, and modelled as such. A device may be asleep, roaming, or out of coverage. Operations have their own life cycle, with timeouts, retries, pause and resume, so a request that cannot be served right now is not a request that failed.

They are extensible without touching your code. An operation is identified by a name and a parameter object. Adding a new operation type to your organization does not change the API contract: the same POST endpoint executes REBOOT_EQUIPMENT today and your own CALIBRATE_SENSOR tomorrow.

They report progress, not just outcomes. Operations can be multi-step. A firmware update reports download progress, installation start and end, and the final result — so a two-hour update over a narrowband link is observable while it runs.

They are transport-agnostic. Back-office applications always talk to the same north API. How the operation actually reaches the device (HTTP, MQTT, a connector function) is resolved by the platform.

Operations act on the real world

A single request with a tag or a filter can reach thousands of entities, and cancelling a job does not roll back steps that already executed. Verify the target selection before activating a job.

The operation model

Five concepts carry the whole service:

flowchart TB
    OT["Operation type<br>REBOOT_EQUIPMENT<br>(what can be requested)"]
    TASK["Task<br>(a schedule)"]
    JOB["Job<br>(one execution over a target)"]
    OP1["Operation<br>device_1"]
    OP2["Operation<br>device_2"]
    OPN["Operation<br>device_N"]
    ST["Steps<br>progress and result<br>reported per entity"]

    OT --> JOB
    OT --> TASK
    TASK -->|"one job per scheduled run"| JOB
    JOB --> OP1
    JOB --> OP2
    JOB --> OPN
    OP1 --> ST
    OP2 --> ST
    OPN --> ST
Concept What it is Where it lives
Operation type The definition of an action: its name, its parameter schema and its steps. Cloned from the platform catalog or created by your organization. Operation types, Default catalog
Job One execution of an operation type over a target set of entities, with its own schedule, timeouts and retries. Jobs
Task A schedule that creates jobs over time — periodically, or on a weekly, monthly or yearly pattern. Tasks
Operation The execution on a single entity. A job with 300 targets produces 300 operations, each with its own status and result. Jobs, Status reference
Step A stage inside a single operation, with its own result and timestamp. Multi-step operations report each one as it happens. Execution flows

Two ways to execute

Job Task
Purpose Run an operation once Run an operation repeatedly over time
Endpoint POST /v80/operation/jobs POST /v80/operation/tasks
Timing Immediately, after a delay, or at a date Start date + repetition period or calendar pattern
Produces One set of operations One job per scheduled execution
Changes apply to The job itself, while it has not started The next executions, never the job already running

Run your first operation

Create a job that reboots two devices. The operation name and its parameters come from your organization’s operation types; everything else configures how the execution is managed:

curl --request POST \
     --header "X-ApiKey: <your-api-key>" \
     --header "Content-Type: application/json" \
     --data @job.json \
     https://api.opengate.es/v80/operation/jobs

Content of job.json:

{
  "job": {
    "request": {
      "name": "REBOOT_EQUIPMENT",
      "parameters": {
        "type": "HARDWARE"
      },
      "active": true,
      "notify": true,
      "schedule": {
        "start": {
          "date": "2010-12-11T10:10:00Z"
        },
        "stop": {
          "delayed": 300000
        }
      },
      "operationParameters": {
        "ackTimeout": 5000,
        "timeout": 60000,
        "retries": 0,
        "retriesDelay": 1000,
        "retryResultList": ["ERROR_PROCESSING"]
      },
      "target": {
        "append": {
          "entities": ["device_1", "device_2"]
        }
      }
    }
  }
}

The response returns 201 with a location header containing the job identifier. Read the job to follow its progress:

curl --request GET \
     --header "X-ApiKey: <your-api-key>" \
     https://api.opengate.es/v80/operation/jobs/a38f7735-dcef-4f5a-9ca4-b6a8f7517522

The report tells you how the execution is going across the whole target set (trimmed response):

{
  "id": "a38f7735-dcef-4f5a-9ca4-b6a8f7517522",
  "request": {
    "name": "REBOOT_EQUIPMENT",
    "parameters": {
      "TYPE": "HARDWARE"
    },
    "active": true,
    "notify": false,
    "user": "user@mail.com"
  },
  "report": {
    "execution": {
      "activatedDate": "2014-03-12T11:43:35Z",
      "startedDate": "2014-03-12T11:43:35Z",
      "finishedDate": "2014-03-12T11:44:52Z"
    },
    "summary": {
      "status": "FINISHED",
      "total": 3,
      "finished": {
        "total": 2,
        "successful": 1,
        "error": 0
      }
    }
  }
}

Where to go next

Subsections of Operations

Jobs

A job is one execution of an operation type over a target set of entities. Creating a job is the normal way to run an operation: you POST a job request, and OpenGate turns it into one operation per target entity.

POST /v80/operation/jobs

Anatomy of a job request

Section Purpose
name The operation type to execute, for example REBOOT_EQUIPMENT.
parameters The parameters of the operation itself. See Operation parameters.
target Which entities the operation runs on.
active Whether the job starts. false creates the job without launching it.
schedule When the job runs and when it gives up.
operationParameters Timeouts and retry policy applied to each individual operation.
notify Whether to notify the operation result by email or trap. Defaults to false.
callback URI to be notified on job progress instead of polling. See Callbacks.
userNotes Free-text notes attached to the job instance.

Selecting the target

There are three ways to reference the entities a job acts on, and they are mutually exclusive — a single job cannot mix entity lists, tags and filters.

An explicit list of entities

"target": { "append": { "entities": ["device_1", "device_2"] } }

The same parametrization is applied to every entity in the list. Two limits apply:

  • Entities per array: 100 by default.
  • Request body size: 300 KBytes by default.

Both are configurable per platform, so check the values with your administrator. To launch an operation over a larger list, create the job with active set to false and use PUT requests to append entities in batches, activating the job in the last call.

A tag

"target": { "append": { "tags": ["fleet_north"] } }

Only one tag name can be passed. OpenGate resolves the tag into the target set and builds the internal structure of the job; when that work finishes the job waits in IDLE if it is not active, or in SCHEDULED if it is.

A filter

"target": { "append": { "filter": { "eq": { "device.model": "MDL-1" } } } }

The filter is evaluated by the platform to resolve the target set. Previously created filters cannot be reused here — the filter must be inlined in the request.

The optional resourceType query string parameter restricts the filter to one entity type:

Value Entities considered
entity.device Devices
entity.asset Assets
entity.commsModule Communication modules
entity.subscription Subscriptions
entity.subscriber Subscribers
Filter targets cannot be updated

The target section of a filter-based job cannot be modified afterwards. To change the target set, deactivate the job and create a new one with the new filter.

Scheduling

The schedule block controls when the job runs. start accepts either an exact date or a delayed value in milliseconds; stop sets the deadline after which pending operations are cancelled.

Two optional modes refine how the operations are distributed inside that window.

Window

window restricts execution to given weekdays and a daily time range — useful when field interventions are only acceptable during a maintenance window.

Periods must be whole hours; intermediate periods are rejected:

Window Allowed
"start": "09:00:00Z""stop": "15:00:00Z" Yes
"start": "09:30:00Z""stop": "15:30:00Z" Yes
"start": "09:00:00Z""stop": "15:30:00Z" No

Scattering

scattering spreads the individual operations across the available time instead of firing them all at once. It exists to protect shared infrastructure — typically a mobile operator cell that would collapse if thousands of devices woke up simultaneously.

Field Meaning
maxSpread Percentage (0–100) of the job’s effective time used to spread operations. 0 runs as fast as possible, 100 spreads over the whole window. Default 0.
strategy.field Entity field used to group operations. Currently only subscription.collected.cellInfo.
strategy.factor Dispersion level (0–100) applied within each group. 0 clusters maximally, 100 scatters maximally. Default 0.
strategy.warningMaxRate Speed control in operations per second, to verify the resulting rate stays within maxSpread.

Per-operation timeouts and retries

operationParameters applies to each individual operation, not to the job as a whole:

Field Meaning
ackTimeout Milliseconds to wait for the device to accept the operation. On expiry the operation is cancelled.
timeout Milliseconds to wait for the operation to finish. Default 60000.
retries Number of retries when the operation gets no acknowledgement or times out. Default 0.
retriesDelay Milliseconds between retries.
retryResultList Results that trigger a retry. ERROR_TIMEOUT is always included.
Minimum internal timeout

OpenGate enforces a minimum internal timeout of 40 seconds, so timeout plus ackTimeout must be greater than that. The default of 60 seconds is a good starting point.

Job life cycle

A job’s status reflects the aggregate progress of all its operations:

stateDiagram-v2
    direction TB
    [*] --> IDLE: active=false
    [*] --> SCHEDULED: active=true<br>start delayed
    [*] --> IN_PROGRESS: active=true<br>start now

    IDLE --> SCHEDULED: active=true<br>start delayed
    IDLE --> IN_PROGRESS: active=true<br>start now
    SCHEDULED --> IDLE: active=false
    SCHEDULED --> IN_PROGRESS: start time<br>reached

    IN_PROGRESS --> PAUSED: active=false
    PAUSED --> IN_PROGRESS: active=true

    IN_PROGRESS --> FINISHED: all ok
    IN_PROGRESS --> FINISHED_WITH_ERRORS: with errors
    IN_PROGRESS --> CANCELLING_BY_USER: cancelled<br>by a user
    IN_PROGRESS --> CANCELLING_BY_ENGINE: timeout<br>reached
    SCHEDULED --> CANCELLING_BY_USER: cancelled<br>by a user
    CANCELLING_BY_USER --> CANCELLED: all operations<br>cancelled
    CANCELLING_BY_ENGINE --> TIMEOUT_CANCELLED: all operations<br>cancelled

    FINISHED --> [*]
    FINISHED_WITH_ERRORS --> [*]
    TIMEOUT_CANCELLED --> [*]
    CANCELLED --> [*]
Transition Trigger
Into IDLE The job is created or updated with active set to false.
Into SCHEDULED The job is active and its schedule.start is a date or a delay.
Into IN_PROGRESS The job is active with an immediate start, or the scheduled start time is reached.
IN_PROGRESSPAUSED active set to false on a running job.
PAUSEDIN_PROGRESS active set to true on a paused job.
Into FINISHED Every operation reached a final state successfully.
Into FINISHED_WITH_ERRORS Operations failed or were cancelled.
Into CANCELLING_BY_USER A user cancels the job, through the console or the API.
Into CANCELLING_BY_ENGINE The job’s timeout is reached, so the platform cancels it.
Into CANCELLED Every entity operation of a user-cancelled job finished cancelling.
Into TIMEOUT_CANCELLED The same, for a job the timeout cancelled.

Both cancelling states are transient: the job stays there until every one of its operations has finished cancelling, which on a job targeting thousands of entities is not instant.

One detail still unconfirmed

The specification defines what each state means but not which terminal state the engine path ends in. The pairing above — a user cancellation ending in CANCELLED, a timeout ending in TIMEOUT_CANCELLED — follows from their descriptions and is pending confirmation.

See the status reference for the complete list of job, operation and step values.

Reading the result

An execution involves as many entities as the target references, so one job explodes into many results. The API exposes both levels:

flowchart LR
    JOB["Job"] --> SUM["report.summary<br>one aggregated view<br>counters per state"]
    JOB --> RES["operations<br>one result per entity<br>status, result, steps"]
Endpoint Returns
GET /v80/operation/jobs/{jobId} The job request plus report.summary
GET /v80/operation/jobs/{jobId}/operations Paginated per-entity results
GET /v80/operation/jobs/{jobId}/operations/{id} A single entity’s result

The per-entity list is paginated with start and size parameters — necessary when a job targets thousands of entities. Each operation object carries its own status, result, description and steps array.

To be notified when the job starts and when it finishes instead of polling these endpoints, configure a callback.

Updating a job

PUT /v80/operation/jobs/{jobId}

A job can only be modified while active is false and it has not started. What you can change:

  • Request fields: active, notify, callback, userNotes, schedule.start, schedule.stop.
  • The target entity list, by appending or removing entities.

The same JSON size limit as in creation applies. In the last PUT, set active to true to start the execution.

Pause and resume

The same endpoint controls a running job through the active field:

  • Pause: set active to false on a job in IN_PROGRESS. The job moves to PAUSED. While paused, the job’s features cannot be modified.
  • Resume: set active to true on a paused job. The job returns to IN_PROGRESS.

Cancelling a job

DELETE /v80/operation/jobs/{jobId}

The job moves to CANCELLING_BY_USER first — or to CANCELLING_BY_ENGINE when the platform itself cancels it — and to CANCELLED once all of its operations are cancelled.

Cancellation does not roll back

Cancelling a job does not undo steps that already executed on the devices. A firmware update cancelled halfway leaves the device halfway. Be deliberate.

Searching jobs and operations

Job and operation searches follow the platform’s standard search pattern, with support for filtering, sorting, field selection and summaries:

POST /v80/search/jobs
POST /v80/search/jobs/summary
POST /v80/search/entities/devices/operations
POST /v80/search/entities/operations/history

Equivalent endpoints exist for subscribers and subscriptions. Results are returned as JSON by default, or as CSV through HTTP header options. The full parameter list is in the API reference.

Tasks

A task is a schedule that creates jobs. Where a job runs an operation once, a task runs it again and again — every night, every Monday, the first day of every month — creating one job per execution.

POST /v80/operation/tasks

A task wraps a complete job request in its job.request field, so everything you know about jobs applies: the operation name, its parameters, the target, the per-operation timeouts and the callback. What the task adds on top is when and how often.

flowchart LR
    T["Task<br>schedule + job template"] --> J1["Job<br>run 1"]
    T --> J2["Job<br>run 2"]
    T --> JN["Job<br>run N"]
    J1 --> O1["operations<br>per entity"]
    J2 --> O2["operations<br>per entity"]
    JN --> ON["operations<br>per entity"]

The task schedule

Field Purpose
schedule.start First execution. Defaults to now when omitted.
schedule.stop When to stop: a date, a number of executions, or nothing at all — which means forever.
schedule.repeating.period Repeat every n time units.
schedule.repeating.pattern Repeat on a calendar pattern: weekly, monthly or yearly.
active When false, no jobs are launched.
state Current task state: ACTIVE, INACTIVE, FINISHED, CANCELLING, CANCELLED.

Repeating by period

period repeats on a fixed interval — each time units of unit, where unit is one of SECONDS, MINUTES, HOURS or DAYS.

Repeating by calendar pattern

pattern targets specific calendar positions, optionally pinned to a time of day in hh:mm:ssTZD format:

Pattern Fields Values
weekly days MON, TUE, WED, THU, FRI, SAT, SUN — at least one
monthly day, months Day 131; months JANDEC
yearly day, months Day 131; months JANDEC

Example: a reboot every Monday and Wednesday at 10:30 UTC, stopping after 10 executions.

{
  "task": {
    "id": "task_1",
    "name": "task_1_name",
    "description": "example task request",
    "active": true,
    "schedule": {
      "start": { "date": "2010-12-11T10:10:00Z" },
      "stop": { "executions": 10 },
      "repeating": {
        "period": { "each": 7, "unit": "DAYS" },
        "pattern": {
          "time": "10:30:00Z",
          "weekly": { "days": ["MON", "WED"] }
        }
      }
    },
    "job": {
      "request": {
        "name": "REBOOT_EQUIPMENT",
        "parameters": { "TYPE": "HARDWARE" },
        "schedule": { "stop": { "delayed": 300000 } },
        "notify": true,
        "operationParameters": {
          "ackTimeout": 5000,
          "timeout": 60000
        },
        "target": { "append": { "entities": ["device_1", "device_2"] } }
      }
    }
  }
}
Scheduling the job of a task

Inside job.request.schedule, the only valid form of start and stop is delayed — an exact date cannot be used, because the task itself decides when each job starts.

If id is omitted at creation, OpenGate generates a UUID. If provided, it must be unique.

Selecting the target

Target selection works exactly as in jobs, inside job.request.target: an explicit list of entities, a tag, or an inlined filter — never a combination of them. The same 300 KByte request size limit applies, and large target lists can be built up with successive PUT requests.

The optional resourceType query string parameter restricts a filter to a single entity type (entity.device, entity.asset, entity.commsModule, entity.subscription, entity.subscriber).

See selecting the target for the full description of the three modes and their limits.

Modifying a task

PUT /v80/operation/tasks/{taskId}

Changes apply to the next executions of the task, never to the job that is already running. This includes appending or removing target entities.

Listing the jobs created by a task

GET /v80/operation/tasks/{taskId}/jobs
GET /v80/tasks/{taskId}/entities

The first endpoint returns the jobs the task has produced, which is how you audit a recurring operation over time. Each of those jobs is read exactly like a standalone job.

Cancelling a task

DELETE /v80/operation/tasks/{taskId}

The task is marked CANCELLED. If the cancellation arrives while one of its jobs is running, the task stays in CANCELLING until that job finishes cancelling all of its operations.

Cancellation does not roll back

As with jobs, cancelling a task does not undo steps already executed on the devices.

Searching tasks

POST /v80/search/tasks

Tasks are searchable with the platform’s standard filter, sort and select clauses. Every field of the task object is available as a filter field, prefixed with tasks. — for example tasks.schedule.repeating.period.unit or tasks.job.request.name. See the API reference for the complete list.

Operation parameters

Parameters are what turn a generic operation type into a concrete instruction: not just reboot, but reboot the hardware; not just update, but install bundle 1.0.

There are two distinct parameter blocks in a job request, and confusing them is a common mistake:

Block Configures Defined by
parameters The operation itself — what the device must do The operation type’s JSON schema
operationParameters How the platform manages the execution — timeouts, retries The platform, identical for every operation type. See Jobs

Declaring parameters with JSON schema

As an operations administrator you declare an operation’s parameters with JSON Schema when creating or editing an operation type. JSON Schema gives you the whole range from a single enumerated string to nested objects and arrays, with validation and defaults.

Taking REBOOT_EQUIPMENT from the catalog as an example, its parameters are declared as:

{
    "type": "object",
    "properties": {
        "type": {
            "type": "string",
            "title": "Reboot Type",
            "enum": [
                "HARDWARE",
                "SOFTWARE"
            ],
            "default": "HARDWARE"
        }
    },
    "additionalProperties": false
}

Three things this declaration buys you:

  • Validation: a job requesting "type": "WARM" is rejected before reaching any device.
  • Defaults: omitting type yields HARDWARE.
  • A usable interface: title is what the OpenGate web console renders when a user launches the operation by hand, so a well-written schema also produces a well-formed form.

Setting additionalProperties to false, as above, rejects unknown parameters instead of silently ignoring them.

Filling parameters in a north API call

Back-office applications pass parameters as a plain JSON object matching the schema:

{
  "job": {
    "request": {
      "name": "REBOOT_EQUIPMENT",
      "parameters": {
        "type": "HARDWARE"
      },
      "active": true,
      "target": {
        "append": {
          "entities": ["device_1"]
        }
      }
    }
  }
}

If the operation type declares no parameters, the block can be omitted entirely.

How parameters reach the device

The platform does not forward your JSON object verbatim. It translates it into the south API format before delivering it to the device, where each parameter travels as a named, typed value inside the operation request.

The exact format the device receives is described in the device integration section. For a complete payload, including nested array parameters, see the update operation example.

Callbacks

Polling a job to know whether it has finished works, but it does not scale and it wastes time. A callback inverts the flow: OpenGate notifies your application over HTTP as the job progresses.

Enabling callbacks

Set the callback field of the job request to the URI you want to be notified on:

{
  "job": {
    "request": {
      "name": "REBOOT_EQUIPMENT",
      "callback": "http://[your_application_address]/[your_URI]",
      "target": { "append": { "entities": ["device_1"] } }
    }
  }
}
  • The URI follows the RFC 3986 format, and only HTTP transport is supported.
  • OpenGate appends the name of the specific callback to this URI when notifying, so a single base URI serves both notifications.
  • The HTTP method is always POST, with the payload as the request body.
  • An empty value disables callback notification.

Callbacks work for tasks too: configure callback inside task.job.request, and every job the task creates will notify.

The two notifications

sequenceDiagram
    participant App as Your application
    participant OG as OpenGate
    participant Dev as Devices

    App->>OG: POST /v80/operation/jobs
    OG-->>App: 201 Created + location
    Note over OG: target set resolved,<br>operations created,<br>schedule reached
    OG->>App: POST callback — job started
    OG->>Dev: operations dispatched
    Dev-->>OG: results per entity
    Note over OG: all operations finished,<br>cancelled or timed out
    OG->>App: POST callback — job finished
Callback Fired when Payload carries
Started The job begins executing — immediately, or when its schedule says so. id, request, report.execution
Finished The job is over: schedule terminated, job cancelled, or all operations completed. id, request, report.execution, report.summary, result with the first page of per-entity operations

Creating a job is not itself notified: the 201 Created response to your POST already tells you the job exists, and report.summary is available from GET /v80/operation/jobs/{jobId} from that moment on.

Job started callback

Fired when execution actually begins. For a scheduled job this happens when the scheduling parameters say so, which may be long after creation:

{
  "job": {
    "id": "33eb9dfa-7a87-41f7-9bad-7b5a26712fec",
    "request": {
      "name": "REBOOT_EQUIPMENT",
      "parameters": {
        "TYPE": "HARDWARE"
      },
      "notify": true,
      "user": "user@mail.com"
    },
    "report": {
      "execution": {
        "activatedDate": "2010-12-20T10:10:00.00Z",
        "startedDate": "2010-12-20T10:10:00.00Z",
        "finishedDate": ""
      }
    }
  }
}

Job finished callback

The most complete of the three. Besides the summary counters it includes the first page of per-entity results, so a small job needs no follow-up request at all. For larger jobs, page through the remaining results with GET /v80/operation/jobs/{jobId}/operations.

{
  "job": {
    "id": "33eb9dfa-7a87-41f7-9bad-7b5a26712fec",
    "request": {
      "name": "REBOOT_EQUIPMENT",
      "parameters": {
        "TYPE": "HARDWARE"
      },
      "notify": true,
      "user": "user@mail.com"
    },
    "report": {
      "execution": {
        "activatedDate": "2014-03-12T11:43:35Z",
        "startedDate": "2014-03-12T11:43:35Z",
        "finishedDate": "2014-03-12T11:44:52Z"
      },
      "summary": {
        "status": "FINISHED",
        "total": 3,
        "inProgress": {
          "total": 0,
          "scheduled": 0,
          "pendingExecution": 0,
          "waitingForConnection": 0,
          "started": 0
        },
        "finished": {
          "total": 2,
          "successful": 1,
          "error": 0,
          "cancelled": {
            "total": 1,
            "byEngine": 0,
            "byUser": 0,
            "byTimeout": 1,
            "byExternalTimeout": 0,
            "byExternal": 0
          }
        },
        "finishedOutOfTime": {
          "total": 1,
          "successful": 1,
          "error": 0
        }
      }
    },
    "result": {
      "page": {
        "number": 1,
        "of": 50
      },
      "operations": [
        {
          "operationId": "86dd3409-6fcd-49d4-be6b-b2fa497207ec",
          "entityId": "device_1",
          "resourceType": "entity.device",
          "name": "REBOOT_EQUIPMENT",
          "parameters": {
            "TYPE": "HARDWARE"
          },
          "notify": true,
          "execution": {
            "activatedDate": "2014-10-01T09:03:42Z",
            "startedDate": "2014-10-01T09:03:45Z",
            "finishedDate": "2014-10-01T09:04:45Z"
          },
          "user": "user@mail.com",
          "status": "FINISHED",
          "result": "SUCCESSFUL",
          "description": "successful operation",
          "steps": [
            {
              "name": "RESET",
              "result": "SUCCESSFUL",
              "description": "Reset ok",
              "timestamp": "2012-09-27T16:46:02.10Z"
            }
          ]
        },
        {
          "operationId": "29891afd-5f4f-4b23-800e-586bd4ecb0eb",
          "entityId": "device_2",
          "resourceType": "entity.device",
          "name": "REBOOT_EQUIPMENT",
          "parameters": {
            "TYPE": "HARDWARE"
          },
          "notify": true,
          "execution": {
            "activatedDate": "2014-10-01T09:03:42Z",
            "startedDate": "2014-10-01T09:03:45Z",
            "finishedDate": "2014-10-01T09:04:45Z"
          },
          "user": "user@mail.com",
          "status": "FINISHED",
          "result": "SUCCESSFUL",
          "description": "successful operation",
          "steps": [
            {
              "name": "RESET",
              "result": "SUCCESSFUL",
              "description": "Reset ok",
              "timestamp": "2012-09-27T16:46:02.10Z"
            }
          ]
        }
      ]
    }
  }
}

Note that a job reaching the finished callback is not necessarily a job that succeeded: in this example status is FINISHED, but of the three operations one was cancelled by timeout and one finished out of time. Always read the counters, not just the status. See the status reference for what each value means.

Notifications versus callbacks

callback and notify are different mechanisms and can be used together:

Field Recipient Purpose
callback Your application, over HTTP Machine-to-machine job progress notification
notify The platform’s notification channels (email, trap) Human notification of the operation result

Execution flows

Everything on the jobs and tasks pages describes the north side of the service, the API your back-office application talks to. This page explains what happens on the south side, between OpenGate and the device — because that is what determines how long an operation takes, what progress you can observe, and why an operation can sit in WAITING_FOR_CONNECTION for hours.

Every operation has at least a minimum workflow to be fulfilled. Beyond that minimum, the flow depends on what the device is capable of.

Who starts the conversation

Flow Who initiates When it fits
Platform-driven OpenGate contacts the device The device is reachable and exposes an endpoint
Device-driven The device asks OpenGate for pending operations The device sleeps, sits behind NAT, or has no public address

Device-driven operations are why an operation may report WAITING_FOR_CONNECTION: the work is queued and waiting for the device to show up.

Platform-driven flows

Synchronous

The whole operation is resolved in a single HTTP request and response. The device does the work and answers with the final result:

sequenceDiagram
    participant OG as OpenGate
    participant Dev as Device
    OG->>Dev: Operation request (HTTP POST)
    Note over Dev: executes the operation
    Dev-->>OG: Final response with result and steps (HTTP 201)

Simple and cheap, but it holds the connection for the whole execution — unsuitable for anything slow, such as a firmware download.

Asynchronous with a simple response

The device acknowledges the request immediately and reports the result later, in a request of its own:

sequenceDiagram
    participant OG as OpenGate
    participant Dev as Device
    OG->>Dev: Operation request (HTTP POST)
    Dev-->>OG: ACK (HTTP response)
    Note over Dev: executes the operation
    Dev->>OG: Response notification with result (HTTP POST)
    OG-->>Dev: ACK (HTTP 200)

Asynchronous with multiple responses

The device reports partial progress as it goes, and closes with a final response. This is what makes a long operation observable:

sequenceDiagram
    participant OG as OpenGate
    participant Dev as Device
    OG->>Dev: Operation request (HTTP POST)
    Dev-->>OG: ACK (HTTP response)
    Dev->>OG: Partial response — STEP in progress (HTTP POST)
    OG-->>Dev: ACK (HTTP 200)
    Dev->>OG: Partial response — next STEP (HTTP POST)
    OG-->>Dev: ACK (HTTP 200)
    Dev->>OG: Final response — last STEP and result (HTTP POST)
    OG-->>Dev: ACK (HTTP 200)

Each partial response updates the operation’s steps array, so a north API client polling the job — or receiving callbacks — sees the progress accumulate.

Device-driven flow

The device polls OpenGate for work, executes what it gets, and reports back:

sequenceDiagram
    participant Dev as Device
    participant OG as OpenGate
    Dev->>OG: Ask for pending operations (HTTP GET)
    OG-->>Dev: Pending operation request
    Note over Dev: executes the operation
    Dev->>OG: Response notification with result (HTTP POST)
    OG-->>Dev: ACK (HTTP 200)

Single-step versus multi-step operations

The flow strategy above is about transport. Independently of it, an operation is either atomic or composed of steps:

Structure What the device reports Observability
Simple request/response One result, no intermediate stages Success or failure, nothing in between
Multi-step A declared list of steps, each with its own result and timestamp Progress while the operation runs

A multi-step operation can report all its steps in one response, or spread them across partial responses until the final step is reached. The step list belongs to the operation type definition: it is declared once, and every execution reports against it.

Where to go from here

The diagrams above are summaries. The complete south API — endpoints, ports, request and response schemas, security requirements and the full flow diagrams — lives in the device integration section:

For a real multi-step flow end to end, see the update operation example.

Status reference

Every value OpenGate can report about an operation, in one place. Use this page when you are reading a job report, a per-entity result or a callback payload and need to know what a value means.

Three levels report status independently, and they answer different questions:

flowchart LR
    J["Job status<br>how is the whole execution going?"] --> O["Operation status and result<br>what happened on this entity?"]
    O --> S["Step results<br>which stages ran, and how?"]

Job status

The aggregate state of a job, in report.summary.status. See the job life cycle for the transitions between them.

Value Meaning
IDLE The job has been created but not started, because it is not active.
SCHEDULED The job is active and waiting for its scheduled start.
IN_PROGRESS The job has started.
PAUSED The job has been paused by setting active to false while running.
FINISHED All operations in the job have finished.
FINISHED_WITH_ERRORS The job finished with errors. Some operations may have succeeded while others failed or were cancelled, or all of them may have failed. errorCode and errorDescription are present in the summary.
TIMEOUT_CANCELLED The job was cancelled because the maximum timeout defined expired.
CANCELLING_BY_USER A user cancelled the job, and it is still cancelling its operations.
CANCELLING_BY_ENGINE The job’s timeout was reached, and it is still cancelling its operations.
CANCELLED The job and all of its operations have been cancelled.
Cancellation records who caused it

There is no plain CANCELLING: a job in the middle of cancelling always reports which side started it, CANCELLING_BY_USER or CANCELLING_BY_ENGINE. The two differ in cause, not in mechanics — a user asked, or the timeout ran out — and the same distinction appears at operation level in the finished.cancelled counters.

Operation status

The state of the operation on one entity, in each element of the operations list.

Value Meaning
PENDING The operation is pending to be started.
QUEUED The operation has been launched but has not reached the device yet.
WAITING_FOR_ACK The operation is waiting for an acknowledgement from the device to be started.
WAITING_FOR_CONNECTION The operation is waiting for the device to connect, when that option is enabled.
IN_PROGRESS The operation has started and is waiting for completion.
FINISHED The operation has been completed.
FINISHED_OUT_OF_TIME The operation finished and its result was collected, but outside the allowed time.
TIMEOUT_CANCELLED The operation was cancelled because the maximum timeout defined expired.
NOT_ALLOWED The operation cannot be executed over this entity.
CANCELLED The operation has been cancelled.

Operation result

Why an operation ended the way it did, in the result field. A FINISHED status with a non-successful result is normal: the execution completed, the outcome was negative.

Value Meaning
SUCCESSFUL The operation completed with success.
PARTIAL_SUCCESS The operation completed with partial success.
OPERATION_PENDING The operation is queued to be executed.
ERROR_IN_PARAM The operation cannot be executed because of an error in the parameters passed.
NOT_ALLOWED The operation execution is not allowed for this entity.
NOT_SUPPORTED The operation is not supported by the entity.
ALREADY_IN_PROGRESS The operation is already being executed.
ERROR_PROCESSING The operation finished with an unknown error.
ERROR_TIMEOUT The operation could not be completed because the device response timed out.
TIMEOUT_CANCELLED The operation was cancelled because the maximum timeout defined expired.
CANCELLED The operation was cancelled by a user or through the API.
CANCELLED_INTERNAL The operation was cancelled by the internal engine. Consult your platform administrator.
UNKNOWN_RESULT The operation returned a result the platform does not recognize. Consult your platform administrator.
Retry policy

Any of these results can be listed in the job’s operationParameters.retryResultList to trigger a retry. ERROR_TIMEOUT is always part of that list, whether you include it or not.

Step result

Each element of an operation’s steps array carries a name, a timestamp, an optional description, an optional response, and one of:

Value Meaning
SUCCESSFUL The step completed successfully.
ERROR The step failed.
SKIPPED The step was skipped.
NOT_EXECUTED The step did not run.

Not every declared step appears in every execution: a device only reports the steps it actually goes through. See execution flows for how steps are reported.

Task state

The state of a task, in its state field.

Value Meaning
ACTIVE The task is launching jobs according to its schedule.
INACTIVE The task exists but launches no jobs, because active is false.
FINISHED The task reached its stop condition — its end date or its number of executions.
CANCELLING The task has been cancelled and one of its jobs is still finishing.
CANCELLED The task has been cancelled.

Job summary counters

report.summary counts the operations of a job by state. The counters are what tell you whether a FINISHED job actually did what you wanted.

Counter Contains
total Total operations attempted.
inProgress.total Operations not finished yet.
inProgress.scheduled Operations scheduled but not launched.
inProgress.pendingExecution Operations queued for execution.
inProgress.waitingForConnection Operations waiting for the device to appear.
inProgress.started Operations already started.
finished.total Operations that reached a final state.
finished.successful Operations that finished successfully.
finished.error Operations that finished with an error.
finished.cancelled.total Cancelled operations, broken down by cause below.
finished.cancelled.byUser Cancelled by a user or through the API.
finished.cancelled.byEngine Cancelled by the platform engine.
finished.cancelled.byTimeout Cancelled because the operation timeout expired.
finished.cancelled.byExternalTimeout Cancelled because an external system timed out.
finished.cancelled.byExternal Cancelled by an external system.
finished.cancelled.byAlreadyInProgress Cancelled because the same operation was already running on that entity.
finishedOutOfTime.total Operations whose result arrived outside the allowed time.
finishedOutOfTime.successful Of those, the ones that succeeded.
finishedOutOfTime.error Of those, the ones that failed.
errorCode, errorDescription Present only when the job status is FINISHED_WITH_ERRORS.

Every counter above is also available as a search filter field, prefixed with jobs.report.summary. — so you can query, for example, all jobs with jobs.report.summary.finished.cancelled.byTimeout greater than zero. See the API reference for the complete field list.

Operation types

An operation type is the definition of an action: its name, its title and description, the entity types it applies to, its parameter schema and its steps. Nothing can be executed until an operation type for it exists in your organization.

There are two ways to get one:

  • Clone it from the platform catalog, for the operations OpenGate already implements. See the default operations catalog.
  • Create it from scratch, for actions specific to your devices.
Only your organization’s types are executable

Operation types from the platform catalog that have not been cloned into your organization cannot be executed. The catalog is a source to inherit from, not a set of ready-to-run operations.

Resource Contains
/v80/operationTypes/catalog The platform catalog, available to be cloned
/v80/operationTypes/provision/organizations/{organization} Your organization’s own operation types

What the API does

  • Retrieve the list of operations available to be cloned.
  • Create operations for an organization, either by cloning from the catalog or from scratch.
  • Retrieve a single operation from the catalog by name.
  • Update an operation previously created.
  • Delete an operation previously created.
  • Search the operations of an organization using the platform’s filters.
Viewer profile

GET and SEARCH are the only actions available to the viewer profile.

Creating an operation type

The response returns a location header with the URL of the new resource.

When the operation is cloned from the catalog, only name, description and title can be modified — the parameter schema, the steps and the applicability of a catalog operation are fixed. When created from scratch, you define all of it, including the parameter schema.

Restricting execution by profile

The optional profiles list names the user profiles authorized to execute the operation. By default, every profile except viewer can execute custom operations.

Available profile names:

  • advanced
  • admin_domain
  • super_admin_domain
  • admin
  • root

The list can be set at creation time or updated later. If omitted, the default access rules apply. Invalid profiles return 400 Bad Request with error detail; viewer is never permitted and also returns 400 if included.

Updating an operation type

For operations derived from the catalog, only name, description and title can be modified.

Searching operation types

Five filter fields are available, all optional:

Filter Selects by
name Operation name
applicableTo Entity type the operation applies to
models Device models the operation supports
fromCatalog Whether the operation was cloned from the platform catalog
profile Profiles authorized to execute it
Extended operation fields

Any parameter of the ExtendedOperation object can also be used as a filter field in operationTypes searches.

Usage examples

Read the operation types catalog:

curl --request GET \
     --header "X-ApiKey: <your-api-key>" \
     https://www.amplia-iiot.com/v80/operationTypes/catalog

Read a single operation type of your organization by its name:

curl --request GET \
     --header "X-ApiKey: <your-api-key>" \
     https://www.amplia-iiot.com/v80/operationTypes/provision/organizations/{organizationName}/REBOOT_EQUIPMENT

API specification

Default operations catalog

OpenGate ships a catalog of operations covering the actions devices commonly implement: reboots, factory resets, firmware and configuration updates, diagnostics, parameter reads and writes, clock setting, communications control. Each entry below is a definition you can clone into your organization as an operation type.

Name Description Applicable to Steps
ADMINISTRATIVE_STATUS_CHANGE Allows to change the administrative status of an entity
  • entity.device
  • entity.subscription
  • entity.subscriber
CONFIGURE_CONSOLE_PARAMETERS Configure the Console Parameters
  • entity.device
CONFIGURE_SECTIONALIZER_PARAMETERS Configure the Sectionalizer Parameters
  • entity.device
CONFIGURE_SECTIONALIZERS Configure a list of Sectionalizers
  • entity.device
EQUIPMENT_DIAGNOSTIC Equipment auodiagnostic
  • entity.device
FACTORY_RESET Remote factory reset
  • entity.device
GET_DEVICE_PARAMETERS Allows obtain values of a list of variables
  • entity.device
IoTAdeunis_set_parameters Set IoTAdeunis parameter
IoTAtimTM_set_parameters Set IoTAtimTM parameters
POWER_OFF_EQUIPMENT Powers offs equipment on target entity
  • entity.device
POWER_ON_EQUIPMENT Remote turn on
  • entity.device
REBOOT_EQUIPMENT Allows remotely reboot CHs
  • entity.device
REFRESH_INFO On demand retrieving the Info
  • entity.device
  • entity.subscription
  • entity.subscriber
REFRESH_LOCATION On demand retrieving the location
  • entity.device
REFRESH_PRESENCE On demand retrieving the Presence
  • entity.device
  • entity.subscription
RESET_COMMUNICATIONS reset a communications channel
  • entity.device
SEND_COMMAND Send a command to an entity
  • entity.device
SET_CLOCK_EQUIPMENT Allows to set to date the device internal clock
  • entity.device
SET_DEVICE_PARAMETERS Allows set values of a list of variables
  • entity.device
SHUT_DOWN_COMMUNICATIONS disable a specific communications channel
  • entity.device
SIM_REPLACEMENT
  • entity.subscription
STATUS_DIAGNOSTIC Remote factory reset
  • entity.device
  • entity.subscription
UPDATE Device Firmware, Software and Configuration Update
  • entity.device
WAKE_UP_COMMUNICATIONS enable a specific communications channel
  • entity.device

Take into consideration that:

  • Catalog entries must be cloned into your organization before they can be executed. See operation types.
  • The operations available in your organization can differ from the list above. OpenGate administrators can enable more operations or disable some of them.
  • The SMS capability is only available for the on-premise solution, and requires integration with an external service provider.

Besides this list, new operation types can be created from scratch to adapt OpenGate to specific solution needs.

Examples

Worked examples of complete operations. Each one shows the JSON documents exchanged through the north API, used by back-office applications, and through the south API, used by devices — so you can see how a single job request turns into what the device actually receives.

Subsections of Examples

Update operation

Software and firmware update is the most complete operation OpenGate models: it is long-running, multi-step, and its progress matters as much as its outcome. It is therefore a good example of the asynchronous flow with multiple responses.

Flow diagram

OpenGate suggests a complete flow covering all the possible stages of a device update. In the real world a device may implement only part of these steps — any number and kind of steps implemented by your device is supported.

sequenceDiagram
    participant OG as OpenGate connector
    participant Dev as Device

    OG->>Dev: Operation request (HTTP POST)
    Dev-->>OG: Response ACK (HTTP 200 OK)

    Note over OG,Dev: the device reports progress,<br>one notification per step

    Dev->>OG: STEP DOWNLOADFILE (0%)
    OG-->>Dev: ACK (HTTP 200 OK)
    Dev->>OG: STEP DOWNLOADFILE (x%)
    OG-->>Dev: ACK (HTTP 200 OK)
    Dev->>OG: STEP DOWNLOADFILE (100%)
    OG-->>Dev: ACK (HTTP 200 OK)
    Dev->>OG: STEP BEGINPREACTION
    OG-->>Dev: ACK (HTTP 200 OK)
    Dev->>OG: STEP ENDPREACTION
    OG-->>Dev: ACK (HTTP 200 OK)
    Dev->>OG: STEP BEGINPOSTACTION
    OG-->>Dev: ACK (HTTP 200 OK)
    Dev->>OG: STEP ENDPOSTACTION
    OG-->>Dev: ACK (HTTP 200 OK)
    Dev->>OG: STEP BEGININSTALL
    OG-->>Dev: ACK (HTTP 200 OK)
    Dev->>OG: STEP ENDINSTALL
    OG-->>Dev: ACK (HTTP 200 OK)
    Dev->>OG: STEP ENDUPDATE
    OG-->>Dev: ACK (HTTP 200 OK)

Each notification is an HTTP POST from the device carrying the operation response, and each ACK is OpenGate’s HTTP 200 reply. Every notification updates the operation’s steps array, so the north API sees the download percentage advance in real time.

The UPDATE operation type declares the following steps: ACCEPTED, BEGINUPDATE, DOWNLOADFILE, BEGINPREACTION, ENDPREACTION, BEGININSTALL, ENDINSTALL, BEGINPOSTACTION, ENDPOSTACTION and ENDUPDATE. See the status reference for the results a step can report.

North API invocation

Back office applications invoke device update operations through the ordinary jobs API — everything you know about jobs applies. What is specific to updates is the operation name and its parameters:

Device Update Example

{
    "job" :
    {
        "request" : {
            "name" : "UPDATE",
            "parameters": [
                {
                    "name" : "bundleName",
                    "type":"string",
                    "value" : {
                        "string" : "bundle_1"
                    }
                },
                {
                    "name" : "bundleVersion",
                    "type":"string",
                    "value" : {
                        "string" : "1.0"
                    }
                }
            ],
            "active" : true,
            "notify" : true,
            "callback" : "http://[your_application_address]/[your_URI]",

            "schedule" : {
                "start" : {
                  "date" : "2012-09-10T12:33:43Z"
                },
                "stop" : {
                  "delayed" : 300000
                }
            },
            "operationParameters" : {
                "ackTimeout" : 5000,
                "timeout" : 6000,
                "retries" : 0,
                "retriesDelay" : 1000,
                "retryResultList" : ["ERROR_PROCESSING"]
            },
            "target" : {
                "append" : {
                    "entities" : [ "device_1", "device_2" ]
                }
            }
        }
    }
}

South API invocation

This is the document the device receives from the platform. The deploymentElements array is what makes an update different from any other operation: it tells the device what to download, where to put it, in which order, and how to verify it.

See the device integration section for the endpoints and transport details:

Device Update Example

{
    "operation": {
        "request": {
            "timestamp": 1453822201099,
            "name": "UPDATE",
            "parameters": [
                {
                    "name": "bundleName",
                    "value": {
                        "string": "bundle_1"
                    }
                },
                {
                    "name": "bundleVersion",
                    "value": {
                        "string": "version_1"
                    }
                },
                {
                    "name": "deploymentElements",
                    "value": {
                        "array": [
                            {
                                "type": "FIRMWARE",
                                "downloadUrl": "http://[your_opengate_address]/bundles/74427c0c-a28c-4765-92ef-30010adb733d/1002/firmware-1_1.1.bin",
                                "path": "/home",
                                "order": 1,
                                "operation": "INSTALL",
                                "option": "OPTIONAL",
                                "validators": [
                                    {
                                        "type": "SHA-256",
                                        "value": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
                                    }
                                ],
                                "size": 18
                            }
                        ]
                    }
                }
            ],
            "id": "072b08d1-0fcb-4a0c-a2d8-99773f9b9327"
        }
    }
}

API reference

The complete specification of the operations service: creating, reading, updating and cancelling jobs and tasks, retrieving per-entity operation results, and searching jobs, tasks and operation history.

Endpoint group Purpose
/v80/operation/jobs Create, read, update and cancel jobs
/v80/operation/jobs/{jobId}/operations Per-entity operation results of a job
/v80/operation/tasks Create, read, update and cancel tasks
/v80/operation/tasks/{taskId}/jobs Jobs produced by a task
/v80/search/jobs, /v80/search/tasks Search jobs and tasks, with summary variants
/v80/search/entities/{type}/operations Search operations by entity type
/v80/search/entities/operations/history Search historical operations

Data formats

OpenGate uses JSON as the interchange format in its RESTful interface.

Numbers

A number is an integer or a double-precision float. The property name is a string in double quotes, the value is not quoted:

Example property Value
time 1356695180301
value 299.99
maxValue 1.23e11
minValue -10.5

A number can be prefixed with a minus sign. The exponent portion, denoted by e or E, comes after the value and may carry an optional sign. Leading zeroes, octal and hexadecimal values are not allowed.

Dates

Dates and times follow ISO 8601:2004, and UTC is the time standard for all dates. The full format is YYYY-MM-DDThh:mm:ss.sTZD, for example 2021-07-16T19:20:30.00+01:00, as described in the ISO 8601 standard and in Date and Time Formats of W3C.

Precision Format Example
Year YYYY 2015
Year and month YYYY-MM 2015-10
Complete date YYYY-MM-DD 2015-10-06
Date plus hours and minutes YYYY-MM-DDThh:mm 2015-10-06T17:35
Date plus hours, minutes and seconds YYYY-MM-DDThh:mm:ss 2015-10-06T17:35:21
Date plus fraction of a second YYYY-MM-DDThh:mm:ss.s 2015-10-06T17:35:21.45
  • YYYY — four-digit year
  • MM — two-digit month, 01 for January
  • DD — two-digit day of month, 01 to 31
  • hh — two-digit hour, 00 to 23; am/pm is not allowed
  • mm — two-digit minute, 00 to 59
  • ss — two-digit second, 00 to 59
  • s — one or more digits for the decimal fraction of a second

Specification

Debugging

Two features of OpenGate let you run your own JavaScript inside the platform: connector functions, which translate what devices say, and rules, which react to what arrives. Both run server-side, on events you did not trigger, which makes the usual debugging reflexes useless — there is no console to watch.

This section is that console.

How it works

flowchart LR
    JS["Your JavaScript<br>connector function or rule"] -->|"logger.info(...)"| SVC["Functions logger<br>service"]
    SVC -->|"WebSocket stream"| YOU["Your terminal<br>or application"]

    classDef mine fill:#addcf8,stroke:#2b7cb8,color:#000
    class JS mine

Two halves, one page each:

Half What it is Page
Writing The logger object your script calls: trace, debug, info, warn, error JS Logging API
Reading A WebSocket you open to stream those traces live, filtered by level Functions Logger Service

It covers rules too

The service exposes one endpoint family per subject, and the only difference is the path and the identifier:

Subject Endpoint Identifier
Connector functions .../functions-logger/connectorFunctions/organizations/{org}/channels/{channel}/{cf-id} The connector function id
Rules .../functions-logger/rules/organizations/{org}/channels/{channel}/{rf-id} The rule id

Everything else — the mandatory X-ApiKey parameter, the level filter and the message format — is identical for both. See Functions Logger Service for the complete URIs.

Debugging in practice

A workflow rather than a list of features:

  1. Start with the script disabled. A connector function’s operationalStatus exists precisely so a half-written script never touches production devices: create it DISABLED, move to TEST against a test device, and only then to PRODUCTION.
  2. Log the inputs you did not expect, not the ones you did. The payload your script receives is whatever the device really sent, which is rarely what the datasheet promised.
  3. Subscribe at TRACE while you iterate, then raise the level. Each level includes the ones above it: WARN delivers ERROR and WARN, and nothing below.
  4. Remember the REST API barely parses your JavaScript. A script that was accepted at creation can still fail at runtime, and this is where you find out.
Levels filter delivery, not writing

level controls what the service sends you, not what your script writes. Leaving logger.trace calls in place costs nothing once you stop subscribing at TRACE, so there is no reason to strip them out when you are done debugging.

Subsections of Debugging

Functions Logger Service

Logger Websocket endpoints

Connector functions logger feature is available on this URL: wss://api.opengate.es/north/functions-logger/connectorFunctions/organizations/{organization_name}/channels/{channel_name}/{cf-id}

Rules logger feature is available on this URL: wss://api.opengate.es/north/functions-logger/rules/organizations/{organization_name}/channels/{channel_name}/{rf-id}

Websocket requires mandatory X-ApiKey url parameter to work

Another parameter to be set is logging level, used to define which traces must be sent to the client. This parameter is not mandatory and by default the INFO level will be used.

Here is a complete URI example for the connector functions logger:

wss://api.opengate.es/north/functions-logger/connectorFunctions/organizations/{organization_name}/channels/{channel_name}/{cf-id}?X-ApiKey={your-api-key}&level={logging-level}

Where:

  • organization_name: Organization name.
  • channel_name: Channel name.
  • cf-id: Connector function identifier.
  • your-api-key: API key of a valid user with permissions over the defined function.
  • logging-level: Specify logging granularity. Valid logging levels: ERROR, WARN, INFO, DEBUG, TRACE. If incorrect value is defined, INFO level will be used by Functions Logger service. Same level or higher level messages will be received. For example if WARN is defined in the path, ERROR and WARN traces will be received, but not INFO, DEBUG or TRACE.

After opening Websocket connection, the client will receive log messages with following format:

{
    "message": "message.",
    "level": "INFO",
    "timestamp": 1607108000000
}

Where

  • message: Printed trace in connector function.
  • level: Trace level. Possible values: ERROR, WARN, INFO, DEBUG, TRACE.
  • timestamp: Trace UTC timestamp in milliseconds.

JS Logging API

JS API guide for logging

This file provides methods to write logging traces.

Logger Object

The logger object is the main object for logging functions.

logger.trace(…msg)

Creates TRACE level logging messages. It concatenates msg parameters to compound message to be logged.

Kind: global function
Returns: Void

Param Type Description
…msg any The function takes as parameters a list of elements to be concatenated to generate the string message to be printed.

Example of use:

logger.trace('Operation sent to', host_var, ' and port ', port_var, '. Operation content: ', operation_var);

logger.debug(…msg)

Creates DEBUG level logging messages. It concatenates msg parameters to compound message to be logged.

Kind: global function
Returns: Void

Param Type Description
…msg any The function takes as parameters a list of elements to be concatenated to generate the string message to be printed.

Example of use:

logger.debug('Operation sent to', host_var, ' and port ', port_var, '. Operation content: ', operation_var);

logger.info(…msg)

Creates INFO level logging messages. It concatenates msg parameters to compound message to be logged.

Kind: global function
Returns: Void

Param Type Description
…msg any The function takes as parameters a list of elements to be concatenated to generate the string message to be printed.

Example of use:

logger.info('Operation sent to', host_var, ' and port ', port_var, '. Operation content: ', operation_var);

logger.warn(…msg)

Creates WARN level logging messages. It concatenates msg parameters to compound message to be logged.

Kind: global function
Returns: Void

Param Type Description
…msg any The function takes as parameters a list of elements to be concatenated to generate the string message to be printed.

Example of use:

logger.warn('Operation sent to', host_var, ' and port ', port_var, '. Operation content: ', operation_var);

logger.error(…msg)

Creates ERROR level logging messages. It concatenates msg parameters to compound message to be logged.

Kind: global function
Returns: Void

Param Type Description
…msg any The function takes as parameters a list of elements to be concatenated to generate the string message to be printed.

Example of use:

logger.error('Error connecting to host ', host_var, ' and port ', port_var, '. Stop processing');

Device integration

This is the south side of the platform: everything that happens between OpenGate and the things in the field. Where the north APIs are consumed by your applications, these are spoken by devices, gateways, sensors and machines.

The two conversations

Every integration comes down to two of them, in opposite directions:

flowchart LR
    DEV["Device"] -->|"data collection<br>pushes readings"| OG["OpenGate"]
    OG -->|"operations<br>asks for actions"| DEV
Conversation The device Documented in
Data collection Pushes inventory and business data: serial number, ICC, MSISDN, location, temperature, pressure, consumption HTTP · MQTT
Operations Receives operation requests and answers with the result HTTP · MQTT

The north side of operations — how an application launches them and reads the results — is in Operations.

Eleven protocols, two directions

OpenGate speaks eleven protocols, and the question that decides your architecture is which side opens the conversation:

Protocols The device needs
The device calls OpenGate HTTP · MQTT · WebSocket · CoAP · DLMS Outgoing connectivity only
OpenGate calls the device DLMS · DLMS Gas · IEC102 · SNMP · SSH · Telnet · ICMP To be reachable at an IP address

Plus RADIUS, where the counterpart is the operator’s network rather than a device.

Supported protocols is the full matrix: every protocol, who initiates, what it carries and where its documentation lives. Start there if you are deciding how to connect something.

Where to go For
HTTP · MQTT · WebSocket · CoAP The transports OpenGate listens on
Meter and industrial protocols DLMS, DLMS Gas, IEC102 and SNMP: the polling model
Remote access SSH, Telnet and ICMP
RADIUS accounting Network-side session reporting

When the device does not fit

Real fleets are not uniform. Two mechanisms absorb that:

  • Connector Functions let you run your own JavaScript inside the platform to translate between OpenGate and whatever the device actually speaks. This is the answer to almost every “our devices do it differently” problem.
  • Topology covers devices that are not reachable directly: gateways, mesh networks and the path that addresses a device several hops away.

Also here

Subsections of Device integration

Supported protocols

OpenGate does not ask your devices to change. It speaks eleven protocols, and the first thing to know about any of them is which side opens the conversation, because that decides your network architecture.

Devices that call OpenGate

The platform listens. The device needs outgoing connectivity and nothing else — no public address, no inbound firewall rule. This is what fits sleeping devices, NAT and mobile networks.

Protocol Carries Documented in
HTTP Data collection and operations, in both directions HTTP
MQTT Data collection, operation requests and responses over one persistent connection MQTT
WebSocket A persistent session for low-latency two-way messaging WebSocket
CoAP Data from constrained devices on constrained networks, over UDP or DTLS CoAP
DLMS Meter messages pushed by the device, identified by OBIS code Meter and industrial protocols

OpenGate that calls devices

Here the platform opens the conversation, from a connector function. The device must be reachable at an IP address — directly, through a VPN, or through a gateway.

Protocol Used for Documented in
DLMS Reading and writing meter attributes by OBIS code Meter and industrial protocols
DLMS Gas Smart Gas meters, across manufacturers, on top of DLMS Meter and industrial protocols
IEC102 Electricity meters: load curves, profiles, clock, with IP, VPN, GSM or ATR registration Meter and industrial protocols
SNMP Reading and writing OIDs on network equipment Meter and industrial protocols
SSH Running commands on a device shell Remote access
Telnet The same on legacy equipment without SSH Remote access
ICMP Ping, to prove a device is reachable Remote access

Network nodes that report to OpenGate

Protocol Carries Documented in
RADIUS Accounting packets from GGSN or RAS nodes about M2M network sessions RADIUS accounting

Note that here the counterpart is not the device but the operator’s network, which is why it is provisioned as a mobile-operator concern rather than a device one.

The one that is not a device protocol

Carries Documented in
Kite Querying and changing the status of a mobile subscription, through the operator’s connector Kite JavaScript API

It lives with the protocol APIs because a connector function calls it the same way, but no device is on the other end.

How this maps to the docs

Two kinds of page exist per protocol, and it is worth knowing which you want:

You are asking Read
How does an integration over this protocol work? The pages linked above
Which functions can my script call? The protocol APIs reference
One gap we know about

Modbus and SCADA appear in the product overview but have no technical documentation at all — not even a connector function reference. If you need either, ask your platform contact.

HTTP

The OpenGate Devices API is a REST interface that integrates devices, sensors and machines into the platform. It is the broadest of the south transports: it carries both conversations, in both directions.

The device Over HTTP it can Read
Pushes what it measured POST inventory data (serial number, ICC, MSISDN) and business data as data streams: location, temperature, pressure, consumption Data collection
Receives what to do Accept operation requests from OpenGate, or ask for the ones pending, and report the result Operations

Who calls whom

This is the part worth settling before implementing anything, because it decides which side needs a reachable endpoint:

Flow Who opens the connection The device needs
Data collection The device Outgoing HTTPS only
Operations driven by platform OpenGate To expose an endpoint OpenGate can reach
Operations driven by device The device Outgoing HTTPS only — it polls for pending operations

Devices that sleep, sit behind NAT or have no public address use the device-driven flow, which is the usual case in the field.

Before going to production, read the security tips for operations: HTTPS, X-ApiKey authentication and mutual TLS.

Subsections of HTTP

Data collection

Introduction

API to send raw IoT data to OpenGate.

HTTP data collection

This section shows how to use OpenGate HTTP connector for data collection.

The endpoint allows devices to send raw data to OpenGate.

It can be done by:

  • sending data points with their respective timestamps in different datastreams in a single request
  • sending data points without timestamp in different datastreams in a single request

Note about data streams with special platform processing

Besides the spec info you can find below, it’s worth considering that there are two data streams with special platform processing rules: device.identifier and device.topology.path.

These data streams match fields outside the list of data streams in the collection JSON. Due to this special treatment, these data streams will never be collected from the list of data streams; they will be collected from their fields in the collection JSON.

If you want to collect the data stream device.topology.path you have to fill in the field path of the collection JSON. Or, in case of the device is directly behind a gateway, you can remove the field path and fill in the field device in the collection JSON, OpenGate will collect the data stream device.topology.path with the gateway identifier.

Also, if you want to collect the data stream device.identifier you have to fill in the field device of the collection JSON. If you don’t fill in this field, OpenGate will collect the data stream device.identifier from the device_id (that is, the gateway) in the URI, and all the data in the data streams array will be stored in the gateway collected info.

Usage examples

Send the latest value of each data stream (no timestamp):

curl -X POST 'https://api.opengate.es/south/v80/devices/{device_id}/collect/iot' \
  -H 'X-ApiKey: <your-api-key>' \
  -H 'Content-Type: application/json' \
  -d '{
    "version": "1.0.0",
    "datastreams": [
      { "id": "example", "feed": "feed_1", "datapoints": [{ "value": 333 }] },
      { "id": "key", "feed": "feed_2", "datapoints": [{ "value": "value" }] },
      { "id": "datastream", "datapoints": [{ "value": 1337 }] }
    ]
  }'

Send one data stream with several timestamped data points:

curl -X POST 'https://api.opengate.es/south/v80/devices/{device_id}/collect/iot' \
  -H 'X-ApiKey: <your-api-key>' \
  -H 'Content-Type: application/json' \
  -d '{
    "version": "1.0.0",
    "datastreams": [
      {
        "id": "temperature",
        "feed": "feed_1",
        "datapoints": [
          { "at": 1431602523123, "value": 25 },
          { "at": 1431602523123, "value": 26 }
        ]
      }
    ]
  }'

A valid request returns HTTP 201.

API specification

Operations

Introduction to the Power of OpenGate Operations

OpenGate’s Operations feature is a powerful tool for managing and interacting with remote devices. By leveraging this feature, you can seamlessly integrate and control a wide array of remote devices, enabling unparalleled efficiency and flexibility in your IoT ecosystem.

Key Benefits of OpenGate Operations

  1. Remote Configuration: OpenGate allows you to configure devices remotely, ensuring that settings and updates can be applied without physical access. This feature reduces downtime and operational costs while enhancing device performance and reliability.

  2. Action Requests: With OpenGate, you can issue commands and requests to remote devices in real time, putting you in control and ensuring a responsive system. Whether it’s initiating a firmware update, performing diagnostics, or executing specific tasks, OpenGate ensures that your devices respond promptly and accurately.

  3. Enhanced Integration: The Operations feature seamlessly integrates with your existing systems, respecting and utilizing your current setup. This provides a unified platform for device management, simplifying workflows and enhancing the overall efficiency of your operations.

By utilizing OpenGate’s Operations feature, you can remotely manage, configure, and interact with your devices. This empowers you to maintain optimal performance and achieve greater control over your IoT network. This capability transforms how you manage remote devices, making your operations more agile and responsive to changing needs.

Flexible Operation Control with OpenGate

OpenGate’s Operations feature provides the flexibility to initiate and control operations from both the OpenGate platform and the remote devices themselves. This dual capability ensures that you can maintain optimal control and responsiveness, regardless of your operational needs or the specific scenarios you encounter.

Operation Initiation

  • Platform-Driven Operations: Initiate and manage operations directly from the OpenGate platform, allowing centralized control over device configurations, updates, and actions.
  • Device-Driven Operations: Remote devices can also ask for pending operations, providing a decentralized approach that can be tailored to specific device requirements and conditions.

Additional Resources

For more detailed information on how to utilize these capabilities, please refer to the following links:

These resources offer comprehensive guidance on initiating and managing operations securely, ensuring that your interactions with remote devices are both efficient and safe. By following these guidelines, you can maximize the potential of OpenGate’s Operations feature while maintaining robust security standards.

Subsections of Operations

Operations driven by platform

Introduction

OpenGate initiates communication with the device, requesting the execution of a specific operation. Upon receiving this request, the device can respond in either a synchronous or asynchronous manner, utilising the HTTP protocol.

Devices can expose this endpoint so that OpenGate can request operation executions on them.

Synchronous

The entirety of the operation is driven by a single HTTP request and response: the device executes the operation and returns the result in the response body of the same exchange.

sequenceDiagram
    participant OG as OG Connector
    participant Dev as Device

    rect rgb(240, 246, 255)
    Note over OG,Dev: Platform generated command
    OG->>+Dev: COMMAND (HTTP REQUEST -> POST)<br>Command Info (JSON)
    Note over Dev: executes the operation
    Dev-->>-OG: RESPONSE (HTTP RESPONSE) 201 Ok<br>Response Info (JSON)
    end

Asynchronous

In this instance, OpenGate transmits the operation to the device via an HTTP request, and the device responds with an acknowledgement through the utilisation of an HTTP response. Subsequently, OpenGate is capable of receiving one or multiple HTTP requests transmitted by the device. These HTTP requests can be employed by the device to convey the subsequent steps that the operation necessitates.

For further information on the endpoints exposed by OpenGate for the management of asynchronous operation communications, please refer to the section on operations driven by device.

Simple response

The device transmits a sole response message in order to respond to the request.

sequenceDiagram
    participant OG as OG Connector
    participant Dev as Device

    rect rgb(240, 246, 255)
    Note over OG,Dev: Platform generated command
    OG->>+Dev: COMMAND (HTTP REQUEST -> POST)<br>Command Info (JSON)
    Dev-->>-OG: COMMAND ACK (HTTP RESPONSE) 201 Ok
    end

    Note over Dev: executes the operation

    rect rgb(240, 246, 255)
    Note over OG,Dev: Device generated response
    Dev->>+OG: RESPONSE (HTTP REQUEST -> POST)<br>Response Info (JSON)
    OG-->>-Dev: RESPONSE ACK (HTTP RESPONSE) 201 Ok
    end

Multiple responses

The device can transmit a number of partial responses and a final response at the conclusion of the sequence.

Partial responses carry no resultCode: that is what marks them as intermediate. The final response includes it, closing the operation.

sequenceDiagram
    participant OG as OG Connector
    participant Dev as Device

    rect rgb(240, 246, 255)
    Note over OG,Dev: Platform generated command
    OG->>+Dev: COMMAND (HTTP REQUEST -> POST)<br>Command Info (JSON)
    Dev-->>-OG: COMMAND ACK (HTTP RESPONSE) 201 Ok
    end

    rect rgb(240, 246, 255)
    Note over OG,Dev: Device generated partial response
    Dev->>+OG: PARTIAL RESPONSE (HTTP REQUEST -> POST)<br>Response Info (without resultCode)
    OG-->>-Dev: RESPONSE ACK (HTTP RESPONSE) 201 Ok
    end

    Note over OG,Dev: one exchange per partial response

    rect rgb(240, 246, 255)
    Note over OG,Dev: Device final response
    Dev->>+OG: RESPONSE (HTTP REQUEST -> POST)<br>Response Info (JSON)
    OG-->>-Dev: RESPONSE ACK (HTTP RESPONSE) 201 Ok
    end

Operation structure

Simple request/response

The operation is comprised of a single request and a single response, which together constitute its entirety. There are no intermediate steps. It can be executed in either a synchronous or asynchronous manner, with the latter resulting in a simple response.

Multi-step response

In order to facilitate the monitoring of the operation, it is necessary to define a list of steps. The device is capable of providing information regarding these steps in a single response or in a series of partial responses until the final step is reached. The device can respond using either a synchronous or an asynchronous (simple or multiple responses) flow strategy.

Response structure

In regard to the JSON format, there is no distinction between synchronous and asynchronous responses.

  • Synchronous: The device incorporates the JSON payload into the HTTP response.
  • Asynchronous: The device incorporates the JSON payload into a new HTTP POST, which is initiated by the device itself.

API specification

Device HTTP ports

  • Unsecure (deprecated): 1123
  • Secure: 11235

Usage example

In this flow the device acts as the HTTP server: OpenGate sends the operation request to the endpoint exposed by the device. Request body sent by OpenGate:

{
  "operation": {
    "request": {
      "timestamp": 1614169437035,
      "name": "EQUIPMENT_DIAGNOSTIC",
      "parameters": {},
      "id": "27dfeb18-e13f-45eb-abcc-b8b215c30599"
    }
  }
}

Synchronous response body returned by the device with HTTP 201:

{
  "operation": {
    "response": {
      "id": "e05e4354-ffe0-4cfa-8030-f6b9500b64ab",
      "timestamp": 1432454278000,
      "deviceId": "device_1",
      "name": "EQUIPMENT_DIAGNOSTIC",
      "resultCode": "SUCCESS",
      "resultDescription": "No Error",
      "steps": [
        {
          "name": "MOTHER_BOARD",
          "timestamp": 1432454278000,
          "result": "SUCCESSFUL",
          "description": "Motherboard is Ok"
        }
      ]
    }
  }
}

Operations driven by device

Introduction

The typical use case is when the remote device, having been in a long sleep period, requests the pending operation requests stored in OpenGate.

sequenceDiagram
    participant OG as OG Connector
    participant Dev as Device

    rect rgb(240, 246, 255)
    Note over OG,Dev: Device polls for pending operation
    Dev->>+OG: Retrieve Op. Request (HTTP POST)
    OG-->>-Dev: RESPONSE ACK (HTTP RESPONSE) 201 Ok
    end

    rect rgb(240, 246, 255)
    Note over OG,Dev: Platform generated command
    Dev->>+OG: COMMAND (HTTP REQUEST -> POST)<br>Command Info (JSON)
    OG-->>-Dev: COMMAND ACK (HTTP RESPONSE) 201 Ok
    end

    rect rgb(240, 246, 255)
    Note over OG,Dev: Device generated response
    Dev->>+OG: RESPONSE (HTTP REQUEST -> POST)<br>Response Info (JSON)
    OG-->>-Dev: RESPONSE ACK (HTTP RESPONSE) 201 Ok
    end

Usage examples

Ask for pending operations:

curl -X POST 'https://api.opengate.es/south/v80/devices/{device_id}/operation/pending' \
  -H 'X-ApiKey: <your-api-key>' \
  -H 'Content-Type: application/json' \
  -d '{
    "trustedBoot": "ab2a2ed4-780d-11eb-9439-0242ac130002",
    "operation": {
      "request": {
        "deviceId": "6890af9e-781c-11eb-9439-0242ac130002",
        "path": ["gateway_001"]
      }
    }
  }'

Send an asynchronous operation response:

curl -X POST 'https://api.opengate.es/south/v80/devices/{device_id}/operation/response' \
  -H 'X-ApiKey: <your-api-key>' \
  -H 'Content-Type: application/json' \
  -d '{
    "version": "7.0",
    "operation": {
      "response": {
        "id": "e05e4354-ffe0-4cfa-8030-f6b9500b64ab",
        "timestamp": 1432454278000,
        "deviceId": "device_1",
        "name": "EQUIPMENT_DIAGNOSTIC",
        "resultCode": "SUCCESS",
        "resultDescription": "No Error",
        "steps": [
          {
            "name": "MOTHER_BOARD",
            "timestamp": 1432454278000,
            "result": "SUCCESSFUL",
            "description": "Motherboard is Ok"
          }
        ]
      }
    }
  }'

A valid request returns HTTP 201 with a Location header.

API specification

Security tips for operations

Tips to Ensure Security When Using OpenGate Operations

To ensure the security of your operations with OpenGate, follow these recommended practices:

  1. Use Encrypted Communication: Always use secure HTTP (HTTPS) for communication, utilizing the default TCP port 443. Unsecured HTTP communication (default TCP port 80) is deprecated and will soon be unsupported.

  2. Authentication Mechanisms: OpenGate requires authentication for all operations. There are two mechanisms you can use simultaneously for enhanced security:

    • API Key Authentication: Include the X-ApiKey HTTP header with the API key of a valid user in every request.
    • Mutual Authentication: Implement mutual authentication based on secure HTTP PKI infrastructure for an additional layer of security, ensuring the integrity and confidentiality of your communications.

By following these guidelines, you can enhance the security and reliability of your interactions with the OpenGate platform.

MQTT

OpenGate provides an MQTT connector that lets devices exchange messages with the platform using a single TCP connection: publish collected data, receive operation requests, send operation responses and ask for pending operations. The following sections describe how to connect, the default OpenGate topics, and how to handle data collection and operations over MQTT.

Subsections of MQTT

Data collection

MQTT data collection

This section shows how to use OpenGate MQTT connector for data collection.

Using MQTT, your devices only need one TCP connection to exchange messages with the platform: publish collected data, receive operation requests, send operation responses, ask for pending operations, etc.

How to connect to OpenGate MQTT connector

These are the parameters to establish a MQTT connection with OpenGate:

  • Host: api.opengate.es
  • Port: 1883
  • User: your-device-id
  • Password: your-api-key

Obtaining your API key

  1. Login onto the OpenGate web interface
  2. Click on the cogs that are at the top-right of the OpenGate home page
  3. Click on the User option
  4. Click on the “Click to show” link

Collecting data using mosquitto CLI tool

mosquitto is an open source MQTT client and server. The following example shows how to connect and publish data using OpenGate MQTT connector:

mosquitto_pub \
    -h api.opengate.es -p 1883 \
    -t odm/iot/your-device-id \
    -u your-device-id -P your-api-key \
    -m 'your-datastreams-as-json'

OpenGate default MQTT topics

  • To publish collected data: odm/iot/your-device-id
  • To subscribe to incoming operations from OpenGate: odm/request/your-device-id
  • To publish operation responses: odm/response/your-device-id

You have to replace your-device-id with the OpenGate unique identifier of your device.

Data collection payload

The payload definition in the section HTTP integration to collect data is entirely valid. You only have to add a "device": "your-device-id" field, filled with your OpenGate device unique identifier, at the top level of the JSON document with the collected values.

See the following example:

Publish to odm/iot/your-device-id topic this JSON:

{
  "version": "1.0.0",
  "device": "your-device-id",
  "datastreams": [
    {
      "id": "temperature",
      "datapoints": [{ "value": 24.1 }]
    }
  ]
}

Operations

MQTT operations

OpenGate default MQTT topics for operations

  • To subscribe to incoming operations from OpenGate: odm/request/your-device-id
  • To publish operation responses: odm/response/your-device-id

Replace your-device-id with the OpenGate unique identifier of your device.

Subsections of Operations

Examples

MQTT operation examples

Each example shows the complete flow of an operation over MQTT: the North API request that creates the operation job, the request message the device receives on its odm/request/your-device-id topic, and the response message the device publishes on its odm/response/your-device-id topic.

Subsections of Examples

Refresh info

Send the operation request to OpenGate

The following request creates the operation job that sends the operation to your device.

curl 'https://api.opengate.es/north/v80/operation/jobs' \
  -H 'X-ApiKey: your-api-key' \
  -H 'Content-Type: application/json' \
  -H 'Accept: */*' \
  --data '{
  "job": {
    "request": {
      "operationParameters": {
        "timeout": 90000,
        "retries": 0,
        "retriesDelay": 0
      },
      "name": "REFRESH_INFO",
      "schedule": {
        "stop": {
          "delayed": 120000
        }
      },
      "parameters": {},
      "target": {
        "append": {
          "entities": [
            "your-device-id"
          ]
        }
      },
      "active": true
    }
  }
}'

Receiving operation request into a device

You must be connected to OpenGate MQTT connector as a subscriber to topic odm/request/your-device-id, if so, then you’ll receive an operation request like this:

{
  "operation": {
    "request": {
      "timestamp": 1614239125800,
      "name": "REFRESH_INFO",
      "parameters": {},
      "id": "9ac30d2d-1401-4c2b-996f-e55882b6c5c4"
    }
  }
}

Answering the operation

Your device must publish a message to the topic odm/response/your-device-id to let OpenGate know it’s going to answer the operation:

{
  "operation": {
    "response": {
      "name": "REFRESH_INFO",
      "timestamp": 1614239127235,
      "resultDescription": "Success",
      "steps": [
        {
          "timestamp": 1614239127235,
          "description": "",
          "name": "REFRESH_INFO",
          "result": "SUCCESSFUL"
        }
      ],
      "deviceId": "your-device-id",
      "resultCode": "SUCCESSFUL",
      "id": "9ac30d2d-1401-4c2b-996f-e55882b6c5c4"
    }
  },
  "version": "1.0"
}

Fulfill the operation

Because this operation requests a full info refresh to your device, it must publish a new message with all the requested information to the topic odm/iot/your-device-id the message:

{
  "device": "your-device-id",
  "datastreams": [
    {
      "id": "device.serialNumber",
      "datapoints": [{ "value": "F71SL16NHG9G" }]
    },
    {
      "id": "device.model",
      "datapoints": [
        {
          "value": {
            "name": "OpenGateMqtt",
            "manufacturer": "OpenGate"
          }
        }
      ]
    },
    {
      "id": "device.birthDate",
      "datapoints": [{ "value": "2021-02-25 08:21:32" }]
    },
    {
      "id": "device.operationalStatus",
      "datapoints": [{ "value": "NORMAL" }]
    },
    {
      "id": "device.upTime",
      "datapoints": [{ "value": "1614237191" }]
    },
    {
      "id": "device.clock",
      "datapoints": [
        {
          "value": {
            "date": "2021-02-25",
            "time": "12:32:01"
          }
        }
      ]
    },
    {
      "id": "device.software",
      "datapoints": [
        {
          "value": [
            {
              "type": "FIRMWARE",
              "name": "v1.0.0"
            }
          ]
        }
      ]
    },
    {
      "id": "device.temperature.value",
      "datapoints": [{ "value": 19 }]
    },
    {
      "id": "device.communicationModules[].subscription.identifier",
      "datapoints": [{ "value": "346xxxxxxxx" }]
    },
    {
      "id": "device.communicationModules[].subscription.mobile.signalStrength",
      "datapoints": [{ "value": -80 }]
    },
    {
      "id": "device.communicationModules[].subscription.mobile.signalStrengthStatus",
      "datapoints": [{ "value": "NORMAL" }]
    },
    {
      "id": "device.communicationModules[].subscription.mobile.ratType",
      "datapoints": [{ "value": "LTE" }]
    }
  ],
  "version": "1.0.0"
}

Reboot equipment

Send the operation request to OpenGate

The following request creates the operation job that sends the operation to your device.

curl 'https://api.opengate.es/north/v80/operation/jobs' \
  -H 'X-ApiKey: your-api-key' \
  -H 'Content-Type: application/json' \
  -H 'Accept: */*' \
  --data '{
  "job": {
      "request": {
          "operationParameters": {
              "timeout": 90000,
              "retries": 0,
              "retriesDelay": 0
          },
          "name": "REBOOT_EQUIPMENT",
          "schedule": {
              "stop": {
                  "delayed": 120000
              }
          },
          "parameters": {
              "type": "HARDWARE"
          },
          "target": {
              "append": {
                  "entities": [
                      "649843"
                  ]
              }
          },
          "active": true
      }
  }
}'

Receiving operation request into a device

You must be connected to OpenGate MQTT connector as a subscriber to topic odm/request/your-device-id, if so, then you’ll receive an operation request like this:

{
  "operation": {
    "request": {
      "timestamp": 1614253699108,
      "name": "REBOOT_EQUIPMENT",
      "parameters": {
        "type": "HARDWARE"
      },
      "id": "05d17fb4-b2a8-49d8-8461-cda0d24f852b"
    }
  }
}

Answering the operation

Your device must publish a message to the topic odm/response/your-device-id to let OpenGate know it’s going to answer the operation:

{
  "operation": {
    "response": {
      "name": "REBOOT_EQUIPMENT",
      "timestamp": 1614253700835,
      "resultDescription": "Success",
      "steps": [
        {
          "timestamp": 1614253700835,
          "description": "The system will be rebooted",
          "name": "REBOOT_EQUIPMENT",
          "result": "SUCCESSFUL"
        }
      ],
      "deviceId": "649843",
      "resultCode": "SUCCESSFUL",
      "id": "05d17fb4-b2a8-49d8-8461-cda0d24f852b"
    }
  },
  "version": "1.0"
}

Equipment diagnostic

Send the operation request to OpenGate

The following request creates the operation job that sends the operation to your device.

curl 'https://api.opengate.es/north/v80/operation/jobs' \
  -H 'X-ApiKey: your-api-key' \
  -H 'Content-Type: application/json' \
  -H 'Accept: */*' \
  --data '{
  "job": {
    "request": {
      "operationParameters": {
        "timeout": 90000,
        "retries": 0,
        "retriesDelay": 0,
        "retryResultList" : []
      },
      "name": "EQUIPMENT_DIAGNOSTIC",
      "schedule": {
        "stop": {
          "delayed": 120000
        }
      },
      "parameters": {
        "type": "HARDWARE"
      },
      "target": {
        "append": {
          "entities": [
            "649843"
          ]
        }
      },
      "active": true
    }
  }
}'

Receiving operation request into a device

You must be connected to OpenGate MQTT connector as a subscriber to topic odm/request/your-device-id, if so, then you’ll receive an operation request like this:

{
  "operation": {
    "request": {
      "timestamp": 1614238879802,
      "name": "EQUIPMENT_DIAGNOSTIC",
      "parameters": {
        "type": "HARDWARE"
      },
      "id": "14502149-99f9-4348-93f1-23aea495811b"
    }
  }
}

Answering the operation

Your device must publish a message to the topic odm/response/your-device-id to let OpenGate know it’s going to answer the operation:

{
  "operation": {
    "response": {
      "name": "EQUIPMENT_DIAGNOSTIC",
      "timestamp": 1614238881241,
      "resultDescription": "Success",
      "steps": [
        {
          "timestamp": 1614238881241,
          "description": "System is OK",
          "name": "EQUIPMENT_DIAGNOSTIC",
          "result": "SUCCESSFUL"
        }
      ],
      "deviceId": "649843",
      "resultCode": "SUCCESSFUL",
      "id": "14502149-99f9-4348-93f1-23aea495811b"
    }
  },
  "version": "1.0"
}

Websocket

A WebSocket session keeps one connection open in both directions, which suits devices that need low-latency two-way messaging without re-establishing a connection for every message.

Connecting

wss://api.opengate.es:9955/south/v80/sessions/{device.id}
Port 9955
Path /south/v80/sessions/{device.id}
Authentication X-ApiKey, required

The API key can travel either way, whichever your WebSocket client makes easier:

As a header of the HTTP request that establishes the connection.

As a URL parameter named X-ApiKey:

wss://api.opengate.es:9955/south/v80/sessions/your-device-id?X-ApiKey={your-api-key}

Replace your-device-id and your-api-key with the values of your environment.

What travels over the session

The messages themselves are shaped by a connector function: the URI of the session is matched against the function’s southCriterias with the wss:// scheme, and the function decides what to do with each incoming message. To send a message back down an already open connection, use the WebSocket JavaScript API.

The contextParams your script receives include the session’s uri, its relative path and the sessionIp, which is how a single function can serve several session paths and tell them apart.

CoAP

The Constrained Application Protocol (CoAP) is a lightweight web transfer protocol (RFC 7252) designed for constrained nodes and networks. OpenGate operates exclusively as a CoAP listening server, receiving incoming request messages (e.g. for data collection or operational responses) sent by devices.

Note: OpenGate does not initiate outbound CoAP requests to external CoAP servers running on devices. All CoAP communications must be initiated by the device towards OpenGate.

Endpoints

OpenGate listens for CoAP requests on both unencrypted UDP and secure DTLS ports.

Scheme Port Transport / Security Example URI
coap:// 5683 Unencrypted (UDP) coap://api.opengate.es:5683/{meter_id}/{path}
coaps:// 30013 DTLS (Datagram Transport Layer Security) coaps://api.opengate.es:30013/{meter_id}/{path}

URI structure and south criteria

All CoAP URIs targeted by devices must place the device’s unique identifier ({meter_id}) at the beginning of the URL path:

coap://api.opengate.es:5683/{meter_id}/{path}
coaps://api.opengate.es:30013/{meter_id}/{path}
  • {meter_id}: The unique OpenGate identifier of the device.
  • {path}: The resource path matched against the south criteria in your connector functions.

For example, a connector function configured with south criteria = "coaps://data" will match requests sent to either coap://api.opengate.es:5683/{meter_id}/data or coaps://api.opengate.es:30013/{meter_id}/data.

Each manufacturer or device implementation defines its own specific paths ({path}) and payload formats (JSON, binary, etc.), which are translated into OpenGate data structures by corresponding connector functions.

Authentication

Every CoAP request sent to OpenGate must include API key authentication (X-ApiKey). In CoAP, authentication is delivered as a custom CoAP Option:

Property Value
CoAP Option Number 2502
Value Format A string containing your OpenGate API key
Requirement Required

Requests received without CoAP Option 2502 or with an invalid API key will be rejected by OpenGate as unauthorized.

Message processing and connector functions

Incoming CoAP requests are evaluated against configured connector functions:

  1. Routing: The request scheme (coap:// or coaps://) and URI path are matched against the south criteria defined in your connector functions.
  2. Execution: The matching connector function processes the request payload (such as JSON, binary data, etc).
  3. Response: OpenGate returns a CoAP response to the device. To customize the status code, content format, or body of the response sent back to the device, use the CoAP JavaScript API.

Subsections of CoAP

Data collection

Introduction

This section describes how constrained devices push telemetry, measurements, inventory, or custom data to OpenGate over the CoAP protocol.

Endpoint & URI Structure

Every CoAP data collection request sent by a device must include the unique device identifier ({meter_id}) at the beginning of the URI path:

coap://api.opengate.es:5683/{meter_id}/{path}
coaps://api.opengate.es:30013/{meter_id}/{path}
  • {meter_id}: The device identifier in OpenGate (e.g. device serial number, IMEI, meter ID).
  • {path}: The relative resource path defined by the device integration.

Matching South Criterias

The scheme (coap:// or coaps://) and {path} portion of the URI are evaluated against the southCriterias defined in your platform connector functions.

For example, if a connector function defines a southCriterias of "coaps://data", it will match requests sent to:

  • coap://api.opengate.es:5683/METER-12345/data
  • coaps://api.opengate.es:30013/METER-12345/data

Payload Formats & Manufacturer Flexibility

OpenGate does not enforce a single static payload format for CoAP data collection. Each device manufacturer or integration profile can define its own:

  • URI Resource Paths: e.g., /data, /telemetry, /v1/readings, /sensors.
  • Payload Encoding: JSON, CBOR (Concise Binary Object Representation), or vendor-specific binary formats suited for constrained devices and narrow bands.

The matching connector function parses the raw incoming byte payload and maps the measurements to standard OpenGate data streams.

Authentication

All requests must include API key authentication passed in CoAP Option 2502:

Property Value
CoAP Option Number 2502
Value Format String containing the OpenGate API key
Requirement Required

Example Flow

  1. The device sends a CoAP POST or PUT request:

    • Target URI: coaps://api.opengate.es:30013/METER-12345/data
    • Option 2502: <your-api-key>
    • Payload: Vendor-specific measurement payload.
  2. OpenGate matches the request to the connector function with southCriterias = "coaps://data".

  3. The connector function parses the payload, extracts data points for device METER-12345, and formats the response status using the CoAP JavaScript API:

// Example connector function snippet returning status 2.04 (CHANGED)
coap.server.response.status = 204;
coap.server.response.send();

Operations

Introduction

Because OpenGate operates exclusively as a CoAP listening server, the platform cannot initiate outbound CoAP connections to devices. Operation management over CoAP is therefore device-driven: devices periodically poll OpenGate for pending operation requests and report execution results back to the platform.

URI Structure & Device-Driven Workflow

All CoAP operation URIs must begin with the device unique identifier ({meter_id}):

coap://api.opengate.es:5683/{meter_id}/{path}
coaps://api.opengate.es:30013/{meter_id}/{path}

The operation workflow is typically split into two interaction endpoints defined via southCriterias:

1. Polling for Pending Operations

Devices periodically query OpenGate to check if there are pending operations queued for execution (e.g., firmware update requests, configuration changes, or remote commands).

  • Example Device URI: coaps://api.opengate.es:30013/{meter_id}/askForOperations
  • Matching southCriterias: coaps://askForOperations

Flow:

  1. The device sends a CoAP request (e.g., POST or GET) to /askForOperations with CoAP Option 2502 containing the API key.
  2. The connector function matching coaps://askForOperations retrieves pending operations assigned to {meter_id} from OpenGate.
  3. The connector function formats and returns the pending operations to the device in the CoAP response payload.

2. Reporting Operation Execution Results

Once a device finishes executing an operation, it sends a CoAP request back to OpenGate to report the execution outcome (e.g., SUCCESS, ERROR, or progress status).

  • Example Device URI: coaps://api.opengate.es:30013/{meter_id}/operationResults
  • Matching southCriterias: coaps://operationResults

Flow:

  1. The device sends a CoAP request (e.g., POST or PUT) containing the operation result payload.
  2. The connector function matching coaps://operationResults parses the result payload and updates the operation status in OpenGate.
  3. OpenGate returns a confirmation status (e.g., 2.04 Changed) via the CoAP JavaScript API.

Manufacturer & Payload Flexibility

Specific URIs and payload structures are defined per manufacturer or integration requirement. Different device models may use different relative paths (e.g., /pending-tasks, /report-outcome) and payload formats (JSON, CBOR, or binary).

Custom connector functions bridge the device-specific formats with OpenGate’s operation processing engine.

Authentication

All operation requests must carry API key authentication in CoAP Option 2502:

Property Value
CoAP Option Number 2502
Value Format String containing the OpenGate API key
Requirement Required

Meter and industrial protocols

These are the protocols where OpenGate opens the conversation. There is no south endpoint waiting for the device: a connector function reaches out, talks the protocol, and turns the answer into data points or an operation result.

The polling model

flowchart TB
    JOB["A job or task<br>launches an operation"] --> REQ["REQUEST connector function"]
    REQ -->|"opens the connection"| DEV["Meter or network device"]
    DEV -->|"attribute values"| REQ
    REQ --> OUT["Operation result<br>and collected data points"]

    classDef cf fill:#addcf8,stroke:#2b7cb8,color:#000,font-weight:bold
    class REQ cf

Three consequences worth planning for:

  • The device must be reachable at an IP address: directly, over a VPN, or through a gateway using a path.
  • Reading is an operation. You schedule meter readings with jobs and tasks, which is also how you get retries, timeouts and per-device results.
  • Connection parameters live in your script, taken from the device’s provisioned data. Keep credentials out of the code: read them from the entity object.

DLMS

The only protocol here that works in both directions.

Direction What happens
Device to platform The meter sends a DLMS message. A COLLECTION connector function receives it, with the obisCode and templateId of the message in contextParams and the attribute values in payload
Platform to device dlms.connect() opens a session, then dlms.addAttr() builds a list of attributes by class id, OBIS code and attribute id, and dlms.get() or dlms.set() executes it

Attributes are addressed the DLMS way — a class id, an OBIS code and an attribute id — and values carry explicit DLMS types such as octet-string, which the reference explains how to convert to dates and back.

Reference: DLMS JavaScript API

DLMS Gas

Smart Gas meters differ enough between manufacturers to make a generic DLMS script painful. dlms_gas absorbs that: it carries per-manufacturer behaviours — currently pietro, watertech, honeywell and spark — over a common default, and is designed to be extended with new ones.

A standard function becomes about four calls:

dlms_gas.init();
dlms_gas.decode();
dlms_gas.pendingActions();

Reference: DLMS Gas JavaScript API

IEC102

Electricity meters. iec102.connect(registerType) does more than open a socket:

registerType Meaning
IP Direct IP connection. The default when you do not specify one
VPN Through a VPN
GSM Over a GSM call, sending the commands needed to register
ATR Over ATR, likewise

With GSM or ATR, connecting also collects a presence data point, device.communicationModules[].subscription.mobile.presence.gsm, with OK or NOK — so the attempt itself tells you whether the meter is alive.

Connection properties are set on the object before connecting:

iec102.ip = "127.0.0.1";
iec102.port = "3000";
iec102.linkAddress = "1";
iec102.useMeasurePoint = "1";
Always check the status after connecting

On failure, connect sets the response status to ERROR_PROCESSING with the error description. Check the returned status and return the response object instead of carrying on — otherwise the operation reports something misleading.

Once connected, work is expressed as ASDUs: clock reading, load curves, profiles. They can be executed directly, defined from the operation’s parameters, or declared by hand.

Reference: IEC102 JavaScript API

SNMP

Network equipment. Build a list of OIDs with snmp.addOid(), then run snmp.get() or snmp.set().

To store what you read, hand it to a collection with the snmps:// scheme, which is also what a COLLECTION function matches as its south criteria:

collectCF(result.data, "snmps://<oidValue>");

Reference: SNMP JavaScript API

Where to go next

To Read
See every protocol OpenGate speaks, and which side calls Supported protocols
Write the function that does the talking Connector Functions
Schedule readings across a fleet Jobs and tasks
Reach a meter behind a gateway Topology
Watch a function run Debugging

Remote access

Sometimes the integration is not a protocol the device speaks on your behalf — it is you, on the device, running commands. OpenGate opens these connections from a connector function, so the device must be reachable at an IP address, directly or through a gateway.

SSH and Telnet

Both follow the same three-step shape, and the object properties are set before connecting:

ssh.ip = "10.0.0.7";
ssh.user = "admin";
ssh.identity = "-----BEGIN RSA PRIVATE KEY-----...";
ssh.connect(["$"]);
var out = ssh.send("show version", "#", ["#"]);
ssh.disconnect();
Property SSH Telnet
ip Address of the server Address of the server
port Port of the server Port of the server, default 23
retries Default 3 Default 3
timeout Milliseconds, default 5000 Milliseconds, default 5000
user, password Credentials
identity RSA key content, as an alternative to a password
Set the SSH port explicitly

The SSH reference documents a default port of 23, which is Telnet’s port rather than SSH’s 22. Until that is clarified, set ssh.port explicitly in your script instead of relying on the default.

connect and send both take a waitFor list: the strings that tell the client the device has finished talking. Getting those right is most of the work with a shell integration, because there is no framing to rely on — a prompt is the only end-of-message marker you have.

Prefer identity over password where the device supports it, and read either from the provisioned entity rather than hardcoding it in the script.

References: SSH · Telnet

ICMP

A ping, which answers the one question every other integration depends on: is this device reachable at all?

Property Meaning
ip Address to ping
retries Delivery retries, default 5
timeout Milliseconds per retry, default 2500
async true by default: the request does not block the function

Because async defaults to true, the result usually does not come back in the same execution. It arrives at a separate RESPONSE connector function, which receives the outcome as its payload — that is what the ICMP Response reference documents.

Set async to false when you want the answer inline and are prepared to wait for it.

References: ICMP · ICMP Response

Where to go next

To Read
See every protocol OpenGate speaks Supported protocols
Write the function Connector Functions
Launch this across a fleet Jobs and tasks
Debug a session that hangs Debugging

RADIUS accounting

The other protocols on this section connect OpenGate to a device. RADIUS connects it to the network: the platform can receive RADIUS accounting packets from Remote Access Servers or delegated RADIUS servers, and learn the operational state of M2M communications from the operator side rather than from the device.

That matters because it answers questions the device cannot. A device that stopped reporting looks identical whether it is broken, out of coverage, or its SIM was suspended — network-side accounting tells them apart.

Who sends what

Sender GGSN nodes, Remote Access Servers, or delegated RADIUS servers
Carries RADIUS accounting packets about network sessions
Direction Into OpenGate: the node reports, the platform receives

Gateway GPRS support nodes are part of the mobile operator’s network and are the usual source, which is why this is provisioned as a mobile-operator concern rather than a device one.

Where it is provisioned

RADIUS clients are registered under mobile operators, not per device or channel:

Management › Mobile operators › GGSN

That page holds the API to provision the RADIUS clients allowed to forward accounting to the platform, and its OpenAPI specification.

Limited access

Provisioning RADIUS clients is a restricted feature. See the GGSN page for the profiles required.

Where to go next

To Read
See every protocol OpenGate speaks Supported protocols
Provision the RADIUS clients GGSN
Manage the SIMs behind those sessions Mobile operators

Topology

Device topologies

OpenGate platform supports different device connection strategies. The following sections explain these connection strategies.

Direct connection strategy

Direct connection strategy is the most common connection scenario. Gateways and devices use it.

flowchart BT
    GA["GatewayA"]
    GB["GatewayB"]
    NET(["Internet"])
    OG["OpenGate Platform"]

    GA -.-> NET
    GB -.-> NET
    NET -.-> OG

    classDef platform fill:#fde8c8,stroke:#c98f2b,color:#000
    classDef node fill:#e2e4e8,stroke:#8a8f98,color:#000
    class OG platform
    class GA,GB node

Each device reaches the platform on its own, with no intermediate node to traverse: deviceId alone identifies the destination, and path is empty.

Indirect connection strategy

Devices behind gateways and complex connection scenarios like non-transparent mesh networks use an indirect connection strategy.

OpenGate supports these scenarios using a path. The path is an array of nodes (devices) to be traversed to reach the destination:

flowchart BT
    D11["Device_1_1"]
    D12["Device_1_2"]
    MESH2(["mesh network"])
    D1["Device_1"]
    MESH1(["mesh network"])
    GA["GatewayA"]
    GB["GatewayB"]
    NET(["Internet"])
    OG["OpenGate Platform"]

    D11 -.-> MESH2
    D12 -.-> MESH2
    MESH2 -.-> D1
    D1 -.-> MESH1
    MESH1 -.-> GA
    GA -.-> NET
    GB -.-> NET
    NET -.-> OG

    classDef platform fill:#fde8c8,stroke:#c98f2b,color:#000
    classDef node fill:#e2e4e8,stroke:#8a8f98,color:#000
    class OG platform
    class D11,D12,D1,GA,GB node
  • The endpoint device, in case of operations, diagnostics sent by the platform.
  • The platform, in case of events, responses, etc., sent by the on-field device.

Indirect connection scenarios

Taking an indirect connection scenario, we have:

  • A gateway device with the id: GatewayA
  • An intermediate device connected to the gateway with the id: Device_1
  • Two endpoint devices connected to the intermediate device with the ids: Device_1_1 and Device_1_2 respectively.

From a platform point of view, the path and deviceId parameter values are:

  • To reach the Gateway:
    • "deviceId": "GatewayA"
    • "path": []
  • To reach the intermediate device:
    • "deviceId": "Device_1"
    • "path": ["GatewayA"]
  • To reach an endpoint device:
    • "deviceId": "Device_1_1"
    • "path": ["GatewayA", "Device_1"]

Deployment Elements

Comprehensive API actions

Getting deployment elements

Endpoint to download deployment element files from the platform.

Usage examples

Download a deployment element file (replace {file_path} with the path of the deployment element you want to retrieve):

curl 'https://api.opengate.es/bundles/deploymentElement/{file_path}' \
  -H 'X-ApiKey: <your-api-key>'

A valid request returns HTTP 200 with the file content.

API specification

Connector Functions

Devices rarely speak the protocol you wish they did. A meter answers DLMS, a legacy gateway needs a Telnet command, a sensor posts a binary frame nobody else understands. A connector function is your own JavaScript, running inside the platform, that translates between OpenGate and that reality.

No middleware to deploy, no service to keep alive: you POST the script, and OpenGate runs it at the moment the data or the operation passes through.

What one looks like

A connector function is a JSON document with a javascript field holding the code, plus the metadata that tells OpenGate when to run it:

{
  "name": "CollectionInfoConnectorFunction",
  "description": "Connector function for collected data",
  "operationalStatus": "DISABLED",
  "type": "COLLECTION",
  "southCriterias": [
    "http://collected/data",
    "mqtt://iot/collected"
  ],
  "javascript": "... javascript code ..."
}

Each function belongs to exactly one channel, and its name must be unique within that channel.

The three types

The type answers which direction is this translating?

flowchart TB
    APP["Back-office application"] -->|"launches an operation"| REQ["REQUEST"]
    REQ -->|"speaks the device protocol"| DEV["Device"]
    DEV -->|"answers the operation"| RES["RESPONSE"]
    DEV -->|"pushes data"| COL["COLLECTION"]
    RES -->|"operation result"| OUT["Operation updated"]
    COL -->|"data points"| STO["Platform storage"]

    classDef cf fill:#addcf8,stroke:#2b7cb8,color:#000,font-weight:bold
    class REQ,RES,COL cf

The three blue boxes are the connector functions: your JavaScript, at the point where each translation happens.

Type Runs when Must return
REQUEST The platform has an operation to send to the device Nothing is required. Return null, or omit the return, and the operation stays open until a response arrives. Return the response object and the operation finishes right there
RESPONSE Something arrives from the device at a south URI, answering an operation The OpenGate standard response object. Return nothing and no operation update happens
COLLECTION Something arrives from the device at a south URI, carrying data The OpenGate standard collection object. Return nothing and nothing is collected

The core JavaScript API gives you the response and collection objects to build those returns without assembling JSON by hand.

Criteria: how OpenGate picks your function

Criteria Used by Meaning
northCriterias REQUEST only, mandatory Matches the operation coming from the platform. Two functions cannot share the same list
southCriterias RESPONSE and COLLECTION, mandatory One or more URIs the device talks to. Each URI can belong to only one connector function

A REQUEST function also needs operationName, which must be an operation type you are allowed to use, and must leave southCriterias unset. RESPONSE and COLLECTION functions are the mirror image: south criteria set, northCriteria and operationName unset.

South criteria are URIs carrying the protocol, and the accepted set is configurable:

https://   mqtts://   wss://   snmps://   dlms://   coaps://

When it runs, and on which devices

operationalStatus is what keeps a half-written function from touching your fleet:

Value OpenGate runs the function
DISABLED Never
TEST Only on devices whose operational status is TEST
PRODUCTION Only on devices whose operational status is PRODUCTION

The natural order is therefore: create it DISABLED, move it to TEST against a test device, and only then to PRODUCTION.

Chaining functions

A function can hand over to another when it finishes, using cf.response and cf.collection. Only these hand-offs are honoured — anything else is silently ignored:

From Can invoke
REQUEST RESPONSE, COLLECTION, or both
RESPONSE COLLECTION
COLLECTION Nothing

That is what lets a single device message both close an operation and collect the readings it carried. See Concatenated Connector Functions.

Where to go next

To Read
Write the script: what it receives, what it must return Core JavaScript API
Talk a specific protocol: DLMS, SNMP, SSH, MQTT… Protocol APIs
Clone a ready-made function instead of writing one Catalog API
Debug a function that is already running Debugging

Managing them over REST

/north/v80/connectorFunctions/provision/organizations/{organizationName}/channels/{channelName}
Action Profiles allowed
CREATE, UPDATE, DELETE admin, admin_domain, super_admin_domain, root
GET, list Any profile

Once created, identifier and type are immutable. Everything else can be updated.

Create a COLLECTION function in a channel:

curl -X POST 'https://api.opengate.es/north/v80/connectorFunctions/provision/organizations/{organizationName}/channels/{channelName}' \
  -H 'X-ApiKey: <your-api-key>' \
  -H 'Content-Type: application/json' \
  -d @connector-function.json

A valid request returns 201 with a Location header carrying the identifier of the new function.

List the connector functions of a channel:

curl 'https://api.opengate.es/north/v80/connectorFunctions/provision/organizations/{organizationName}/channels/{channelName}' \
  -H 'X-ApiKey: <your-api-key>'
The REST API barely reads your JavaScript

Creating or updating a connector function performs only minimal JavaScript parsing. A script that is syntactically odd but parseable will be accepted and fail at runtime, which is why TEST status and debugging matter.

API specification

Subsections of Connector Functions

Core JavaScript API

These objects are available to every connector function, whatever protocol the device speaks. Start with the JavaScript API — it explains what your script receives and what it must produce — and come back here for the object you need.

What you get and what you return

Page Object Use it to
JavaScript API Understand the input variables, the expected output per connector function type, and how executions concatenate
Entity entity, gateway Read data stream values, timestamps and source fields of the device
Inner Collections collection Collect data points and set fields from inside the script
Operation Steps response Build operation steps and set result codes

Reaching back into the platform

Page Object Use it to
Operation operation Read and activate the device’s pending operations
Provision provision Retrieve and create entities through the provisioning API
Concatenated Connector Functions cf Chain RESPONSE and COLLECTION executions together

Helpers

Page Object Use it to
Utils utils AT commands, date handling, context, encryption and HTTP helpers
Cryptography Encrypt and decrypt with AES, hash with HMAC

One more global is always there and is documented outside this section, because rules use the very same object: logger, for writing TRACE, DEBUG, INFO, WARN and ERROR traces. It is the way to see what a running function is doing — see Debugging, which covers both the logger API and the WebSocket service that streams the traces live.

Reserved names

Because these helpers are injected as globals, their names are reserved. Do not declare variables called cf, collection, response, snmp, utils, dlms, dlms_gas, provision or operation in your script.

Subsections of Core JavaScript API

JavaScript API

Connector functions JS API guide

In this javascript code, it is possible to use some defined functions to define the connector function. We will explain them below.

Input parameters

The main script will have access to the following main vars:

  • entity: json with flattened operation target device entity representation.
  • gateway: json with flattened gateway entity representation. It can be null.
  • response: json with default response data (device identifier, request id (if known)…)
  • collection: json with default collection data (device identifier if known)
  • payload: it can be of different types: json object, binary content or flat text. It can contain different types of information: request or response information, collected data….
  • contextParams: json object with execution context information. It can have some of this params:
    • apiKey: device or user apikey.
    • remoteIp: remote host when HTTP Rest Resource is invoked.
    • uri: opened Websocket complete uri or invoked HTTP Rest Resource complete uri.
    • path: opened Websocket relative path or invoked HTTP Rest Resource relative path. This is the path used as south criteria to filter CFs.
    • topic: MQTT Topic where the message arrived.
    • sessionIp: device session IP
  • Protocol clients and APIs: clients such as mqtt, ssh, snmp, dlms, dlms_gas, provision, and operation will be available for being used.

Here there is an example of entity or gateway:

entity = {
    "provision.administration.channel": {
        "_value": {
            "_current": {
                "value": "battery_channel",
                "date": "2017-12-01T08:52:37.563Z",
                "at": "2017-12-01T08:52:37.563Z"
            }
        }
    },
    "provision.administration.identifier": {
        "_value": {
            "_current": {
                "value": "device_battery_id",
                "provType": "MONITORING",
                "date": "2017-12-01T08:52:37.57Z",
                "at": "2017-12-01T08:52:37.57Z"
            }
        }
    },
    "provision.administration.organization": {
        "_value": {
            "_current": {
                "value": "battery_organization",
                "provType": "MONITORING",
                "date": "2017-12-01T08:52:37.566Z",
                "at": "2017-12-01T08:52:37.566Z"
            }
        }
    },
    "provision.administration.plan": {
        "_value": {
            "_current": {
                "value": "FLOW_RATE_100",
                "provType": "MONITORING",
                "date": "2017-12-01T08:52:37.565Z",
                "at": "2017-12-01T08:52:37.565Z"
            }
        }
    },
    "provision.administration.serviceGroup": {
        "_value": {
            "_current": {
                "value": "emptyServiceGroup",
                "provType": "MONITORING",
                "date": "2017-12-01T08:52:37.561Z",
                "at": "2017-12-01T08:52:37.561Z"
            }
        }
    },
    "provision.device.communicationModules[].identifier": [
        {
            "_index": {
                "path": "provision.device.communicationModules[].identifier",
                "value": {
                    "_current": {
                        "value": "commsMod_battery_id",
                        "provType": "MONITORING",
                        "date": "2017-12-01T08:52:37.577Z",
                        "at": "2017-12-01T08:52:37.577Z"
                    }
                }
            },
            "_value": {
                "_current": {
                    "value": "commsMod_battery_id",
                    "provType": "MONITORING",
                    "date": "2017-12-01T08:52:37.577Z",
                    "at": "2017-12-01T08:52:37.577Z"
                }
            }
        }
    ],
    "provision.device.communicationModules[].subscription.address": [
        {
            "_index": {
                "path": "provision.device.communicationModules[].identifier",
                "value": {
                    "_current": {
                        "value": "commsMod_battery_id",
                        "provType": "MONITORING",
                        "date": "2017-12-01T08:52:37.577Z",
                        "at": "2017-12-01T08:52:37.577Z"
                    }
                }
            },
            "_value": {
                "_current": {
                    "value": {
                        "type": "IPV4",
                        "value": "99.1.1.71",
                        "apn": "myapnprov.es"
                    },
                    "provType": "REFERENCE",
                    "date": "2017-12-01T08:52:37.624Z",
                    "at": "2017-12-01T08:52:37.624Z"
                }
            }
        }
    ],
    "provision.device.communicationModules[].subscription.identifier": [
        {
            "_index": {
                "path": "provision.device.communicationModules[].identifier",
                "value": {
                    "_current": {
                        "value": "commsMod_battery_id",
                        "provType": "MONITORING",
                        "date": "2017-12-01T08:52:37.577Z",
                        "at": "2017-12-01T08:52:37.577Z"
                    }
                }
            },
            "_value": {
                "_current": {
                    "value": "subscription_battery_id",
                    "provType": "MONITORING",
                    "date": "2017-12-01T08:52:37.626Z",
                    "at": "2017-12-01T08:52:37.626Z"
                }
            }
        }
    ],
    "provision.device.identifier": {
        "_value": {
            "_current": {
                "value": "device_battery_id",
                "provType": "MONITORING",
                "date": "2017-12-01T08:52:37.636Z",
                "at": "2017-12-01T08:52:37.636Z"
            }
        }
    },
    "provision.device.location": {
        "_value": {
            "_current": {
                "value": {
                    "position": {
                        "type": "Point",
                        "coordinates": [
                            -3.7028,
                            40.41675
                        ]
                    },
                    "postal": "28013"
                },
                "provType": "MONITORING",
                "date": "2017-12-01T08:52:37.64Z",
                "at": "2017-12-01T08:52:37.64Z"
            }
        }
    },
    "resourceType": {
        "_value": {
            "_current": {
                "value": "entity.device",
                "provType": "IDENTIFIER",
                "date": "2017-12-01T08:52:37.643Z",
                "at": "2017-12-01T08:52:37.643Z"
            }
        }
    },
    "device.communicationModules[].identifier": [
        {
            "_index": {
                "path": "device.communicationModules[].identifier",
                "value": {
                    "_current": {
                        "value": "commsMod_battery_id",
                        "date": "2017-12-01T08:52:37.577Z",
                        "at": "2017-12-01T08:52:37.577Z"
                    }
                }
            },
            "_value": {
                "_current": {
                    "value": "commsMod_battery_id",
                    "date": "2017-12-01T08:52:37.577Z",
                    "at": "2017-12-01T08:52:37.577Z"
                }
            }
        }
    ],
    "device.communicationModules[].subscription.address": [
        {
            "_index": {
                "path": "device.communicationModules[].identifier",
                "value": {
                    "_current": {
                        "value": "commsMod_battery_id",
                        "date": "2017-12-01T08:52:37.577Z",
                        "at": "2017-12-01T08:52:37.577Z"
                    }
                }
            },
            "_value": {
                "_current": {
                    "value": {
                        "type": "IPV4",
                        "value": "99.1.1.71",
                        "apn": "myapn.es"
                    },
                    "date": "2017-12-01T08:52:37.624Z",
                    "at": "2017-12-01T08:52:37.624Z",
                    "source": "DEVICE_OPENGATE_HTTP",
                    "sourceInfo": "IoT Data Message Received"
                }
            }
        }
    ],
    "device.communicationModules[].subscription.identifier": [
        {
            "_index": {
                "path": "device.communicationModules[].identifier",
                "value": {
                    "_current": {
                        "value": "commsMod_battery_id",
                        "date": "2017-12-01T08:52:37.577Z",
                        "at": "2017-12-01T08:52:37.577Z"
                    }
                }
            },
            "_value": {
                "_current": {
                    "value": "subscription_battery_id",
                    "date": "2017-12-01T08:52:37.626Z",
                    "at": "2017-12-01T08:52:37.626Z",
                    "source": "DEVICE_OPENGATE_HTTP",
                    "sourceInfo": "IoT Data Message Received"
                }
            }
        }
    ],
    "device.identifier": {
        "_value": {
            "_current": {
                "value": "device_battery_id",
                "date": "2017-12-01T08:52:37.636Z",
                "at": "2017-12-01T08:52:37.636Z",
                "source": "DEVICE_OPENGATE_HTTP",
                "sourceInfo": "IoT Data Message Received"
            }
        }
    },
    "device.temperature.value": {
        "_value": {
            "_current": {
                "value": 25.3,
                "date": "2017-12-01T08:52:37.64Z",
                "at": "2017-12-01T08:52:37.64Z",
                "source": "DEVICE_OPENGATE_HTTP",
                "sourceInfo": "IoT Data Message Received"
            }
        }
    }
}

contextParams some examples:

REQUEST Connector function:

{
  "apiKey": "97c9ceae-c4ee-49ea-ad50-e499bb55ac63",
  "sessionIp": "127.0.0.1"
}

COLLECTION or RESPONSE Connector function for MQTT connector:

{
  "apiKey": "97c9ceae-c4ee-49ea-ad50-e499bb55ac63",
  "topic": "some/topic"
}

COLLECTION or RESPONSE Connector function for HTTP Rest endpoints:

{
  "apiKey": "97c9ceae-c4ee-49ea-ad50-e499bb55ac63",
  "path": "context/path",
  "uri": "http://http_url/device_id/context/path",
  "remoteIp": "remote_device_ip"
}

COLLECTION or RESPONSE Connector function for Websocket connection:

{
  "apiKey": "97c9ceae-c4ee-49ea-ad50-e499bb55ac63",
  "path": "context/path",
  "uri": "ws://ws_url/device/context/path"
}

COLLECTION or RESPONSE Connector function for SNMP connector:

{
  "apiKey": "97c9ceae-c4ee-49ea-ad50-e499bb55ac63",
  "uri": "snmp://oid"
}

COLLECTION Connector function for DLMS connection:

{
  "apiKey": "97c9ceae-c4ee-49ea-ad50-e499bb55ac63",
  "obisCode": "0.1.2.3.3.5"
}

Connector function script output

Depending on the type of CF, the script must have different outputs (regardless of whether other calls are concatenated).

REQUEST CF

No output is mandatory, so return null; can be used, or no return statement defined at all. In this case the operation will not be finished until the response event is processed.

Although the return statement is not mandatory, it is possible to return the response object. If returned, it will be processed and the operation can be finalized directly.

RESPONSE CF

In this case, OpenGate Standard Response object must be returned. If nothing or null is returned, then no operation update will be done.

response object functions can be used to complete full data.

COLLECTION CF

In this case, OpenGate Standard Iot Data Collection object must be returned. If nothing or null is returned, then no collection will be done.

collection object functions can be used to complete full data.

Connector function execution concatenation

In some cases, it is possible to invoke the execution of other CFs once the current CF execution is finished.

These are allowed cases:

  • From REQUEST CF:
    • Invoke RESPONSE CF
    • Invoke COLLECTION CF
    • Invoke RESPONSE CF and COLLECTION CF
  • From RESPONSE CF:
    • Invoke COLLECTION CF

Other invocations will be ignored (for example, invoke RESPONSE CF from COLLECTION CF).

There are two help functions for this:

  • cf.response
  • cf.collection

JS API

cf.operationParameters(operationObj)

Extract from operationObj parameters field. This function could be used in REQUEST CFs, when the payload is Operation Request json.

Kind: global function
Returns: * - Returns parameters field. It can be a complex object. If operationObj is not a correct Request object, null will be returned.

Param Type
operationObj Object

Example of use:

var operationParameters = cf.operationParameters(operationObj);

cf.operationTimestamp(operationObj)

Extract from operationObj timestamp field. This function could be used in REQUEST CFs, when the payload is Operation Request json.

Kind: global function
Returns: number - Returns timestamp field. If operationObj is not correct Request object, null will be returned.

Param Type
operationObj Object

cf.operationName(operationObj) String

Extract from operationObj name field. This function could be used in REQUEST CFs, when the payload is Operation Request json.

Kind: global function
Returns: String - Returns name field. If operationObj is not correct Request object, null will be returned.

Param Type
operationObj Object

cf.operationId(operationObj) String

Extract from operationObj id field. This function could be used in REQUEST CFs, when the payload is Operation Request json.

Kind: global function
Returns: String - Returns id field. If operationObj is not correct Request object, null will be returned.

Param Type
operationObj Object

cf.operationDeviceId(operationObj) String

Extract from operationObj deviceId field. This function could be used in REQUEST CFs, when the payload is Operation Request json.

Kind: global function
Returns: String - Returns deviceId field. If operationObj is not correct Request object, null will be returned.

Param Type
operationObj Object

JS API - Deprecated functions

responseCF(responseData, responseFunctionCriteria)

Used in Request connector functions to define a concatenated Response action.

Kind: global function

Param Type Description
responseData * data to be used as payload in Response Connector Function.
responseFunctionCriteria String the criteria to be used to search response connector function.

collectCF(collectionData, collectionFunctionCriteria)

Used in Request or Response connector functions to define a concatenated Collection action.

Kind: global function

Param Type Description
collectionData * data to be used as payload in Collection Connector Function.
collectionFunctionCriteria String the criteria to be used to search collection connector function.

publishOnTopic(payload, topic, deviceId)

Publish specified payload for specified topic and device.

Kind: global function

Param Type Description
payload * Data to be published. It will be converted to string.
topic String topic uri.
deviceId String device id.

ogCollection(datastreams, device, version)

Creates OG collection main object.

Kind: global function
Returns: Object - Json with Opengate Data Collection object.

Param Type Description
datastreams Array Array of datastreams objects. If not specified empty array will be set.
device String String with deviceId. If not defined null will be set.
version String String with version. If not specified, “1.0.0” value will be used.

ogCollectionDs(datastreamId, feed, datapoints)

Creates OG collection datastream object.

Kind: global function
Returns: Object - Json with Opengate Data Collection Datastream object.

Param Type Description
datastreamId String String with datastreamid. If not provided null will be set.
feed String String with feed name. If not provided null will be set.
datapoints Array Array of datapoints objects. If not provided empty array will be set.

ogCollectionDp(value, at, source, sourceInfo)

Creates OG collection datapoint object.

Kind: global function

Param Type Description
value * collected value. If not provided null will be set.
at number Number with collection timestamp. If not provided null will be set.
source String String with source name. If not provided null will be set.
sourceInfo String String with source description. If not provided null will be set.

addOgCollectionDp(datapoint, ogCollection, datastreamId, feed)

Adds datapoint to specified datastream in the collection object, if datastream does not exist, it creates the datastream.

Kind: global function

Param Type Description
datapoint Object Datapoint object to be added.
ogCollection Object Opengate collection object with current collection data.
datastreamId String Datastream object identifier in collection object. If not exist, it will be created.
feed String feed name, only used if the datastream must be created.

ogResponse(id, name, deviceId, resultCode, resultDescription, steps, timestamp, trustedBoot, version)

Creates OG response object

Kind: global function
Returns: Object - OG response object

Param Type Description
id String operation request id. If not provided null will be set.
name String launched operation name. If not provided null will be set.
deviceId String operation request device id. If not provided null will be set.
resultCode String operation result code. If not provided null will be set.
resultDescription String operation result description. If not provided null will be set.
steps Array If not defined, empty array will be defined.
timestamp String Operation response timestamp. If not provided current timestamp will be set.
trustedBoot String Trusted boot value. If not provided null will be set.
version String If not specified “8.0” will be set.

ogStep(name, result, description, stepResponseList)

Creates OG step object used in opengate response object.

Kind: global function
Returns: OG step object

Param Type Description
name String step name. If not provided null will be set.
result String step result. If not provided null will be set.
description String description string. If not provided, null will be assigned.
stepResponseList String array of stepResponse objects. If not provided, empty array will be assigned.

ogStepResponse(name, value)

Creates OG step response object, used in step object.

Kind: global function
Returns: OG step response object

Param Type Description
name * step name. If not provided null will be set.
value Object object with value. If not provided empty object will be assigned.

httpRequest(request, payload)

Executes specified request with specified payload.

Kind: global function
Returns: Object - JSON with response. It will have two fields: ‘statusCode’ with http result code and ‘body’ with response body content.

Param Type Description
request Object Object with requests parameters: ‘method’, ‘uri’ and ‘headers’. - ‘method’: GET, POST, PUT, DELETE. - ‘uri’: request uri. - ‘headers’: json with http request headers.
payload * data to be sent. It can be null.

webSocketMsg(payload, deviceId)

Send message to opened websocket

Kind: global function

Param Type Description
payload * data to be published. It will be converted to string.
deviceId String Device identifier with the opened websocket

entityValue(entity, datastream, index)

Extract from entity specified datastream “value” field value.

Kind: global function
Returns: * - Specified datastream “value” field. It can be complex object. null if datastream does not exist.

Param Type Description
entity Object entity Object with flattened entity.
datastream String Datastream name, for example: ‘provision.device.identifier’.
index number Array Index. If provided datastream is an array (i.e. comm module), element index must be specified.

entitiesValue(entities, datastream, index)

Extract from the first entity of entities array specified datastream “value” field value.

Kind: global function
Returns: * - Specified datastream “value” field. It can be complex object. null if datastream does not exist.

Param Type Description
entities Array Array of objects with flattened entity.
datastream String Datastream name, for example: ‘provision.device.identifier’.
index number Array Index. If provided datastream is an array (i.e. comm module), element index must be specified.

entityAt(entity, datastream, index)

Extract from entity specified datastream “at” field value.

Kind: global function
Returns: Specified datastream “at” field. It can be complex object. null if datastream does not exist.

Param Type Description
entity Object entity Object with flattened entity.
datastream String Datastream name, for example: ‘provision.device.identifier’.
index number Array Index. If provided datastream is an array (i.e. comm module), element index must be specified.

entityDate(entity, datastream, index)

Extract from entity specified datastream “date” field value.

Kind: global function
Returns: Specified datastream “date” field. It can be complex object. null if datastream does not exist.

Param Type Description
entity Object entity Object with flattened entity.
datastream String Datastream name, for example: ‘provision.device.identifier’.
index number Array Index. If provided datastream is an array (i.e. comm module), element index must be specified.

entitySource(entity, datastream, index)

Extract from entity specified datastream “source” field value.

Kind: global function
Returns: Specified datastream “source” field. It can be complex object. null if datastream does not exist.

Param Type Description
entity Object entity Object with flattened entity.
datastream String Datastream name, for example: ‘provision.device.identifier’.
index number Array Index. If provided datastream is an array (i.e. comm module), element index must be specified.

entitySourceInfo(entity, datastream, index)

Extract from entity specified datastream “sourceInfo” field value.

Kind: global function
Returns: Specified datastream “sourceInfo” field. It can be complex object. null if datastream does not exist.

Param Type Description
entity Object entity Object with flattened entity.
datastream String Datastream name, for example: ‘provision.device.identifier’.
index number Array Index. If provided datastream is an array (i.e. comm module), element index must be specified.

log(…msg)

Creates Info level logging messages. It concatenates msg parameters in the final string to be logged.

Kind: global function

Param Type Description
…msg any The function takes as parameters a list of elements to be concatenated to generate the string message to be printed.

encryptString(originalValue, datastreamConfiguration, organizationName)

Encrypt an original string with the configuration established by the datastream of the organization

Kind: global function
Returns: The originalValue encrypted

Param Type Description
originalValue string The value to encrypt.
datastreamConfiguration string The datastream of provision type, of the datamodel that define this value. This datastream has the configuration of encryption.
organizationName string The organization name to which the datamodel belongs.

decryptString(encryptedValue, datastreamConfiguration, organizationName)

Decrypt an encrypted string with the configuration established by the datastream of the organization

Kind: global function
Returns: The encryptedValue decrypted

Param Type Description
encryptedValue string The encrypted value to decrypt.
datastreamConfiguration string The datastream of provision type, of the datamodel that define this value. This datastream has the configuration of encryption.
organizationName string The organization name to which the datamodel belongs.

getAddressTypeFromAddress(address)

Calculates the address type from a given address

Kind: global function
Returns: The address type

Param Type Description
address string The address which the type will be calculated for.

Entity JavaScript API

Connector functions entity JS API guide

This API allows users to extract data from entity object.

Entity Object Methods

The following methods also work with the gateway object since it has the same structure as entity.

entity._value (datastream, index)

Extract from entity specified datastream “value” field value using parameters

Returns: * - Specified datastream “value” field. It can be complex object. null if datastream does not exist.

Param Type Description
datastream string The datastream name.
index any Element index of datastream array.

Example of use:

var value = entity._value('provision.device.identifier');

entity._at (datastream, index)

Extract from entity specified datastream “at” field value using parameters

Returns: Specified datastream “at” field. It can be complex object. null if datastream does not exist.

Param Type Description
datastream string The datastream name.
index any Element index of datastream array.

Example of use:

var at = entity._at('provision.device.identifier');

entity._date (datastream, index)

Extract from entity specified datastream date field value using parameters

Returns: Specified datastream “date” field. It can be complex object. null if datastream does not exist.

Param Type Description
datastream string The datastream name.
index any Element index of datastream array.

Example of use:

var date = entity._date('provision.device.identifier');

entity._source (datastream, index)

Extract from entity specified datastream “source” field value using parameters

Returns: Specified datastream “source” field. It can be complex object. null if datastream does not exist.

Param Type Description
datastream string The datastream name.
index any Element index of datastream array.

Example of use:

var source = entity._source('provision.device.identifier');

entity._sourceInfo(datastream, index)

Extract from entity specified datastream “sourceInfo” field value using parameters

Returns: Specified datastream “sourceInfo” field. It can be complex object. null if datastream does not exist.

Param Type Description
datastream string The datastream name.
index any Element index of datastream array.

Example of use:

var sourceInfo = entity._sourceInfo('provision.device.identifier');

Inner Collections API

Connector functions JS API guide for inner collections

This file provides methods to collect data inside a connector function script execution. These methods belong to collection global object.

JS API

collection.addDatapoint(datastreamId, value, at, source, sourceInfo)

Builds a datapoint object and adds it to the specified datastream in the datastreams list in the collection global object.

Kind: global function
Returns: Void

Param Type Description
datastreamId string Datastream identifier by which the datapoint will be identified.
value any Collected value. If not provided null will be set.
at number Number with collection timestamp in seconds. If not provided null will be set.
source string String with source name. If not provided null will be set.
sourceInfo string String with source description. If not provided null will be set.

Example of use:

var now = Date.now() / 1000;
collection.addDatapoint('device.name', 'collected name from cf', now,'mySource','mySourceInfo');

collection.setFeed(datastreamId, feed)

Sets the feed name to a specific datastream in the datastreams list in the collection global object.

Kind: global function
Returns: Void

Param Type Description
datastreamId string Datastream identifier by which the datapoint will be identified.
feed string The feed name to set to the specified datastream.

Example of use:

collection.setFeed('device.name', 'myFeed');

collection.send()

Sends a collection message to the OpenGate’s collection messages flow using the datastreams list in the collection global object, after that this list is cleaned.

Kind: global function
Returns: Void

Example of use:

collection.send();

collection.getValue(datastream, dpIndex)

Searches for a datapoint value for the specified datastreamId. It is possible to specify the datapoint index inside the datastream. If not found, a null value will be returned.

Kind: global function
Returns: *

Param Type Description
datastream string Datastream identifier which value must be returned
dpIndex number Datapoint index. If not defined first datapoint will be returned

Example of use:

var dpValue = collection.getValue('device.name');
// dpValue will be 'collected name from cf'

Operation Steps API

Connector functions JS API guide for the response object and immediate operation steps notification

This API provides methods on the response global object to build operation step results, notify them immediately, and set the operation result code.

JS API

response.addStep(name, result, description, stepResponseList)

Builds a step result object and adds it to the steps list in the response global object.

Kind: global function
Returns: Void

Param Type Description
name string Step name. If not provided null will be set.
result string Step result. If not provided null will be set.
description string Step result description. If not provided null will be set.
stepResponseList string StepResponse objects array. If not provided, empty array will be assigned.

Example of use:

response.addStep('FACTORY_RESET', 'SUCCESSFUL', 'direct step from CF');

response.sendSteps()

Sends a step response message to the OpenGate’s operation messages flow using the steps list in the response object, after that this list is cleaned.

Kind: global function
Returns: Void

Example of use:

response.sendSteps();

response.successful(statusDescription)

This method sets the SUCCESSFUL statusCode with the provided description.

Kind: global function
Returns: Void

Param Type Description
statusDescription string Descriptive text for result.

Example of use:

response.successful("CF finished correctly");

response will contain the following data:

{
    "operation": {
        "response": {
            //...
            "resultCode": "SUCCESSFUL",
            "resultDescription": "CF finished correctly",
            //...
        }
    }
}

response.errorProcessing(statusDescription)

This method sets the ERROR_PROCESSING statusCode with the provided description.

Kind: global function
Returns: Void

Param Type Description
statusDescription string Descriptive text for result.

Example of use:

response.errorProcessing("Error executing CF");

response will contain the following data:

{
    "operation": {
        "response": {
            //...
            "resultCode": "ERROR_PROCESSING",
            "resultDescription": "Error executing CF",
            //...
        }
    }
}

response.errorInParam(statusDescription)

This method sets the ERROR_IN_PARAM statusCode with the provided description.

Kind: global function
Returns: Void

Param Type Description
statusDescription string Descriptive text for result.

Example of use:

response.errorInParam("Incorrect param from CF");

response will contain the following data:

{
    "operation": {
        "response": {
            //...
            "resultCode": "ERROR_IN_PARAM",
            "resultDescription": "Incorrect param from CF",
            //...
        }
    }
}

response.notSupported(statusDescription)

This method sets the NOT_SUPPORTED statusCode with the provided description.

Kind: global function
Returns: Void

Param Type Description
statusDescription string Descriptive text for result.

Example of use:

response.notSupported("Not supported from CF");

response will contain the following data:

{
    "operation": {
        "response": {
            //...
            "resultCode": "NOT_SUPPORTED",
            "resultDescription": "Not supported from CF",
            //...
        }
    }
}

response.errorTimeout(statusDescription)

This method sets the ERROR_TIMEOUT statusCode with the provided description.

Kind: global function
Returns: Void

Param Type Description
statusDescription string Descriptive text for result.

Example of use:

response.errorTimeout("Timeout error from CF");

response will contain the following data:

{
    "operation": {
        "response": {
            //...
            "resultCode": "ERROR_TIMEOUT",
            "resultDescription": "Timeout error from CF",
            //...
        }
    }
}

response.unknownResult(statusDescription)

This method sets the UNKNOWN_RESULT statusCode with the provided description.

Kind: global function
Returns: Void

Param Type Description
statusDescription string Descriptive text for result.

Example of use:

response.unknownResult("Unknow result from CF");

response will contain the following data:

{
    "operation": {
        "response": {
            //...
            "resultCode": "UNKNOWN_RESULT",
            "resultDescription": "Unknow result from CF",
            //...
        }
    }
}

Operation JavaScript API

Connector functions - Active Operation JS API guide

This API allows users to read and activate operations from a connector function.

operation – Main Object

The operation object is the main object. It allows making requests to the Operations API.

To do the request, the object operation use the HTTP-Client API, you can use all attribute of this interface, for example, to add a certificate http.client.certificate=XXX

operation – Object Properties

Property Type Description
deviceId string Target device id of the operation pending
apiKey string Api-Key to use in the request to the Operations-API
host string Host to use in the request to the Operations-API

By default, the attributes will be set with the value of the context.

operation – Functions

operation.getAllPending()

Read and return the selected device operations pending (with status WAITING_FOR_CONNECTION) of the user to execute the CFx

This function does not require parameters.

The operation.getAllPending function returns an object, described as follows:

Property Type Attributes Description
error null or string Message Description of the exception error caught, or error sent by the request. It will be null when the request contains no errors
opResult Object statusCode, Object Contains statusCode, and the result list object of the request, when it’s OK

Example of use with default values:

var opResult = operation.getAllPending();

operation.getNotFinished()

Read and return the selected device operations that are not finished

This function does not require parameters.

Function operation.getNotFinished return object, descript like:

Property Type Attributes Description
error null or string Message Description of the exception error caught, or error sent by the request. will be null, when the request no contains errors
opResult Object statusCode, Object Contains statusCode, and the result list object of the request, when it’s OK

Example of use:

var opResult = operation.getNotFinished();

operation.getByCustomCondition(customCondition)

Read and return the selected device operations that match a custom filter condition

Param Type Description
customCondition Object Filter condition to apply (e.g., { 'eq': { 'operationStatus': 'IN_PROGRESS' } })

Function operation.getNotFinished return object, descript like:

Property Type Attributes Description
error null or string Message Description of the exception error caught, or error sent by the request. will be null, when the request no contains errors
opResult Object statusCode, Object Contains statusCode, and the result list object of the request, when it’s OK

Example of use:

var opResult = operation.getByCustomCondition({ 'eq': { 'operationStatus': 'IN_PROGRESS' } });
opResult – Object Functions

opResult is a JSON List Object returned by the operation.getAllPending function. You can use the following functions:

Function Return Description
activate null or string Activates the target operation. Returns null when the activation is OK, otherwise returns the error cause message
getRequest Object Builds and returns the request the device must send to respond to the operation

The object -opResult- contains all attributes and functions of the response (operation) object.

activate()

Activate the target operation selected with parameters of the context (Update to IN_PROGRESS the operation)

This function does not require parameters.

Example of use with default values:

var opResult = operation.getAllPending();
if (opResult.error) {
    return error;
}
opResult.forEach(op => op.activate());
getRequest()

Builds and returns the request the device must send to respond to the operation

This function does not require parameters.

reqRes – Object return the getRequest function

reqRes is a JSON Object returned by the getRequest function, described as follows:

Property Return Description
operation Object Main object to do the request

– Attributes of operation

Property Return Description
request Object Secondary main object to do the request

– Attributes of request

Property Return Description
name Object Operation name target of the request
id Object Operation identifier target of the request
parameters Object Parameters to use in the request
timestamp Object Operation time on do the request

By default, the attributes will be set with the value of the target operation.

Example getRequest object return:

{ 
    'operation': {
        'request': {
            'name': 'opName',
            'id': 'ce02792a-3a37-11f0-a48d-52540044ee01',
            'parameters': {},
            'timestamp': Date.now()
        }
    }
}

Example of use getRequest function:

var opResult = operation.getAllPending();
if (opResult.error) {
    return error;
}
opResult.forEach(op => {
        op.activate();
        http.client.body = op.getRequest();
        var httpResp = http.client.post();
        if (httpResp.statusCode != 201) {
            throw Error('Unexpected response:', httpResp);
        }
    }
);

Provision JavaScript API

Connector functions - Provision JS API guide

This API allows users to manage entity provisioning (creation and retrieval) from a connector function.

provision – Main Object

The provision global object provides properties and methods to interact with the Provisioning API.

provision – Object Properties

Property Type Default Description
apiKey string If available, current connection’s apikey API Key for the request.
host string Frontend’s default endpoint Host for the Provisioning API.
identifier string null Identifier of the entity to act upon.
organization string Device`s organization Organization to which the entity belongs.
serviceGroup string "emptyServiceGroup" Service Group for the entity.
defaultChannel string "defaultChannel" Channel to which the entity belongs.
plan string null Provisioning plan to apply.
extraDatastreams Array [] Extra data as an array of objects like {datastreamId:value} pairs.

provision – Functions

provision.get(id)

Retrieves an existing entity from the database with specified identifier.

Kind: global function
Returns: Object - If entity is found, entity data will be returned in result. If it is not found, result field will be null. If some error happened, it will be returned in error field.

Param Type Default Description
id string this.identifier (Optional) Entity identifier. If not defined identifier field will be used.

Example with provision.identifier:

provision.identifier = "device_123";
const resp = provision.get();
if (!resp.error && resp.result) {
    logger.info("Entity identifier:", resp.result._value("provision.administration.identifier"));
}

Example with parameter:

const resp = provision.get("device_123");
if (!resp.error && resp.result) {
    logger.info("Entity identifier:", resp.result._value("provision.administration.identifier"));
}

Example with unexepected error:

const resp = provision.get("device_123");
if (resp.error) {
    logger.error("Some error:", resp.error);
}

The object resp.result contains then same functions than entity object.

provision.create(fullBody)

Creates a new entity in the platform.

Kind: global function

Param Type Description
fullBody Object (Optional) Complete JSON body for the creation request. If not provided, it is generated from the object properties.

Returns: Object - An object containing either result (201 status) or error.

Example using properties:

provision.identifier = "new_device_001";
provision.plan = "TEST_PLAN";
provision.extraDatastreams = [{ "provision.device.name": "cellName" }, { "provision.device.administrativeState": "ACTIVE" }, { "provision.device.specificType": "COMHUB" }, { "provision.tec": "NBIoT Cell" }];
const resp = provision.create();
if(!resp.error && resp.result == 201) {
    logger.info('Created');
} else {
    logger.error('Error creating entity:', resp.error);
}

Previous example will create with following body:

{
    "provision.administration.channel": {
        "_value": {
            "_current": {
                "value": "defaultChannel"
            }
        }
    },
    "provision.administration.identifier": {
        "_value": {
            "_current": {
                "value": "new_device_001"
            }
        }
    },
    "provision.administration.organization": {
        "_value": {
            "_current": {
                "value": "deviceOrg"
            }
        }
    },
    "provision.administration.serviceGroup": {
        "_value": {
            "_current": {
                "value": "emptyServiceGroup"
            }
        }
    },
    "provision.administration.plan": {
        "_value": {
            "_current": {
                "value": "TEST_PLAN"
            }
        }
    },
    "provision.device.name": {
        "_value": {
            "_current": {
                "value": "cellName"
            }
        }
    },
    "provision.device.administrativeState": {
        "_value": {
            "_current": {
                "value": "ACTIVE"
            }
        }
    },
    "provision.device.specificType": {
        "_value": {
            "_current": {
                "value": "COMHUB"
            }
        }
    },
    "provision.tec": {
        "_value": {
            "_current": {
                "value": "NBIoT Cell"
            }
        }
    }
}

If fullBody is provided, it will be used as the request body instead of building it from the object properties.

Example:

const body = {
    "provision.administration.channel": {
        "_value": {
            "_current": {
                "value": "defaultChannel"
            }
        }
    },
    "provision.administration.identifier": {
        "_value": {
            "_current": {
                "value": "new_device_001"
            }
        }
    },
    "provision.administration.organization": {
        "_value": {
            "_current": {
                "value": "deviceOrg"
            }
        }
    },
    "provision.administration.serviceGroup": {
        "_value": {
            "_current": {
                "value": "emptyServiceGroup"
            }
        }
    }
};
const resp = provision.create(body);
if(!resp.error && resp.result == 201) {
    logger.info('Created');
} else {
    logger.error('Error creating entity:', resp.error);
}

Concatenated Connector Functions API

Concatenated connector functions JS API guide

This file provides methods to build concatenated function executions. These methods belong to cf global object.

JS API

cf.response(responseFunctionCriteria, responsePayload)

Sets a call for a RESPONSE connector function, if there is one that matches the south criteria indicated in responseFunctionCriteria, setting its input payload to the value of responsePayload.

Kind: global function
Returns: Void

Param Type Description
responseFunctionCriteria string The south criteria that will be used to find a RESPONSE connector function.
responsePayload any It can be a String or a JSON object. In case it is null or not provided, the current connector function response object will be used instead. It is the in payload for the concatenated RESPONSE connector function.

Example of use:

var resp = {
    'result': {
        'code': 'SUCCESSFUL',
        'description': 'Operation finished successful'
    },
    'data': {}
};

cf.response('snmps://1.0.1.4.5.123456.1.7', resp);

cf.collection(collectionFunctionCriteria, collectionPayload)

Sets a call for a COLLECTION connector function, if there is one that matches the south criteria indicated in collectionFunctionCriteria, setting its input payload to the value of collectionPayload.

Kind: global function
Returns: Void

Param Type Description
collectionFunctionCriteria string The south criteria that will be used to find a COLLECTION connector function.
collectionPayload any It can be a String or a JSON object. In case it is null or not provided, the current connector function response object will be used instead. It is the in payload for the concatenated COLLECTION connector function.

Example of use:

var colMsg = {
    '1.0.1.4.5.123456.1.7.1': 'device name',
    '1.0.1.4.5.123456.1.7.2': 'device description',
};

cf.collection('snmps://1.0.1.4.5.123456.1.7', colMsg);

UTILS JavaScript API

Connector functions UTILS JS API guide

In this javascript code, there are helper operations available to help users who are building their own functions. We will explain them below.

JS UTILS API

These operations are grouped by their topic, at this time the available areas are:

  • AT commands
  • Endesa commands
  • ODM commands
  • Time commands

utils.atcmd.toDBm(value)

Translates the response got by the ‘AT+CSQ’ command, which is the GSM signal strength and a numerical value, to its corresponding dBm value.

Kind: global function
Returns: The translation to dBm value

Param Type Description
value number The GSM signal strength.

Example of use:

var dbVal = utils.atcmd.toDBm(1234);

utils.endesa.torscp(value)

Param Type Description
value string value to be converted

Example of use:

var val = utils.endesa.torscp("1234");

utils.endesa.toDbmPlusQuality(value)

Param Type Description
value string value to be converted

Example of use:

var val = utils.endesa.toDbmPlusQuality("1234");

utils.endesa.prepareMsisdn(msisdn)

If msisdn starts with “34”, then returns the value without “34”. Kind: global function
Returns: returns msisdn parameter without format

Param Type Description
msisdn string msisdn to be converted

Example of use:

var newMsisdn = utils.endesa.prepareMsisdn("341234567890");
//newMsisdn will be: 1234567890

utils.endesa.commandFrom(command)

Depending on the command value, specific translation will be returned.

Kind: global function
Returns: returns msisdn parameter without format

Param Type Description
command string command to be translated

Example of use:

var newCommand = utils.endesa.commandFrom("9600;8E1");
//newCommand will be: ATS37=9S13=1\r\n

utils.odm.addValueToContext(key,value)

Kind: global function

Param Type Description
key string key to be added to context
value string value to be added to context

Example of use:

utils.odm.addValueToContext("key", "value");

utils.odm.sleep(time)

Sleeps for specified time

Param Type Description
time number time to sleep in milliseconds

Example of use:

utils.odm.sleep(1000);

utils.odm.encryptString(originalValue, datastreamConfiguration, organizationName)

Encrypt an original string with the configuration established by the datastream of the organization

Kind: global function
Returns: The originalValue encrypted

Param Type Description
originalValue string The value to encrypt.
datastreamConfiguration string The datastream of provision type, of the datamodel that define this value. This datastream has the configuration of encryption.
organizationName string The organization name to which the datamodel belongs.

Example of use:

var encryptedValue = utils.odm.encryptString("originalValue", "datastreamConfiguration", "organizationName");

utils.odm.decryptString(encryptedValue, datastreamConfiguration, organizationName)

Decrypt an encrypted string with the configuration established by the datastream of the organization

Kind: global function
Returns: The encryptedValue decrypted

Param Type Description
encryptedValue string The encrypted value to decrypt.
datastreamConfiguration string The datastream of provision type, of the datamodel that define this value. This datastream has the configuration of encryption.
organizationName string The organization name to which the datamodel belongs.

Example of use:

var decryptedValue = utils.odm.decryptString("encryptedValue", "datastreamConfiguration", "organizationName");

utils.odm.getAddressTypeFromAddress(address)

Calculates the address type from a given address

Kind: global function
Returns: The address type

Param Type Description
address string The address which the type will be calculated for.

Example of use:

var addressType = utils.odm.getAddressTypeFromAddress("[IP_ADDRESS]");
//addressType will be: ipv4

var addressType = utils.odm.getAddressTypeFromAddress("2001:0db8:85a3:0000:0000:8a2e:0370:7334");
//addressType will be: ipv6

utils.odm.entitiesValue(entities, datastream, index)

Extract from the first entity of entities array specified datastream “value” field value.

Kind: global function
Returns: * - Specified datastream “value” field. It can be complex object. null if datastream does not exist.

Param Type Description
entities Array Array of objects with flattened entity.
datastream String Datastream name, for example: ‘provision.device.identifier’.
index number Array Index. If provided datastream is an array (i.e. comm module), element index must be specified.

Example of use:

var value = utils.odm.entitiesValue(entities, "provision.device.identifier", 0);

utils.odm.httpRequest(request, payload)

Executes specified request with specified payload.

Kind: global function
Returns: Object - JSON with response. It will have two fields: ‘statusCode’ with http result code and ‘body’ with response body content.

Param Type Description
request Object Object with requests parameters: ‘method’, ‘uri’ and ‘headers’. - ‘method’: GET, POST, PUT, DELETE. - ‘uri’: request uri. - ‘headers’: json with http request headers.
payload * data to be sent. It can be null.

Example of use:

var response = utils.odm.httpRequest({method: "GET", uri: "http://example.com", headers: {}}, null);

utils.date.period.previousQuarter(referenceTimeMillis)

Calculates previous quarter from specified time in milliseconds.

Kind: global function
Returns: return an object with initial and final times of defined period

Param Type Description
referenceTimeMillis number reference time in milliseconds

Example of use:

var period = utils.date.period.previousQuarter(1698841200000);//2023-11-01 12:20:00

It will return:

{
    "initial": 1698840000000, //2023-11-01 12:00:00:000
    "final": 1698840899000, //2023-11-01 12:14:59:999
    "type": "previousQuarter" 
}

utils.date.period.previousDay(referenceTimeMillis)

Calculates previous day from specified time in milliseconds.

Kind: global function
Returns: return an object with initial and final times of defined period

Param Type Description
referenceTimeMillis number reference time in milliseconds

Example of use:

var period = utils.date.period.previousDay(1698841200000);//2023-11-01 12:20:00

It will return:

{
    "initial": 1698840000000, //2023-10-31 00:00:00:000
    "final": 1698840899000, //2023-10-31 23:59:59:999
    "type": "previousDay" 
}

utils.date.period.previousWeek(referenceTimeMillis)

Calculates previous week from specified time in milliseconds.

Kind: global function
Returns: return an object with initial and final times of defined period

Param Type Description
referenceTimeMillis number reference time in milliseconds

Example of use:

var period = utils.date.period.previousWeek(1698841200000);//2023-11-01 12:20:00 (Wednesday)

It will return:

{
    "initial": 1698840000000, //2023-10-23 00:00:00:000 (Monday)
    "final": 1698840899000, //2023-10-29 23:59:59:999 (Sunday)
    "type": "previousWeek" 
}

utils.date.period.previousMonth(referenceTimeMillis)

Calculates previous month from specified time in milliseconds.

Kind: global function
Returns: return an object with initial and final times of defined period

Param Type Description
referenceTimeMillis number reference time in milliseconds

Example of use:

var period = utils.date.period.previousMonth(1698841200000);//2023-11-01 12:20:00

It will return:

{
    "initial": 1698840000000, //2023-10-01 00:00:00:000
    "final": 1698840899000, //2023-10-31 23:59:59:999
    "type": "previousMonth" 
}

utils.date.period.customPeriodUtc(initialTimeStr, finalTimeStr)

Calculates specified period in utc times in milliseconds.

Kind: global function
Returns: return an object with initial and final times of defined period

Param Type Description
referenceTimeMillis number reference time in milliseconds

Example of use:

var period = utils.date.period.customPeriodUtc("2011-11-01T14:20:00.000+0100","2011-11-01T14:25:00.000+0100");

It will return:

{
    "initial": 1698844800000, //2011-11-01T13:20:00.000
    "final": 1698845100000, //2011-11-01T13:25:00.000
    "type": "custom" 
}

utils.date.period.lastMinutes(minutes, referenceTimeMillis)

Calculates a period of defined minutes until reference time. If referenceTimeMillis is not defined, current time will be used as reference

Kind: global function
Returns: return an object with initial and final times of defined period

Param Type Description
minutes number number of minutes of period
referenceTimeMillis number reference time in milliseconds

Example of use:

var period = utils.date.period.lastMinutes(15, 1698841200000);//2023-11-01 12:20:00

It will return:

{
    "initial": 1698840000000, //2023-11-01 12:05:00:000
    "final": 1698841200000, //2023-11-01 12:20:00:000
    "type": "lastMinutes" 
}

utils.date.period.lastHours(hours, referenceTimeMillis)

Calculates a period of defined hours until reference time. If referenceTimeMillis is not defined, current time will be used as reference

Kind: global function
Returns: return an object with initial and final times of defined period

Param Type Description
hours number number of hours of period
referenceTimeMillis number reference time in milliseconds

Example of use:

var period = utils.date.period.lastHours(24, 1698841200000);//2023-11-01 12:20:00

It will return:

{
    "initial": 1698840000000, //2023-10-31 12:20:00:000
    "final": 1698841200000, //2023-11-01 12:20:00:000
    "type": "lastHours" 
}

utils.date.period.lastDays(days, referenceTimeMillis)

Calculates a period of defined days until reference time. If referenceTimeMillis is not defined, current time will be used as reference

Kind: global function
Returns: return an object with initial and final times of defined period

Param Type Description
days number number of hours of period
referenceTimeMillis number reference time in milliseconds

Example of use:

var period = utils.date.period.lastDays(7, 1698841200000);//2023-11-01 12:20:00

It will return:

{
    "initial": 1698840000000, //2023-10-25 12:20:00:000
    "final": 1698841200000, //2023-11-01 12:20:00:000
    "type": "lastDays" 
}

utils.bytes.fromHexString(hexString)

Kind: global function
Returns: return an Uint8Array object equivalent to de hexadecimal String

Param Type Description
hexString string String in hexadecimal format

Example of use:

var bytes = utils.bytes.fromHexString("09 4A 48")

It will return:

[09, 74, 72]

utils.bytes.toHexString(array)

Kind: global function
Returns: return the hexadecimal string representation.

Param Type Description
array Array of bytes hexadecimal string representation

Example of use:

var hexStr = utils.bytes.toHexString([09, 74, 72])

It will return:

"094A48"

utils.bytes.fromText(str)

Kind: global function
Returns: return the Uint8Array representation of the string with UTF encoding.

Param Type Description
str string any text

Example of use:

var bytes = utils.bytes.fromText("Hello!")

It will return:

[72, 101, 108, 108, 111, 33]

utils.bytes.toText(bytes)

Kind: global function
Returns: return the string representation of array of bytes in UTF.

Param Type Description
bytes Array of bytes bytes representing a text in UTF

Example of use:

var text = utils.bytes.toText([72, 101, 108, 108, 111, 33])

It will return:

"Hello!"

Cryptography API

Connector functions JS API guide for crypto utility

This file provides methods for different crypto utilities using crypt global object.

Encrypt and decrypt messages with AES algorithms

The crypt.aes global object provides all the functions for encryption and decryption using the AES algorithm.

These JavaScript functions use the cipher algorithm identifier required by the Java method javax.crypto.Cipher.getInstance(algorithm), composed of {CipherName}/{cipherMode}/{CipherPadding}. Some examples are:

  • AES/CBC/NoPadding
  • AES/CBC/PKCS5Padding
  • AES/ECB/NoPadding
  • AES/ECB/PKCS5Padding
  • AES/GCM/NoPadding

Data hashing

The crypt.hmac global object provides functions for hashing data.

AES JS API

crypt.aes.encrypt(algorithm, key, ivParameterSpec, data)

Encrypt the data using the selected AES algorithm with the provided shared key.

Kind: global function
Returns: Uint8Array

Param Type Description
algorithm string algorithm identifier, as required in java javax.crypto.Cipher.getInstance(algorithm). For example: AES/CBC/PKCS5Padding
key Uint8Array key used to encrypt the data. In AES algorithms. The key size must match the selected algorithm. For example, AES algorithms support keys of 16 bytes (AES-128), 24 bytes (AES-192), or 32 bytes (AES-256).
ivParam Uint8Array Initialization vector (IV) used in encryption. Only allowed or required depending on the selected algorithm.
data Uint8Array data to be encoded
var key128 = utils.bytes.fromText('012345678902345a'); /* 128 bits for AES-128 */
var ivParam = utils.bytes.fromText('0123456789023452');

var inputData = [104, 111, 108, 97, 32, 99, 97, 114, 97, 108, 99, 111, 108, 52, 53, 54];
var encriptedData = crypt.aes.encrypt("AES/CBC/NoPadding", key128, ivParam, inputData); 

log(encriptedData) // Expected output: [178,19,136,33,80,100,25,183,126,178,19,125,139,24,212,253]

crypt.aes.decrypt(algorithm, key, ivParameterSpec, data)

Decrypt the data using the selected AES algorithm with the provided shared key.

Kind: global function
Returns: Uint8Array

Param Type Description
algorithm string algorithm identifier, as required in java javax.crypto.Cipher.getInstance(algorithm). For example: AES/CBC/PKCS5Padding
key Uint8Array key used to decrypt the data. In AES algorithms. The key size must match the selected algorithm. For example, AES algorithms support keys of 16 bytes (AES-128), 24 bytes (AES-192), or 32 bytes (AES-256).
ivParam Uint8Array Initialization vector (IV) used in encryption. Only allowed or required depending on the selected algorithm.
data Uint8Array encoded data to be decrypted
var key128 = utils.bytes.fromText('012345678902345a'); /* 128 bits for AES-128 */
var ivParam = utils.bytes.fromText('0123456789023452');

var inputEncrypted = [178,19,136,33,80,100,25,183,126,178,19,125,139,24,212,253]
var data = crypt.aes.decrypt("AES/CBC/NoPadding", key128, ivParam, inputEncrypted);

log(data) // Expected output: [104, 111, 108, 97, 32, 99, 97, 114, 97, 108, 99, 111, 108, 52, 53, 54] 

HMAC JS API

Following functions apply some hashing function with specified key to specified data. In all cases, the result is a JSON with following structure:

Param Type Description
error string It will be null if hashing finishes correctly. If hashing fails, exception message will be indicated.
result Uint8Array Obtained hash. If the hash function is applied correctly, byte array with hashed data will be returned. If some error occurs, null will be returned

Correct hashing result:

{
 "error": null,
 "result": [-102, 54, -66, -103, -25, 112, 1, 118, -65, 122, -22, 27, 88, 106, -54, 122, -11, -109, -63, 99, -127, -23, -15, -43, 28, 109, -22, -65, 25, 45, -85, 9, 39, 44, 39, 75, -95, -47, -61, -103, 101, -80, -62, -35, -102, 74, -76, 45, 94, -7, -35, 8, -80, -80, -65, -103, 127, 104, 75, -65, -89, 111, -34, 109]
}

Result with some error

{
 "error": "Algorithm HmacSHA999 not available",
 "result": null
}

crypt.hmac.sha256(data, key)

Create a hash from provided string using sha256.

Kind: global function
Returns: Object

Param Type Description
data string Data to be hashed
key Uint8Array key to be used for hashing
var hashResult = crypt.hmac.sha256("Some data to be hashed", "hashingKey");
log(hashResult) 
/* Expected output: 
{
 "error": null,
 "result": [-56, -6, 82, -104, -74, -100, -103, 112, 80, -89, -61, 85, -63, 58, -102, -54, -68, 15, 70, 60, 44, 85, 110, -100, -108, -95, -48, -3, 8, -25, 33, -4]
}
*/

crypt.hmac.sha512(data, key)

Create a hash from provided string using sha512.

Kind: global function
Returns: Object

Param Type Description
data string Data to be hashed
key Uint8Array key to be used for hashing
var hashResult = crypt.hmac.sha512("Some data to be hashed", "hashingKey");
log(hashResult) ;
/* Expected output: 
{
 "error": null,
 "result": [-102, 54, -66, -103, -25, 112, 1, 118, -65, 122, -22, 27, 88, 106, -54, 122, -11, -109, -63, 99, -127, -23, -15, -43, 28, 109, -22, -65, 25, 45, -85, 9, 39, 44, 39, 75, -95, -47, -61, -103, 101, -80, -62, -35, -102, 74, -76, 45, 94, -7, -35, 8, -80, -80, -65, -103, 127, 104, 75, -65, -89, 111, -34, 109]
}
*/

Protocol APIs

You only need the page for the protocol your device actually speaks. Each of these injects one global object into your script, on top of the core API that is always there.

This is the reference, not the guide

These pages document which functions you can call. For how an integration over that protocol works — who opens the conversation, what the device must be, how to schedule the work — read Supported protocols, and then the page for your transport: HTTP, MQTT, WebSocket, CoAP, Meter and industrial protocols or Remote access.

Transports OpenGate already speaks

The device arrived over one of these, and the API lets you read the incoming message and shape the reply.

Protocol Object Gives you
HTTP http The received request, the response you return, and an HTTP client for outgoing calls
MQTT mqtt Publish messages to a topic
WebSocket Send a message down an already open connection
CoAP coap.server.response Set the status code, content format and body of the CoAP response. Integration: CoAP

Meter and industrial protocols

Here the connector function is the one that opens the conversation, usually to poll a meter.

Protocol Object Gives you
DLMS dlms Open a DLMS connection and run get, set and action requests
DLMS Gas dlms_gas Smart Gas meters across manufacturers, on top of DLMS
IEC102 Connect over IEC102 and execute ASDUs: login, time, load curves, profiles
SNMP snmp SNMP get and set against a device

Shell and network access

Protocol Object Gives you
SSH ssh Open a session, send commands, read the answer
Telnet The same over Telnet
ICMP Send a ping and process the result
ICMP Response payload The payload a RESPONSE function receives with the ping result

Subscriptions

Protocol Object Gives you
Kite kite Query and change a subscription’s status through the Kite connector

Subsections of Protocol APIs

HTTP JavaScript API

Connector functions HTTP JS API guide

This API allows users to execute HTTP related actions from a connector function.

HTTP Object

The http object is the main object of the HTTP client. It allows perform different actions such as do http request or define http response for Operation Response or Iot Collections requests through http protocol.

http object is divided in two objects:

  • server: Only for CFs called from http requests. Gives access to received request and allows to specify http response to be sent.
  • client: Configure and make http requests.

server Object Properties

Read only properties with received HTTP request and response object to define HTTP response to be sent.

Property Type Default Description
headers JSON Received http request headers
uri string Received http request uri (without host)
body * Received http request body (the same content as the payload property)
response JSON {} Object to be used to define http response to be sent when CF finishes

server.response Object Properties

Property Type Default Description
status integer 201 Response HTTP code
body * null Response body
headers JSON null Response HTTP headers

server.response Object Methods

server.response.send()

Creates HTTP Response with defined properties. The response will be sent once the CF is finished correctly.

Example:

http.server.response.status=200;
http.server.response.body={'msg': 'OK'};
http.server.response.send();
//continue CF execution
return collection;

In this case, after CF execution, the Http response to be generated will have 200 status code with specified body ({'msg': 'OK'}) and no specific headers.

client Object Properties

Property Type Default Description
method string null One of http methods: POST, GET, …
uri string null Request uri
headers JSON null Request headers in json format
body * null Response body
alias string null Used to set custom https context, alias to be used for keystore
certificate string null Used to set custom https context, certificate content
privateKey string null Used to set custom https context, private key content
redirectPolicy string null Overrides default redirection policy
clientVersion string null Overrides default client version configured
timeOut integer null Overrides default timeout configured. Defined in seconds

client Object Methods

Following methods return Http Request result JSON with these fields:

Field Description
statusCode Received response HTTP code
body Received response body
headers Received response headers

client.post()

Performs POST using defined configuration. Overrides defined method.

Example of use with default values:

http.client.uri = "https://remotehost/uri";
http.client.headers = {'X-Api-Key':'apikey'};
http.client.body = {'operation_name':'custom_operation_request'};
var httpResp = http.client.post();

client.put()

Performs PUT using defined configuration. Overrides defined method.

Example of use with default values:

http.client.uri = "https://remotehost/uri";
http.client.headers = {'X-Api-Key':'apikey'};
http.client.body = {'operation_name':'custom_operation_request'};
var httpResp = http.client.put();

client.get()

Performs GET using defined configuration. Overrides defined method.

Example of use with default values:

http.client.uri = "https://remotehost/uri";
http.client.headers = {'X-Api-Key':'apikey'};
var httpResp = http.client.get();

client.delete()

Performs DELETE using defined configuration. Overrides defined method.

Example of use with default values:

http.client.uri = "https://remotehost/uri";
http.client.headers = {'X-Api-Key':'apikey'};
var httpResp = http.client.delete();

client.patch()

Performs PATCH using defined configuration. Overrides defined method.

Example of use with default values:

http.client.uri = "https://remotehost/uri";
http.client.headers = {'X-Api-Key':'apikey'};
http.client.body = {'operation_name':'custom_operation_request'};
var httpResp = http.client.patch();

client.request()

Performs configured http request. method property must be defined.

Example of use with default values:

http.client.method = "GET";
http.client.uri = "https://remotehost/uri";
http.client.headers = {'X-Api-Key':'apikey'};
http.client.body = {'operation_name':'custom_operation_request'};
var httpResp = http.client.request();

MQTT JavaScript API

Connector functions MQTT JS API guide

This API allows users to execute operations in the MQTT client from a connector function.

MQTT Object

The mqtt object is the main object of the MQTT client. It allows publishing messages to an MQTT topic.

mqtt Object Properties

Property Type Default Description
device string entity id Target device id
topic string odm/request Topic uri where to publish the message

mqtt Object Methods

mqtt.publish(payload)

Publish a message on mqtt topic

Property Type Default Description
payload * Message to be sent. It can be string or a json object

Example of use with default values:

mqtt.publish({'operation_name':'custom_operation_request'});

Example of use with overriden values

mqtt.device='other_device';
mqtt.topic = 'destination/topic';
mqtt.publish('Message to be sent');

Websocket JavaScript API

Connector functions websocket JS API guide

This API allows users to send message to opened websocket.

Websocket Object Properties

Property Type Description
payload * Data to be published. It will be converted to string.
deviceId String Device identifier with the opened websocket

Websocket Object Methods

websocket.sendMsg()

Executes specified request using the properties of the websocket object

Returns: Object

Example of use:

websocket.payload = {someField:someValue};
websocket.deviceId = 'someDeviceId'
websocket.sendMsg();

CoAP API

Connector functions JS API guide for the CoAP protocol

This file provides methods and properties to specify a custom return code and a custom body in the CoAP response that is sent from the OpenGate platform to the device.

coap.server.response Object: Specifying a custom CoAP response to the device.

The coap.server.response global object provides all the necessary functionality to be able to specify both the state and the body of the CoAP response to return to the device.

coap.server.response Object Properties

Property Type Default Description
status number 204 The returned status, as a three digits number without dots
body Uint8Array [] The body of the returned CoAP response, as array of bytes
contentFormat number Indicates the representation format of the response body

coap.server.response Object Methods

coap.server.response.send()

The status, body and contentFormat are saved for inclusion in the CoAP response.

Example of use

// sending CHANGED status (2.04), and a number 1 as body (two bytes unsigned integer - little endian)
coap.server.response.status = 204; 
coap.server.response.body = new Uint8Array([01, 00]); 
coap.server.response.send();

DLMS JavaScript API

Connector functions DLMS JS API guide

This JavaScript code provides predefined functions to execute DLMS requests from the connector function. They are explained below.

Tip

For Smart Gas devices, there is a specialized extension of this API called DLMS Gas API which simplifies many common operations.

Types of south criteria for your DLMS connector function:

Description Format Example
Identification via OBIS code for notifications that contain a description element dlms://obis/<obis-code> dlms://obis/0.0.66.0.48.255
Identification via template ID for notifications containing only 1 or more octet-string values and taking first byte of each octet-string as template ID dlms://template/<template-id> dlms://template/48
Warning

The OBIS Code needs to be specified using only dots as separator, don’t use the complex form 0-0:66.0.48.255 or the Connector Function will not be called.

Input parameters in Collection Connector Function

The main script will have access to three main vars:

  • entity: json with flattened operation target device entity representation.
  • gateway: json with flattened gateway entity representation. It can be null.
  • payload: json that represents the DLMS message received from the device.
  • contextParams: json object with execution context information. It can have some of this params:
    • apiKey: device or user apikey.
    • remoteIp: remote host where DLMS message is invoked.
    • obisCode: OBIS code of the message arrived.
    • templateId: Template identifier of the message arrived.

ContextParams for COLLECTION Connector function for DLMS connection:

{
  "apiKey": "97c9ceae-c4ee-49ea-ad50-e499bb55ac63",
  "obisCode": "0.1.2.3.3.5",
}

Here is a payload example:

payload = [
	{
	    "obisCode": "0.0.49.0.75.254",
	    "attrId": 2,
	    "classId": 1,
	    "type": "octet-string",
	    "value": [2, 3, 215, 0]
	},
	{
	    "obisCode": "0.0.49.0.77.254",
	    "attrId": 4,
	    "classId": 1,
	    "type": "unsigned",
	    "value": 1
	}
]

JS DLMS API

For REQUEST Connector Functions we will use the functions described below. You have an object, named dlms, with all the functions described. You must use dlms.<function>.

If you want to collect data after executing any of these function you can call collectCF and you can set various obis code in the URL provided as you can see in the next example:

collectCF(result.data, "dlms://obis/0.1.2.3.4.5");

dlms.connect()

Opens DLMS connection (default via TCP transport).

Kind: global function

The connection parameters need to be set before calling connect:

dlms.ip = "127.0.0.1"
dlms.connect()
Config name Type Default value Description
ip string null IP address of the device you want to connect to.
port number 4059 Port of the device you want to connect to.
connectionType string ("TCP", "UDP") "TCP" Protocol of the device you want to connect to.
cwport number 16 Client WPort.
swport number 1 Server WPort.
refMethod string ("LN", "SN") "LN" Server WPort.
securityLevel string ("MANUFACTURER", "HIGH", "LOW", "SHA1, "SHA256", "MD5", "GMAC", "ECDSA", "NONE") "NONE" Authentication mechanism to use in the connection.
password string null Password to use with the authentication mechanism.
timeout number 5000 Timeout of the connection.
security string (NONE, AUTHENTICATION, ENCRYPTION, AUTHENTICATION_ENCRYPTION) null Security used in every message. null value will be treated as NONE
securitySuite string (SUITE_0, SUITE_1, SUITE_2) null Authentication, encryption and key wrapping algorithm. null value will be treated as SUITE_0
authenticationKey byte[] as hexadecimal string null Key used for message authentication. The length of the key in bytes must match the securitySuite used
blockCipherKey byte[] as hexadecimal string null Key used for message encryption. The length of the key in bytes must match the securitySuite used
hesSystemTitle byte[] as hexadecimal string null Overrides default System Title to be sent in requests to client
ignoreSystemTitleInCiphering boolean false Whether the optional hesSystemTitle should be ignored (not sent) when sending ciphered messages
forceGetWithoutList boolean false Whether to force get() by default to request elements one by one instead of using a list when MULTIPLE_REFERENCES conformance is enabled
forceSetWithoutList boolean false Whether to force set() by default to request elements one by one instead of using a list when MULTIPLE_REFERENCES conformance is enabled
conformance string[] ("MULTIPLE_REFERENCES", "GENERAL_PROTECTION") [] Communication conformance values. For example, ‘MULTIPLE_REFERENCES’ specifies it is possible to send to device multiple obis in unique request
Warning

In case of security parameter is not NONE, next default values will be set:

  • blockCipherKey: 000102030405060708090A0B0C0D0E0F
  • authenticationKey: D0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF

Add attributes

addAttr() is used both for get() and set() methods and has multiple signatures:

dlms.addAttr(classId, obisCode, attrId)

Applicable for normal gets.

Param Type Description
classId Array The class ID of the object to access
obisCode string The name of the object to access
attrId number The attribute index of the object
// After connection has been established
dlms.addAttr(1, "1.2.3.4.5.6", 2)
var getResult = dlms.get() // More details on get() next

dlms.addAttr(classId, obisCode, attrId, type, value)

Applicable for normal sets.

Param Type Description
classId Array The class ID of the object to access
obisCode string The name of the object to access
attrId number The attribute index of the object
type string The data type of the value to set
value see data types The data value to set
// After connection has been established
dlms.addAttr(1, "1.2.3.4.5.6", 2, "unsigned", 254)
var setResult = dlms.set() // More details on set next

dlms.addAttr(classId, obisCode, attrId, data)

Applicable for normal sets.

Param Type Description
classId Array The class ID of the object to access
obisCode string The name of the object to access
attrId number The attribute index of the object
data object (with type and value) The data with both type and value to set

where:

data attribute Type Description
type string The data type of the value to set
value see data types The data value to set

This is an alternate way of using addAttr(classId, obisCode, attrId, type, value) with the data parameters in an object.

// After connection has been established
//dlms.addAttr(1, "1.2.3.4.5.6", 2, "unsigned", 254)
dlms.addAttr(1, "1.2.3.4.5.6", 2, {"type": "unsigned", "value": 254}) // This is similar to the previous addAttr (commented)
var setResult = dlms.set() // More details on set next

It’s helpful when used in combination with get().

// After connection has been established
dlms.addAttr(1, "1.2.3.4.5.6", 2)
var getResult = dlms.get() // More details on get next
dlms.addAttr(1, "1.2.3.4.5.255", 2, getResult[0]) // Set on object 1.2.3.4.5.255 the value (and data type) retrieved from object 1.2.3.4.5.6
var setResult = dlms.set() // More details on set next

dlms.addAttr(classId, obisCode, attrId, selectiveAccess)

Applicable for gets with selective access.

Param Type Description
classId Array The class ID of the object to access
obisCode string The name of the object to access
attrId number The attribute index of the object
selectiveAccess object (with accessSelector and accessParameters) The selective access descriptor

where:

selectiveAccess attribute Type Description
accessSelector number The access selector
accessParameters object with type and value The access parameters

and

accessParameters attribute Type Description
type string The data type of access parameters
value see data types The data value of the access parameters
dlms.addAttr(1, "1.2.3.4.5.6", 2, {"accessSelector": 1, "accessParameters": {"type": "unsigned", "value": 254}})
Info

The proper access selector and parameters depend on the manufacturer and object type. Some may implement by range and by entry defined in the DLMS Blue Book - Parameters for selective access to the buffer attribute (section 4.3.6 in Blue Book 12).

// Example by range
dlms.addAttr(7, '7.0.99.99.3.255', 2, {
	accessSelector: 1,
	accessParameters: {
		type: 'structure',
		value: [{
			type: 'structure',
			value: [{
				type: 'long-unsigned',
				value: 1
			}, {
				type: 'octet-string',
				value: [0, 0, 1, 1, 0, 255]
			}, {
				type: 'integer',
				value: 2
			}, {
				type: 'long-unsigned',
				value: 0
			}]
		}, {
			type: 'double-long-unsigned',
			value: 1735884000
		}, {
			type: 'double-long-unsigned',
			value: 1736229600
		}, {
			type: 'array',
			value: []
		}]
	}
})

dlms.addAttr(attribute)

Generic signature applicable for all cases.

Attribute Type Mandatory Description
classId Array The class ID of the object to access
obisCode string The name of the object to access
attrId number The attribute index of the object
type string only on set() The data type of the value to set
value see data types only on set() The data value to set
accessSelector number only on get() with selective access The access selector
accessParameters object with type and value only on get() with selective access The access parameters

where:

accessParameters attribute Type Description
type string The data type of access parameters
value see data types The data value of the access parameters
// For normal get
dlms.addAttr({classId: 1, obisCode: "1.2.3.4.5.6", attrId: 2})
// For normal set
dlms.addAttr({classId: 1, obisCode: "1.2.3.4.5.6", attrId: 2, type: "unsigned", value: 254})
// For get with selective access
dlms.addAttr({classId: 1, obisCode: "1.2.3.4.5.6", attrId: 2, accessSelector: 1, accessParameters: {type: "unsigned", value: 254}})
data types
Name Value type Compatible type in set Description Example
null-data null null
array Array of object Complex data, all elements must be of the same type [{"type":"unsigned","value":1},{"type":"unsigned","value":2}]
structure Array of object Complex data, different elements possible [{"type":"unsigned","value":1},{"type":"visible-string","value":"two"}]
boolean boolean true
bit-string Array of boolean string An ordered sequence of boolean values. In set() an string may be used instead of array of boolean as bit-string representation [true,false,true] ("101" as string representation in set())
double-long number Integer32 (-21474836482147483647) 0
double-long-unsigned number Unsigned32 (04294967295 0
octet-string Array of number string An ordered sequence of octets (8 bit bytes). May contain a dateTime value, see getDateTime() and getDate() [116,101,115,116] (or "test" in set())
visible-string string An ordered sequence of ASCII characters "test"
utf8-string string An ordered sequence of characters encoded as UTF-8 "test"
bcd number Binary Coded Decimal (099) 0
integer number Integer8 (-128127) 0
long number Integer16 (-3276832767) 0
unsigned number Unsigned8 (0255) 0
long-unsigned number Unsigned16 (065535) 0
compact-array Array of object Provides an alternative, compact encoding of complex data, all elements must be of the same type [{"type":"unsigned","value":1},{"type":"unsigned","value":2}]
long64 number Integer64 (-90071992547409919007199254740991) 1 0
long64-unsigned number Unsigned64 (09007199254740991) 1 0
enum number The elements of the enumeration type are defined in the Attribute description or Method description section of a COSEM IC specification (0255) 0
float32 number Floating point number in 4 bytes 0
float64 number Floating point number in 8 bytes 0
date-time object Object containing all fields in a dateTime object {"year":2023,"month":11,"dayOfMonth":28,"dayOfWeek":2,"hour":10,"minute":26,"second":55,"hundredthsOfSecond":0,"deviation":-60,"status":0}
date object Object containing year, month, dayOfMonth and dayOfWeek fields in a dateTime object {"year":2023,"month":11,"dayOfMonth":28,"dayOfWeek":2}
time object Object containing hour, minute, second and hundredthsOfSecond fields in a dateTime object {"hour":16,"minute":1,"second":2,"hundredthsOfSecond":20}
Warning

JavaScript does not support the whole range of DLMS numbers, see footnotes.

dateTime objects

A dateTime object is used to specify all possible values for date-time, date and time DLMS types. It may define the following attributes:

Name Normal values Additional values
year 0..65534 65535 means unspecified
month 1..12 (jan-dec) 253 = daylight savings end, 254 daylight savings begin, 255 not specified
dayOfMonth 1..31 224..252 reserved, 253 2nd last day of month, 254 last day of month, 255 not specified
dayOfWeek 1..7 (mon-sun) 255 not specified
hour 0..23 255 not specified
minute 0..59 255 not specified
second 0..59 255 not specified
hundredthsOfSecond 0..99 255 not specified
deviation -720..720 (in minutes of local time to UTC) 32768 not specified
status 8 bit flags 255 not specified
Info

For more information see DLMS Blue Book - Date and time formats (section 4.1.6.1 in Blue Book 12)

To transform this object to a Date see getDate(). Keep in mind that sets of date-time, date, time and octet-string do not accept a Date object. To transform it to a dateTime object use getDateTime().

dlms.get(descriptive, forceWithoutList)

Executes a multi DLMS get attribute request with the previously specified payload (addAttr(classId, obisCode, attrId)).

Kind: global function
Returns: Array - Array of JSONs with responses. Each JSON will have six fields: result of the get operation, the requested classId, obisCode and attrId, type with the data type of the received value and the value received from the device. An optional error field may be returned for any error that happened during the get.

Param Type Mandatory Default Description
descriptive boolean true Descriptive mode returns complex data as Array of object containing type and value for each object, non descriptive mode flattens the returned array
forceWithoutList boolean false Whether to force the get to request elements one by one instead of using a list when MULTIPLE_REFERENCES conformance is enabled (if it’s not set the global forceGetWithoutList will be used)

Example for descriptive get:

// After connection has been established
dlms.addAttr(1, "0.0.0.0.0.0", 2) // Example for null-data
dlms.addAttr(1, "0.0.0.0.0.1", 2) // Example for array
dlms.addAttr(1, "0.0.0.0.0.2", 2) // Example for structure
dlms.addAttr(1, "0.0.0.0.0.3", 2) // Example for boolean
dlms.addAttr(1, "0.0.0.0.0.4", 2) // Example for bit-string
dlms.addAttr(1, "0.0.0.0.0.5", 2) // Example for double-long
// Rest on number examples are omitted because they are similar to double-long
dlms.addAttr(1, "0.0.0.0.0.6", 2) // Example for octet-string
dlms.addAttr(1, "0.0.0.0.0.7", 2) // Example for visible-string
// utf8-string example is omitted because it's similar to visible-string

var result = dlms.get() // Descriptive (true can also be passed)
log(result[0]) // Expected output: {"result":"success","classId":1,"obisCode":"0.0.0.0.0.0","attrId":2,"type":"null-data","value":null}]
log(result[1]) // Expected output: {"result":"success","classId":1,"obisCode":"0.0.0.0.0.1","attrId":2,"type":"array","value":[{"type":"long-unsigned","value":1},{"type":"long-unsigned","value":2},{"type":"long-unsigned","value":3}]}
log(result[2]) // Expected output: {"result":"success","classId":1,"obisCode":"0.0.0.0.0.2","attrId":2,"type":"structure","value":[{"type":"unsigned","value":1},{"type":"long-unsigned","value":2},{"type":"array","value":[{"type":"visible-string","value":"one"},{"type":"visible-string","value":"two"}]}]}
log(result[3]) // Expected output: {"result":"success","classId":1,"obisCode":"0.0.0.0.0.3","attrId":2,"type":"boolean","value":true}
log(result[4]) // Expected output: {"result":"success","classId":1,"obisCode":"0.0.0.0.0.4","attrId":2,"type":"bit-string","value":[true,false,true]}
log(result[5]) // Expected output: {"result":"success","classId":1,"obisCode":"0.0.0.0.0.5","attrId":2,"type":"double-long","value":1}
log(result[6]) // Expected output: {"result":"success","classId":1,"obisCode":"0.0.0.0.0.6","attrId":2,"type":"octet-string","value":[116,101,115,116]}
log(result[7]) // Expected output: {"result":"success","classId":1,"obisCode":"0.0.0.0.0.7","attrId":2,"type":"visible-string","value":"test"}

Example for non descriptive get

// After connection has been established
// Simple value types are returned exactly the same as descriptive mode, null-data is included to viasually see this
dlms.addAttr(1, "0.0.0.0.0.0", 2) // Example for null-data
// Simple value types are returned exactly the same as descriptive mode, null-data is included to viasually see this
dlms.addAttr(1, "0.0.0.0.0.1", 2) // Example for array
dlms.addAttr(1, "0.0.0.0.0.2", 2) // Example for structure

var result = dlms.get(false) // Non descriptive
log(result[0]) // Expected output: {"result":"success","classId":1,"obisCode":"0.0.0.0.0.0","attrId":2,"type":"null-data","value":null}]
log(result[1]) // Expected output: {"result":"success","classId":1,"obisCode":"0.0.0.0.0.1","attrId":2,"type":"array","value":[1,2,3]}
log(result[2]) // Expected output: {"result":"success","classId":1,"obisCode":"0.0.0.0.0.2","attrId":2,"type":"structure","value":[1,2,["one","two"]]}
Non descriptive get

Complex values returned in a non-descriptive get cannot be passed as value in a set.

get results
  • success
  • hardware-fault
  • temporary-failure
  • read-write-denied
  • object-undefined
  • object-class-inconsistent
  • object-unavailable
  • type-unmatched
  • scope-of-access-violated
  • data-block-unavailable
  • long-get-aborted
  • no-long-get-in-progress
  • long-set-aborted
  • no-long-set-in-progress
  • data-block-number-invalid
  • other-reason

dlms.set(descriptive)

Executes a multi DLMS set attribute request with the previously specified payload (addAttr(classId, obisCode, attrId, type, value)).

Kind: global function
Returns: Array - Array of JSONs with responses. Each JSON will have six fields: result of the set operation, the requested classId, obisCode and attrId, type with the data type of the received value and the value received from the device. An optional error field may be returned for any error that happened during the set.

Param Type Mandatory Default Description
descriptive boolean true Does not matter on set(). It’s included to have the same signature as get() and in case a device returns something in a set.
forceWithoutList boolean false Whether to force the set to request elements one by one instead of using a list when MULTIPLE_REFERENCES conformance is enabled (if it’s not set the global forceSetWithoutList will be used)
Info

Normally, a set request should always return a null-data as type and null as value.

Warning

A set request for complex data must always specify the value in a descriptive manner (as Array of Object containing both type and value for each and all elements and sub-elements in case of more nested complex elements).

// After connection has been established
dlms.addAttr(1, "0.0.0.0.0.0", 2, "null-data", null) // Example for null-data
dlms.addAttr(1, "0.0.0.0.0.1", 2, "array", [{"type":"long-unsigned","value":1},{"type":"long-unsigned","value":2},{"type":"long-unsigned","value":3}]) // Example for array
dlms.addAttr(1, "0.0.0.0.0.2", 2, "structure", [{"type":"unsigned","value":1},{"type":"long-unsigned","value":2},{"type":"array","value":[{"type":"visible-string","value":"one"},{"type":"visible-string","value":"two"}]}]) // Example for structure
dlms.addAttr(1, "0.0.0.0.0.3", 2, "boolean", false) // Example for boolean
dlms.addAttr(1, "0.0.0.0.0.4", 2, "bit-string", [true, false, true, false]) // Example for bit-string as boolean array (default type)
dlms.addAttr(1, "0.0.0.0.0.4", 2, "bit-string", "1010") // Example for bit-string as string with the bit-string representation (alternative set value type, a get will always return it as boolean array)
dlms.addAttr(1, "0.0.0.0.0.5", 2, "double-long", 1) // Example for double-long
// Rest on number examples are omitted because they are similar to double-long
dlms.addAttr(1, "0.0.0.0.0.6", 2, "octet-string", [116, 101, 115, 116]) // Example for octet-string as byte array (default type)
dlms.addAttr(1, "0.0.0.0.0.6", 2, "octet-string", "test") // Example for octet-string as string (alternative set value type, a get will always return it as byte array)
dlms.addAttr(1, "0.0.0.0.0.7", 2, "visible-string", "test") // Example for visible-string
// utf8-string example is omitted because it's similar to visible-string

var result = dlms.set() // Descriptive mode does not really matter, because return should always be null-data.
log(result[0]) // Expected output: {"result":"success","classId":1,"obisCode":"0.0.0.0.0.0","attrId":2,"type":"null-data","value":null}]
// All remaining results are similar, including returning null-data.
set results

They are the same as get results.

dlms.addMethod(classId, obisCode, methodId, type, value)

addMethod() is used for method() function.

Param Type Mandatory Description
classId Array The class ID of the object to access
obisCode string The name of the object to access
methodId string The method index in the object
type string when needed The data type of the value to pass to the method
value string when needed The data value to pass to the method

dlms.method(descriptive)

Executes a multi DLMS method (or action) request with the previously specified payload (addMethod(classId, obisCode, methodId, type, value)).

Kind: global function
Returns: Array - Array of JSONs with responses. Each JSON will have six fields: result of the method operation, the requested classId, obisCode and methodId, type with the data type of the received value and the value received from the device. An optional error field may be returned for any error that happened during the method (for example an error decoding the optional return parameters).

Param Type Mandatory Default Description
descriptive boolean true Descriptive mode returns complex data as Array of object containing type and value for each object, non descriptive mode flattens the returned array
Info

A method request may need and/or return whatever type and value it’s needed. Check Method description section of a COSEM IC specification.

// After connection has been established
dlms.addMethod(7, "1.0.99.1.0.255", 2) // Example for method needing null-data as parameter (default type and value)
dlms.addMethod(7, "1.0.99.1.0.254", 2, "unsigned", 0) // Example for method needing 0 (unsigned) as parameter

var result = dlms.method()
log(result[0]) // Expected output: {"result":"success","classId":1,"obisCode":"1.0.99.1.0.255","methodId":2,"type":"null-data","value":null}]
log(result[1]) // Expected output: {"result":"success","classId":1,"obisCode":"1.0.99.1.0.254","methodId":2,"type":"boolean","value":true}
action results
  • success
  • hardware-fault
  • temporary-failure
  • read-write-denied
  • object-undefined
  • object-class-inconsistent
  • object-unavailable
  • type-unmatched
  • scope-of-access-violated
  • data-block-unavailable
  • long-action-aborted
  • no-long-action-in-progress
  • other-reason

dlms.initializeNextFrameCounter(currentFrameCounter)

Sets the invocation counter of the ciphering to the next value of the received frame counter. This is used for devices that maintain two separate frame counters (one for transmit and one for receive). Usually the current Management Frame Counter - On-line is received in a CompactFrame notification and that value is the one that needs to be passed to this function for that device.

Kind: global function

Param Type Mandatory Description
currentFrameCounter number The current frame counter sent by the device.

dlms.getInvocationCounter()

Returns the current invocation counter of the ciphering.

Kind: global function Returns: number (integer).

dlms.disconnect()

Close the DLMS connection.

Kind: global function

dlms.getCompactData(typeDescription, value, descriptive, italianMode)

Extract the compact data serialized in a byte array according to the description given.

Kind: global function
Returns: Object - Object containing result and/or error. On success, result contains the parsed compact data (either in descriptive (with type in each value) or non-descriptive (direct values) format depending on the descriptive parameter). On error, the error will contain the error description and result may be null or contain a best-effort decoding of the compact data that may be incorrect.

Param Type Mandatory Default Description
typeDescription Object Object with the description of the data. The attributes of the object will be different according to the data expected’
value Array of number (or Object containing an octet-string type with its value) Array of bytes with the compact data (for example the DLMS notification data or element received)
descriptive boolean true Descriptive mode returns complex data as Array of object containing type and value for each object, non descriptive mode flattens the returned array
italianMode boolean false Determines if the compact data decoding of arrays must be in italian mode or not (explicitArrayLengthInContent)

Here is a description example:

var typeDescription = {"type": "structure", "items": [
		{"type": "long-unsigned"},
		{"type": "unsigned"},
		{"type": "array", "length": 1, "subtype": {"type": "long-unsigned"}},
		{"type": "array", "length": 1, "subtype": {"type": "double-long-unsigned"}},
		{"type": "structure", "items": [
			{"type": "unsigned"}, {"type": "long-unsigned"}
		]},
		{"type": "octet-string"}
	]
}
Info
  • Simple data types just need to define the type as seen in data types.
  • array type description must define a subtype, which is a typeDescription, and a length when not using italianMode. italianMode (or explicitArrayLengthInContent) does not need the length because it’s encoded in the received data.
  • structure type description must define an array of items, which are each a typeDescription.
  • compact-array is not supported inside a compact data.

Here is an example of the function result in descriptive and non descriptive modes:

var {result: data, error} = dlms.getCompactData(typeDescription, payload);
if (error) {
    log("Error: " + error);
} else {
    log(data) // Expected output: {"type":"structure","value":[{"type":"long-unsigned","value":1},{"type":"unsigned","value":2},{"type":"array","value":[{"type":"long-unsigned","value":3}]},{"type":"array","value":[{"type":"double-long-unsigned","value":4}]},{"type":"structure","value":[{"type":"unsigned","value":5},{"type":"long-unsigned","value":6}]},{"type":"octet-string","value":[83,112,97,114,101,32,79,98,106,101,99,116]}]}
}

var {result: data, error} = dlms.getCompactData(typeDescription, payload, false);
if (error) {
    log("Error: " + error);
} else {
    log(data) // Expected output: [1,2,[3],[4],[5,6],[83, 112, 97, 114, 101, 32, 79, 98, 106, 101, 99, 116]]
}

dlms.getDate(value) ⇒ Date

Extract the Date of a dateTime object or an octet-string. Some dateTime objects or octet-string may not contain a complete date and this method will return a date that may not be as accurate as you expect. You should check the dateTime object for unspecified value.

Kind: global function Returns: Date

Param Type Mandatory Default Description
value dateTime object or Array of number (or Object having type date-time, date, time or octet-string with its value) The best-effort Date possible
// compact-data containing all 

var dateTime = data[0]
log(dateTime) // Expected output: {"type":"date-time","value":{"year":2023,"month":11,"dayOfMonth":28,"dayOfWeek":2,"hour":10,"minute":26,"second":55,"hundredthsOfSecond":0,"deviation":-60,"status":0}}
log(dlms.getDate(dateTime).toISOString()) // Expected output: 2023-11-28T11:26:55.000Z
log(dlms.getDate(dateTime.value).toISOString()) // Expected output: 2023-11-28T11:26:55.000Z

var date = data[1]
log(date) // Expected output: {"type":"date","value":{"year":2023,"month":11,"dayOfMonth":28,"dayOfWeek":2}}
log(dlms.getDate(date).toISOString()) // Expected output: 2023-11-28T00:00:00.000Z
log(dlms.getDate(date.value).toISOString()) // Expected output: 2023-11-28T00:00:00.000Z

var time = data[2]
log(time) // Expected output: {"type":"date","value":{"hour":16,"minute":1,"second":2,"hundredthsOfSecond":20}}
log(dlms.getDate(time).toISOString()) // Expected output: 0000-01-01T16:01:02.200Z
log(dlms.getDate(time.value).toISOString()) // Expected output: 0000-01-01T16:01:02.200Z

var octet = data[3]
log(octet) // Expected output: {"type":"octet-string","value":[7, 231, 11, 28, 2, 10, 26, 55, 0, -1, -60, 0]}
log(dlms.getDate(octet).toISOString()) // Expected output: 2023-11-28T11:26:55.000Z
log(dlms.getDate(octet.value).toISOString()) // Expected output: 2023-11-28T11:26:55.000Z

var undefinedDateTimeInOctet = data[4]
log(undefinedDateTimeInOctet) // Expected output: {"type":"octet-string","value":[-1, -1, -1, -1, -1, -1, -1, -1, -1, -128, 0, -1]}
log(dlms.getDate(undefinedDateTimeInOctet).toISOString()) // Expected output: 0000-01-01T00:00:00.000Z
log(dlms.getDate(undefinedDateTimeInOctet.value).toISOString()) // Expected output: 0000-01-01T00:00:00.000Z

log(dlms.getDate(dlms.unspecifiedDateTime()).toISOString()) // Expected output: 0000-01-01T00:00:00.000Z

dlms.getDateTime(value)

Extract the dateTime object of a Date or an octet-string. The resulting dateTime objects generated from a Date will use UTC time specifying a deviation of 0. If you need something else construct the dateTime object manually.

Kind: global function Returns: Object

Param Type Mandatory Default Description
value Date or Array of number (or Object having type of octet-string with its value) Value containing a dateTime compatible value
log(dlms.getDateTime(new Date('2023-11-28T10:24:00.000Z'))) // Expected output: {"year":2023,"month":11,"dayOfMonth":28,"dayOfWeek":2,"hour":10,"minute":24,"second":0,"hundredthsOfSecond":0,"deviation":0,"status":0}
log(dlms.getDateTime(new Date('2023-11-28T10:24:00.299Z'))) // Expected output: {"year":2023,"month":11,"dayOfMonth":28,"dayOfWeek":2,"hour":10,"minute":24,"second":0,"hundredthsOfSecond":29,"deviation":0,"status":0}
log(dlms.getDateTime(new Date('Tue Nov 28 2023 11:24:00 GMT+0100'))) // Expected output: {"year":2023,"month":11,"dayOfMonth":28,"dayOfWeek":2,"hour":10,"minute":24,"second":0,"hundredthsOfSecond":0,"deviation":0,"status":0}

// compact-data containing all values

var octet = data[0]
log(octet) // Expected output: {"type":"octet-string","value":[7, 231, 11, 28, 2, 10, 26, 55, 0, -1, -60, 0]}
log(dlms.getDateTime(octet)) // Expected output: {"year":2023,"month":11,"dayOfMonth":28,"dayOfWeek":2,"hour":10,"minute":26,"second":55,"hundredthsOfSecond":0,"deviation":-60,"status":0}
log(dlms.getDateTime(octet)) // Expected output: {"year":2023,"month":11,"dayOfMonth":28,"dayOfWeek":2,"hour":10,"minute":26,"second":55,"hundredthsOfSecond":0,"deviation":-60,"status":0}

var undefinedDateTimeInOctet = data[1]
log(undefinedDateTimeInOctet) // Expected output: {'type': 'octet-string', 'value': [-1, -1, -1, -1, -1, -1, -1, -1, -1, -128, 0, -1]}
log(dlms.getDateTime(undefinedDateTimeInOctet)) // Expected output: {"year":65535,"month":255,"dayOfMonth":255,"dayOfWeek":255,"hour":255,"minute":255,"second":255,"hundredthsOfSecond":255,"deviation":32768,"status":255}
log(dlms.getDateTime(undefinedDateTimeInOctet.value)) // Expected output: {"year":65535,"month":255,"dayOfMonth":255,"dayOfWeek":255,"hour":255,"minute":255,"second":255,"hundredthsOfSecond":255,"deviation":32768,"status":255}

dlms.undefinedDateTime()

Get dateTime object with all its fields set to not specified.

You can also use unspecifiedDateTime().

Kind: global function Returns: Object

dlms.addAttr(1, '0.0.0.0.0.0', 2, 'octet-string', dlms.undefinedDateTime())
log(dlms.getDate(dlms.undefinedDateTime()).toISOString()) // Expected output: 0000-01-01T00:00:00.000Z

dlms.unspecifiedDateTime()

Get dateTime object with all its fields set to not specified.

You can also use undefinedDateTime().

Kind: global function Returns: Object

dlms.addAttr(1, '0.0.0.0.0.0', 2, 'octet-string', dlms.unspecifiedDateTime())
log(dlms.getDate(dlms.unspecifiedDateTime()).toISOString()) // Expected output: 0000-01-01T00:00:00.000Z

DLMS Gas JavaScript API

Connector functions DLMS Gas JS API guide

The dlms_gas API provides a unified framework for managing Smart Gas meters from various manufacturers.

Manufacturer-based behavior

This API is designed to abstract behavior based on different manufacturers. Currently, the following behaviors have been specified:

  • pietro
  • watertech
  • honeywell
  • spark

There is a common or default behavior that serves as a basis for all manufacturers and that they overwrite when they need to. In addition, the API is designed to be extended and customized with new behaviors in the development of new CFs.

Connector Functions Implementation

Some use cases for how to implement a CF are explained below.

Standard connector function implementation with already defined behaviors

dlms_gas.init();
dlms_gas.decode();
dlms_gas.pendingActions();
dlms_gas.collect();

In this case, the call to dlms_gas.init() will initialize the initial parameters based on the device information and the configuration specified in the organization’s default entity. For more details on the behavior of dlms_gas.init(), see the dlms_gas.config properties and dlms_gas.init() function.

Next, when executing dlms_gas.decode(), the received Compact Frame will be decoded based on the standard specification of the already known compact frames (47, 48, 49, 51, 97). For more details on the behavior of dlms_gas.decode(), see the dlms_gas.decode section.

The next step is to execute the actions corresponding to the session (OpenGate operations, information requests, time change…). For more details on the actions performed, see the dlms_gas.pendingActions section.

Finally, dlms_gas.collect() is invoked, which is responsible for collecting data from the three entities involved in gas device communications: meter, network cell, and organizational unit. For more details on the behavior of dlms_gas.collect(), see the dlms_gas.collect section.

Configuration initialization

The following examples show some cases of how to vary the initial configuration.

The first case shows how to initialize the session using a configuration entity different from the organization’s. In this case, it starts from the idea that the entity representing the organization contains a suffix.

const orgName = entity._value('provision.administration.organization') + '_dev';
dlms_gas.init(orgName);

Another option is to modify the configuration once initialized. In this example, we see how the maxClockSkewAllowedSec and italianMode parameters are overwritten. The dlms_gas.config parameters are explained in the dlms_gas.config section.

dlms_gas.init();
dlms_gas.config.maxClockSkewAllowedSec = 10;
dlms_gas.config.italianMode = false;

Finally, it may be necessary to overwrite the API key. This case is not recommended, but if necessary, it is done as follows:

dlms_gas.config.__initApiKey('different-api-key');

Configuration of actions to be performed in the session

Without changing the order of the actions to be performed, it is possible to force or avoid certain actions being performed.

The following example shows how to avoid attempting to change the meter’s time.

dlms_gas.actions.setClock = false;
dlms_gas.pendingActions();

It is also possible to force some of the actions to be performed even if the conditions for their normal behavior are not met. For example, the request for certain information is only made when a device connects for the first time to the platform in order to collect some of its initial configuration. However, it is possible to force this request every time it connects:

dlms_gas.actions.forceInitialData = true;
dlms_gas.pendingActions();

For all options, see the dlms_gas.actions section. Although initially with this configuration the order of the actions cannot be changed (see the dlms_gas.pendingActions section), it is possible to overwrite the order or even change the actions to be performed with more advanced programming that we will see later.

Customization of compact frames decoding

Currently, the following Compact Frames are considered: 47, 48, 49, 51, and 97.

Tip

CF 22 is also considered, but only as part of the FOTA process and it is not expected to be used as push notification compact frame.

The specification for decoding a CF is based on objects with the following specification:

{
  "template":{},
  "initAndCollect": function(data){}
}

The template property is a JSON following what is specified in the DLMS API documentation for the dlms.getCompactData function and the typeDescription parameter. The dlms_gas.decode function calls the getCompactData function with the specified template.

The initAndCollect method is responsible for loading the decoded values of the compact frame into the devCollection object. It is not mandatory to implement this method if it is not necessary to collect the decoded CF. This method can also be used to initialize other variables of interest for the session. For example, it is common to initialize the variables dlms_gas.recUnixTime, dlms_gas.recMetEventsCounter, and dlms_gas.recNonMetEventsCounter.

The dlms_gas.decode function internally uses the corresponding template specification object (see default properties) to decode the received template, but it is possible to pass a specific object as a parameter in which to specify a different specification.

In this example, we will see what the (made-up) decoding of a compact frame identified with number 32 could look like:

const customTemplate = {
  "template": {
        'attrId': 2, 'template': 32, 'type': 'structure',
        'items': [
          { 'type': 'unsigned' },
          { 'type': 'double-long-unsigned' },
          { 'type': 'long-unsigned' },
          { 'type': 'long-unsigned' },
        ]
      },
  "initAndCollect": function (data) { 
      logger.trace(`Collecting data from cf 32`);
      dlms_gas.recUnixTime = data[1];
      dlms_gas.recMetEventsCounter = data[2];
      dlms_gas.recNonMetEventsCounter = data[3];
      dlms_gas.devCollection.addDatapoint('mType', data[0], dlms_gas.recUnixTime);
      dlms_gas.devCollection.addDatapoint('metCount', dlms_gas.recMetEventsCounter, dlms_gas.recUnixTime);
      dlms_gas.devCollection.addDatapoint('nonMetCount', dlms_gas.recNonMetEventsCounter, dlms_gas.recUnixTime);
      dlms_gas.devCollection.addDatapoint('contSinLect', false, dlms_gas.now);
  }
};
const decodeResult = dlms_gas.decode(customTemplate);

Another possibility is simply to change the decoding behavior of an already specified compact frame (47, 48, 49, 51, 97). In this case, there are several options to carry this out.

The first one is to create a completely new specification using the original template and defining the initAndCollect function:

const custom48 = {
  "template": dlms_gas.default["48"].template,
  "initAndCollect": function (data) { 
      logger.trace(`Collecting data from cf 48 with custom behavior`);
      dlms_gas.devCollection.addDatapoint(...);
      dlms_gas.devCollection.addDatapoint(...);
      dlms_gas.devCollection.addDatapoint(...);
      dlms_gas.devCollection.addDatapoint(...);
      dlms_gas.devCollection.addDatapoint(...);
      ...
  }
};
const decodeResult = dlms_gas.decode(custom48);

Following this line, it is also possible to implement the initAndCollect method using the default behavior but extending or altering that behavior as much as possible. An example could be the following, where the default behavior is used but then additional actions are performed:

const custom48 = {
  "template": dlms_gas.default["48"].template,
  "initAndCollect": function (data) { 
      logger.trace(`Collecting data from cf 48 extending default behavior`);
      dlms_gas.default["48"].initAndCollect(data);
      // extra actions: for example, adjust received time.
      dlms_gas.recUnixTime = dlms_gas.recUnixTime - (60 * 60 * 1000);
  }
};
const decodeResult = dlms_gas.decode(custom48);

Fully customized behaviors

The dlms_gas API includes objects responsible for encapsulating the functions and properties of different behaviors:

  • dlms_gas.default: contains all the properties and functions used to perform all actions.
  • dlms_gas.pietro: overwrites the functions and properties necessary to support the behavior of Pietro-type meters.
  • dlms_gas.honeywell: overwrites the functions and properties necessary to support the behavior of Honeywell-type meters.
  • dlms_gas.watertech: overwrites the functions and properties necessary to support the behavior of Watertech-type meters.
  • dlms_gas.spark: overwrites the functions and properties necessary to support the behavior of Spark-type meters.

Each behavior is specified at initilization time according to device manufacturer. If the device manufacturer is unknown, the dlms_gas.default behavior will be used.

Info

Check dlms_gas.behavior object’s properties and functions to understand how internally works behaviors management.

A simple way to test different behaviors is to overwrite the dlms_gas.behavior property. In the following example, the behavior is forced to be honeywell regardless of the manufacturer:

dlms_gas.behavior = 'honeywell';
dlms_gas.init();
dlms_gas.decode();
dlms_gas.pendingActions();
dlms_gas.collect();

Once dlms_gas.behavior is specified as honeywell, the rest of the logic is executed with the Honeywell behavior.

Finally, it is possible to define or extend the complete behavior of the API. It may be that with the configurations or specifications seen so far, it is not possible to adapt to a particular case. In this case, it will be necessary to define a new behavior to be used in the rest of the connector function. This is done as follows:

const newBehavior = {/*actions and properties*/};
dlms_gas.customBehavior(newBehavior);
dlms_gas.init();
dlms_gas.decode();
dlms_gas.pendingActions();
dlms_gas.collection();

When calling dlms_gas.customBehavior(newBehavior), the dlms_gas.behavior variable is initialized with the value 'custom' and the dlms_gas.custom object is initialized with the specified parameter. From here on, all other actions will be done based on what is specified in newBehavior. See dlms_gas.customBehavior for more information.

It is possible to specify “base” behavior for a custom one using the baseBehavior property. In this case, it will try to look for defined functions and properties in newBehavior and if not found, it will try to find them in baseBehavior. Finally if it is not found in baseBehavior it will try to find it in dlms_gas.default.

In next example, when looking for a function or property, it will follow next order to find it: newBehavior -> honeywell -> default.

const newBehavior = {
  "baseBehavior": "honeywell",
  /*actions and properties*/
};
dlms_gas.customBehavior(newBehavior);
dlms_gas.init();
dlms_gas.decode();
dlms_gas.pendingActions();
dlms_gas.collect();

Reviewing the decoding examples from the previous section, they could be incorporated using the concept of customBehavior.

The following example shows how to define a new compact frame specification, while maintaining the possibility for the connector function to support other compact frames because the decode method is not forced to use the specification passed as a parameter.

const newBehavior = {
  "32": {
    "template": {
        'attrId': 2, 'template': 32, 'type': 'structure',
        'items': [
          { 'type': 'unsigned' },
          { 'type': 'double-long-unsigned' },
          { 'type': 'long-unsigned' },
          { 'type': 'long-unsigned' },
        ]
      },
    "initAndCollect": function (data) { 
        logger.trace(`Collecting data from cf 32`);
        dlms_gas.recUnixTime = data[1];
        dlms_gas.recMetEventsCounter = data[2];
        dlms_gas.recNonMetEventsCounter = data[3];
        dlms_gas.devCollection.addDatapoint('mType', data[0], dlms_gas.recUnixTime);
        dlms_gas.devCollection.addDatapoint('metCount', dlms_gas.recMetEventsCounter, dlms_gas.recUnixTime);
        dlms_gas.devCollection.addDatapoint('nonMetCount', dlms_gas.recNonMetEventsCounter, dlms_gas.recUnixTime);
        dlms_gas.devCollection.addDatapoint('contSinLect', false, dlms_gas.now);
    }
  }
};
dlms_gas.customBehavior(newBehavior);
dlms_gas.init();
dlms_gas.decode();
dlms_gas.pendingActions();
dlms_gas.collect();

If you want to modify the behavior of initAndCollect of some known compact frame (47, 48, 49, 51, and 97), it is even simpler, as they internally have an overridable collection method, so you only need to define that method in the custom behavior.

const newBehavior = {
  "initAndCollectCf48": function (data) { 
    //custom behavior
  }     
};
dlms_gas.customBehavior(newBehavior);
dlms_gas.init();
dlms_gas.decode();
dlms_gas.pendingActions();
dlms_gas.collect();

The initAndCollect function of the predefined compact frames 47, 48, 49, 51, and 97 internally calls the corresponding initAndCollectCfxx method. Therefore, you only need to overwrite that method to alter its behavior.

The same concept applies to the dlms_gas.pendingActions and dlms_gas.collect functions. Internally, they call methods defined in default. Therefore, they can be easily modified. For example, the order in which actions are performed could be modified or even new actions could be added as in the following example, where the default actions are invoked first and then a custom action is invoked.

const newBehavior = {
    "pendingActions": function () {
      dlms_gas.default.pendingActions();
      dlms_gas.custom.customPendingAction();
    },
    "customPendingAction": function() {
        // custom action
    }
};
dlms_gas.customBehavior(newBehavior);
dlms_gas.init();
dlms_gas.decode();
dlms_gas.pendingActions();
dlms_gas.collect();

The previous example shows several important concepts:

  • The pendingActions function is overwritten for the new behavior, so when the main dlms_gas.pendingActions() method is invoked, the new custom function will be executed.
  • A new function customPendingAction is defined and will be executed when dlms_gas.pendingActions() is invoked.
  • To call to the default pendingActions function, it is done through the default object (dlms_gas.default.pendingActions();) since we want to execute all the default pending actions.
  • To invoke the new customPendingAction function, we do it through custom (dlms_gas.custom.customPendingAction();), which is the object containing the new behavior.

To learn about the existing functions and properties defined for the behaviors, see the specifications for each of them in the following sections.


dlms_gas api specification

The dlms_gas object is the main entry point for Smart Gas operations.

It has several properties used to keep session status. See dlm_gas properties section and it also has some main basic functions. See dlm_gas functions section.

Finally it has complex properties to specifiy Connector Functions behavior:

dlms_gas properties

Following properties represent session state.

Property Type Default Description
now number null Current session timestamp in milliseconds. It is calculated in init method.
now_seconds number null Current session timestamp in seconds. It is calculated in init method.
behaviorName string "default" Active behavior name. It is calculated from device manufacturer in init method.
devCollection Object null Main device collection object. It is initialized automatically with normal collection object in init method.
cellCollection Object null Cellular network collection object. It is initialized automatically in init method.
uoCollection Object null Organization collection object. It is initialized automatically in init method.
recUnixTime number null Initiailized from received push notification.
EOGDTime number null End of Gas Day Time. Initiailized from received push notification.
recMetEventsCounter number null Metrological events counter. Initiailized from received push notification.
recNonMetEventsCounter number null Non-metrological events counter. Initiailized from received push notification.
messagesCounter number 0 Count of messages in current session.
numBlockErrorSession number 0 Used to manage fota blocks transfer.
numBlockTransfSession number 0 Used to manage fota blocks transfer.
restoreDefaultSchedule boolean false Used to manage restoring the default schedule.
onlineMngFrmCntr number null Online management frame counter. It is initialized from received push notification if available, otherwise is initialized from meter previously collected data.
messagesPerECL number null Count of messages per ECL. It is initialized in init method from used behavior

dlms_gas functions

dlms_gas.init(confEntityName)

Initializes the DLMS Gas API context. It loads provisioned and collected data from meter entity and provisioned configuration data from configuratiion entity if it is found. By default it uses the meter’s organization name to find created configuration entity, if it was created with different name it must be passed as argument.

See dlms_gas.config for more information about configuration data.

Property Type Default Description
confEntityName string null Optional organization name.

Examples:

dlms_gas.init();
dlms_gas.init(entity._value("provision.administration.organiaztion)+"_dev");

dlms_gas.decode(customTemplate, descriptive)

Decodes received payload after identifying the template and collects data. Internally it calls to behavior specific decode method. See DLMS Manufacturer Behavior section below for full specification of that method.

Parameter Type Default Description
customTemplate Object null Template to force.
descriptive boolean false Enable descriptive format.

Example:

var res = dlms_gas.decode();

dlms_gas.pendingActions()

Executes the full session flow. Internally it calls to behavior specific pendingActions method. See DLMS Manufacturer Behavior section below for full specification of that method.

By default it executes the following actions:

  1. sync clock: check and sync device clock
  2. retrieve initial data: used to retrieve data that is expected only once on device onboarding like firmware, apn configuration, etc. This data will be asked if it is not collected already.
  3. retrieve push events configurations: like initial data retrieving but for push events configurations, it will be asked if it is not collected already.
  4. periodic actions: used to retrieve data that must be retrieved periodically like statistics.
  5. automatic actions: used to retrieve data depending on previously collected data and received data in push notification.
  6. opengate operations: used to execute operations requested from opengate.

Previous actions execution can be controlled by dlms_gas.actions object properties. If the action is not enabled, it will not be executed. If it is forced it will ignore previous checks like statistics age or if initial data was already collected.

Examples:

//standard behavior
dlms_gas.pendingActions();
//skip statistics and force push events configuration retrieval
dlms_gas.actions.retrieveStatistics = false;
dlms_gas.actions.retrievePushEventsConfigurations = true;
dlms_gas.actions.forcePushConf = true;
dlms_gas.pendingActions();

dlms_gas.collect()

Used at the end of the script to send collected data for meter entity, cell enity and organization entity. Internally it calls to specific behavior collect method.

Example:

dlms_gas.collect();
Warning

It must used at the end of the Connector function to ensure that data collected during the execution is raised to opengate.

dlms_gas.customBehavior(behavior)

Changes the default behavior to a custom one. Internall it set dlms_gas.behaviorName property to "custom" and dlms_gas.custom property with the behavior provided as argument.

See DLMS Manufacturer Behavior section below for full specification of this method.

Property Type Default Description
behavior Object {} The behavior to use. If empty, is like using default behavior.

Example:

const customBehavior = {/*behavior specification*/};
dlms_gas.customBehavior(customBehavior);

dlms_gas._exec(callType, dType, uType)

It executes specified standard dlms call (get, set, method). It will use the dType and uType for msRaw collection. It will return an object with the result from dlms standard function or with the error message. This method is just utility and is not intended to be used directly. Instead it must be used dlms_gas.get, dlms_gas.set, dlms_gas.method or dlms_gas.getByRange.

Internally this method will do several actions:

  • Call collectMsRaw before and after the dlms standard function call.
  • Increase dlms_gas.messagesCounter property before the dlms call.
  • Increase and collect onlineMngFrmCntr if the dlms call was successful.
  • At the end, cleans dlms.attrList and dlms.methodList arrays.
Property Type Default Description
callType string Type of call to execute.
dType number mtype for messages sent to device.
uType number mtype for messages received from device.

Returned object will contain an object with the following properties:

  • error: Error message if some error occurs.
  • result: Return result from dlms standard function call. The result depends on the dlms method called (get, set, method).

dlms_gas.get(dType, uType)

It wrapes dlms.get calls adding extra behavior. dType and uType will be used for msRaw collection. The dlms.get response will be flattened in order to store the values in a single object. See examples below.

Property Type Default Description
dType number mtype for messages sent to device.
uType number mtype for messages received from device.

Returned object will contain.

object with the following properties:

  • error: Error message if some error occurs.
  • [classid_obis_attrid]: Values for the requested attributes, if attribute request was successful.

Example:

dlms.addAttr(1, '0.0.94.39.58.255', 2);
dlms.addAttr(45, '0.1.25.4.0.255', 2);
dlms.addAttr(3, '0.0.96.6.6.255', 2);
const res = dlms_gas.get(-8, 4);

Some return examples:

{
  "1_0.94.39.58.255_2": ...returned value from dlms.get... ,
  "45_0.1.25.4.0.255_2": ...returned value from dlms.get... ,
  "3_0.96.6.6.255_2": ...returned value from dlms.get...
}

If some attribute request fails, the error will be added to the error property.

{
  "error": "...errors specification separated by ';'",
  "1_0.0.94.39.58.255_2": ...returned value from dlms.get...
}

If the dlms.get request fails, the error property will be set and no attribute values will be returned.

{
  "error": "... error message ..."
}

dlms_gas.set(dType, uType)

It wrapes dlms.set calls adding extra behavior. dType and uType will be used for msRaw collection. The dlms.set response will be flattened in order to store the values in a single object. See examples below.

Property Type Default Description
dType number mtype for messages sent to device.
uType number mtype for messages received from device.

Returned object will contain an object with the following properties:

  • error: Error message if some error occurs.
  • [classid_obis_attrid]: Results for the modified attributes.

Example:

dlms.addAttr(22, '0.0.15.0.1.255', 2, 'structure', [{ 'type': 'octet-string', 'value': [0, 0, 10, 0, 106, -1] }, { 'type': 'long-unsigned', 'value': vst }]);
dlms.addAttr(22, '0.0.15.0.1.255', 4, 'array', [{ 'type': 'structure', 'value': [{ 'type': 'octet-string', 'value': timeOctet }, { 'type': 'octet-string', 'value': dateOctet }] }]);
const dlmsResp = dlms_gas.set(-13, 6);

Some return examples:

{
  "22_0.0.15.0.1.255_2": "success",
  "22_0.0.15.0.1.255_4": "success"
}

If some attribute modification returns an error, the error will be added to the error property and the response will be “success” for the rest of the attributes.

{
  "error": "...errors specification...",
  "22_0.0.15.0.1.255_2": "error message",
  "22_0.0.15.0.1.255_4": "success"
}

If the dlms.set request fails, the error property will be set and no attribute values will be returned.

{
  "error": "... error message ..."
}

dlms_gas.method(dType, uType)

It wrapes dlms.method calls adding extra behavior. dType and uType will be used for msRaw collection. The dlms.method response will be flattened in order to store the values in a single object. See examples below.

Property Type Default Description
dType number mtype for messages sent to device.
uType number mtype for messages received from device.

Returned object will contain.

object with the following properties:

  • error: Error message if some error occurs.
  • [classid_obis_attrid]: Results for the modified attributes, if attribute modification was successful.

Example:

dlms.addMethod(3, '7.0.96.5.1.255', 1, 'integer', 0);
const dlmsResp = dlms_gas.method(-18, 18);

Some return examples:

{
  "3_7.0.96.5.1.255_1": "success"
}

If some method execution returns an error, the error will be added to the error property and the response will be “success” for the rest of the attributes.

{
  "error": "...errors specification...",
  "3_7.0.96.5.1.255_1": "error message"
}

If the dlms.method request fails, the error property will be set and no attribute values will be returned.

{
  "error": "... error message ..."
}

dlms_gas.getByRange(classId, obis, attrId, accessSelector, paramClassID, paramObis, paramAttrId, rangeType, rangeFrom, rangeTo, maxRangePerPage, dType, uType)

It retrieves values by range using dlms.get with selective access. It retrieves all the values within the range, even if the device returns values in multiple pages. In case of any page retrieval fails, the error will be added to the error property and the response will be “success” for the rest of the pages.

Property Type Default Description
classId number Class ID of the object.
obis string OBIS code.
attrId number Attribute ID.
accessSelector number Access selector (e.g., 1 for range).
paramClassID number Selector’s parameter Class ID.
paramObis string Selector’s parameter OBIS code.
paramAttrId number Selector’s parameter Attribute ID.
rangeType string Data type for range values (e.g., ‘double-long-unsigned’).
rangeFrom number Start of range.
rangeTo number End of range.
maxRangePerPage number Maximum range size. For event buffer ranges, the number of elements per page. For temporal ranges max period for page.
dType number mtype for messages sent to device.
uType number mtype for messages received from device.

It returns an object with the following properties:

  • result: Array of all values retrieved.
  • error: Error message if any error occurs.

Example:

const res = dlms_gas.getByRange(7, '0.0.99.1.0.255', 2, 1, 8, '0.0.1.0.0.255', 2, 'double-long-unsigned', lastIndex, currentIndex, 10, -8, 4);
Tip

There some objects to make easier the call to this method. Check the [Range retrieval configuration object section][#range-retrieval-configuration-object]

dlms_gas.config Object Properties

Following properties are loaded from device entity and from “configuration entity” when executing dlms_gas.init method. Some of them contain connected meter status and data and other contain configuration values from configuration entity.

Property Type Default Description
orgName string null Name of the organization that the meter belongs to.
confEntityName string null Name of the entity that contins configuration parameters. See dlms_gas.init method to see how it is initialized
systemTitle string null Meter System title.
cellPrefix string null Prefix for the cell identification. It can be defined in the configuration entity.
apiKey string null API Key for the platform. It must be defined in the configuration entity.
periodicDataAgeMillis number null Maximum age of periodic data in milliseconds. It can be calculated from data in configuration entity.
maxSecondsWithoutCom number null Maximum seconds without communication. It can be calculated from data in configuration entity.
cellPlanName string null Name of the cell plan. It can be defined in the configuration entity.
maxClockSkewAllowedSec number null Maximum difference in time for clock sync in seconds. It can be defined in the configuration entity.
maxClockCorrection number null Maximum clock correction allowed. In this case it is filled for specified behavior
numBlockError number null It contains meter’s FOTA process blocks number with transfer error.
numBlockTransf number null It contains meter’s FOTA process successufully transferred blocks number.
badSessionsCounter number null It contains meter’s FOTA process failed sessions counter
maxSessionsErrorsRate number null It contains FOTA process maximum block errors rate allowed in a session. It can be defined in the configuration entity.
maxBadSessions number null It contains FOTA process maximum bad sessions before FOTA abort. It can be defined in the configuration entity
manufacturer string null Meter manufacturer.
italianMode boolean false Enable Italian specific mode. Calculated from manufacturer.
deviceId string null Meter identifier.
cellId string null Cell identifier. It is filled from device collected cell identifier.
fotaBlockSize number null FOTA block size for current meter. It is filled from collected data.
fotaEnabled boolean false Indicates if the meter has FOTA enabled. It is filled from collected data.
fotaNumberOfBlocks number null FOTA total number of blocks for current meter. It is calculated and collected at the begining of FOTA process
lastEventCounter number null Counter for the last event. It is filled from meter’s previously collected data.
lastCommunication number null Timestamp for the last communication. It is filled from meter’s previous last notification.

Next table indicates which datastreams are used to init these properties:

Property Entity Datastream Default value
orgName Meter provision.administration.organization null
manufacturer Meter provision.device.model null
deviceId Meter provision.device.serialNumber null
systemTitle Meter provision.administration.identifier null
lastEventCounter Meter metCount null
cellId Meter NBcellID null
fotaBlockSize Meter fotaBlockSize null
fotaNumberOfBlocks Meter firmwareTotalBlock null
fotaEnabled Meter fotaEnabled null
numBlockError Meter numBlockError 0
numBlockTransf Meter numBlockTransf 0
badSessionsCounter Meter badSessionsCounter 0
lastCommunication Meter mType null
cellPrefix Configuration provision.ACR orgName_
periodicDataAgeMillis Configuration provision.periodicDataAgeDays 1296000000 (15 days in milliseconds)
maxSecondsWithoutCom Configuration provision.maxDaysWithoutCom 259200 (3 days in seconds)
maxClockSkewAllowedSec Configuration provision.maxClockSkewAllowedSec 120
maxSessionsErrorsRate Configuration provision.maxSessionsErrorsRate 0.2
maxBadSessions Configuration provision.maxBadSessions 3
cellPlanName Configuration provision.cellPlanName null
apiKey Configuration provision.administration.apiKey null
Warning

Datastream used to initialize periodicDataAgeMillis and maxSecondsWithoutCom contains time in days and they are converted to milliseconds and seconds respectively.

It is possible to override this values after init calling to dlms_gas.init():

dlms_gas.init();
dlms_gas.config.maxClockSkewAllowedSec = 60;

dlms_gas.config Object Functions

config.__initApiKey(apiKey)

Internal utility used to initialize the API key.

Parameter Type Description
apiKey string The API key to be forced into the session context.

If it is necessary to specify manually the apikey from Connector Function it must be called after dlms_gas.init call. Example:

dlms_gas.init();
dlms_gas.config.__initApiKey('your-api-key');

dlms_gas.behavior Object properties

Property Type Default Description
chain Set<string> null It contains the behavior chain used to resolve function or property call. It is initilized in dlms_gas.init

dlms_gas.behavior Object Functions

behavior.getName(manufacturer)

Calculates and returns behavior name from manufacturer parameter (Not case session). This method is called from dlms_gas.init function only if dlms_gas.behaviorName is null.

Parameter Type Default Description
manufacturer string null Meter provisioned manufacturer name.

Next table explains current behaviors:

Behavior name Manufacturer
pietro If manufacturer contains ‘pietro’
honeywell If manufacturer contains ‘honeywell’
spark If manufacturer contains ‘spark’
watertech If manufacturer contains ‘watertech’
default If manufacturer is null or contains none of the above

behavior.calculateChain(behaviorName, visited)

Internall utility to calculate recursively the behavior chain. It is called from dlms_gas.init and it will return a Set with all behaviors to be checked when a function or property is called. It will take into account that specified behavior exists, if not it will return default behavior as last element of the chain. Something similiar will happen if there is a circular baseBehavior reference.

Parameter Type Default Description
behaviorName string null The name of the behavior to calculate the chain for. If null, it uses dlms_gas.behaviorName
visited Set<string> new Set() A set of behavior names that have already been visited. Used to detect circular references

For example, if custom behavior is defined with pietro as baseBehavior:

const chain = dlms_gas.behavior.calculateChain('custom');
//it will return following chain: ['custom', 'pietro', 'default']

In case that custom behavior has invalid baseBehavior (it doesn’t exist), it will return following chain:

//having custom behavior with invalid baseBehavior, for example 'nonExistentBehavior'
const chain = dlms_gas.behavior.calculateChain('custom');
//it will return following chain: ['custom', 'default']

behavior.property(propertyName)

Returns property value from behavior chain in order to call it. It will return the property value if exists in any behavior in the chain, if not it will return null.

Warning

This method should be used when specifying a custom behavior to ensure that the value returned is the best match for the current behavior chain.

Parameter Type Default Description
propertyName string null The name of the property to retrieve

behavior.function(functionName)

Returns function from behavior chain in order to call it. It will return the function if exists in any behavior in the chain, if not it will empty function.

Warning

This method should be used when specifying a custom behavior to ensure that the function returned is the best match for the current behavior chain.

Parameter Type Default Description
functionName string null The name of the function to retrieve

Example of function calling using behavior management:

    const address = dlms_gas.behavior.function("encodeIpPort")(pConf.platform.ip, pConf.platform.port);
Warning

When overriding one function in custom behavior take care to not call itselsf using this method because it will throw exception due to infinite recursion

Example of bad use of function method and how to override correctly the function:

const cb = {
  "retrieveStatistics": function(data){
    dlms_gas.behavior.function('retrieveStatistics')(); //Bad practice: Infinite recursion
    dlms_gas.default.retrieveStatistics(); //the correct way to do it
    dlms_gas.honeywell.retrieveStatistics(); //the correct way to do it
    //... extra code ...
  }
}

dlms_gas.actions Object Properties

Control flags to enable or disable specific automated tasks.

Property Type Default Description
setClock boolean true Enable automated clock synchronization.
retrieveInitialData `boolean" true Enable FW and static config retrieval.
retrievePushEventsConfigurations boolean `true" Enable PUSH event config retrieval.
periodicActions boolean `true" Enable statistics and diagnostic retrieval.
automaticActions boolean `true" Enable logs and profile retrieval.
operations boolean `true" Enable pending operation execution.
forceInitialData boolean false Force retrieval of initial data.
forcePushConf boolean false Force retrieval of push configuration.
forceStatistics boolean false Force retrieval of statistics.

dlms_gas.default object Properties

Following properties are defined in dlms_gas.default and used when no manufacturer specific property is defined.

Property Type Value Description
47 Object Specification for Compact Frame 47. Includes template and initAndCollect. See decoding section.
48 Object Specification for Compact Frame 48. Includes template and initAndCollect. See decoding section.
49 Object Specification for Compact Frame 49. Includes template and initAndCollect. See decoding section.
51 Object Specification for Compact Frame 51. Includes template and initAndCollect. See decoding section.
97 Object Specification for Compact Frame 97. Includes template and initAndCollect. See decoding section.
22 Object Specification for Compact Frame 22. Used in FOTA process.
cwport number 1 Used to define dlms.cwport when initializing client
swport number 1 Used to define dlms.swport when initializing client
hesSystemTitle string 5341435341435341 Used to define dlms.hesSystemTitle when initializing client
conformance string ['MULTIPLE_REFERENCES', 'GENERAL_PROTECTION', 'SELECTIVE_ACCESS'] Used to define dlms.conformance when initializing client
forceGetWithoutList boolean false Used to define dlms.forceGetWithoutList when initializing client
forceSetWithoutList boolean false Used to define dlms.forceSetWithoutList when initializing client
ignoreSystemTitleInCiphering boolean true Used to define dlms.ignoreSystemTitleInCiphering when initializing client
onlineFramCounterRetryInc number 5 Used to synchronize meters counter with collected frame counter.
onlineFramCounterRetryMax number 3 Used to synchronize meters counter with collected frame counter.
maxClockCorrection number 900 Default maximum clock correction allowed.
messagesPerECL object { "0": 20, "1": 20, "2": 0 } To limit fota blocks depending on ECL value.
isItalianModeManufacturer boolean true Indicates if manufacturer follows Italian mode by default.
eclAttribute number 3 Attribute ID for ECL retrieval.
errorIfWrongFotaBlockMapSize boolean true Specify if fota operation must finish immediately with error if block map length retrieved in CF22 does not match with calculated number of blocks. If false, block map array will be resized to the calculated number of blocks.
statisticsRefDs string "MetBattRemUseTime" Data stream reference for statistics retrieval.
supportedOps Array List of supported operations and their priority for execution. see operations spec.

Range retrieval configuration object

To simplify metrological events, non-metrological events, daily profiles and hourly profiles retrieval customization following object is used to define range selection parameters. It is used internally when calling getByRange function.

Property Type Description
classId number Data to be retrieved class id.
obis string Data to be retrieved obis.
attrId number Data to be retrieved attribute id.
accessSelector number Data to be retrieved attribute id.
paramClassID number Range parameter specification classID.
paramObis string Range parameter specification obis.
paramAttrId number Range parameter specification attrId.
rangeType string Range parameter specification rangeType.
maxRangePerPage number Used to specify pagination

Next are default configurations for specified retrievals:

{
    "metEventsRangeSelection": {
      "classId": 7,
      "obis": '7.0.99.98.1.255',
      "attrId": 2,
      "accessSelector": 1,
      "paramClassID": 1,
      "paramObis": [0, 0, 96, 15, 1, -1],
      "paramAttrId": 2,
      "rangeType": "long-unsigned",
      "maxRangePerPage": 7
    },
    "nonMetEventsRangeSelection": {
      "classId": 7,
      "obis": '7.0.99.98.0.255',
      "attrId": 2,
      "accessSelector": 1,
      "paramClassID": 1,
      "paramObis": [0, 0, 96, 15, 2, -1],
      "paramAttrId": 2,
      "rangeType": "long-unsigned",
      "maxRangePerPage": 8
    },
    "dailyProfilesRangeSelection": {
      "classId": 7,
      "obis": '7.0.99.99.3.255',
      "attrId": 2,
      "accessSelector": 1,
      "paramClassID": 1,
      "paramObis": [0, 0, 1, 1, 0, -1],
      "paramAttrId": 2,
      "rangeType": "double-long-unsigned",
      "maxRangePerPage": 10 * 24 * 3600
    },
    "hourlyRangeSelection": {
      "classId": 7,
      "obis": '7.0.99.99.2.255',
      "attrId": 2,
      "accessSelector": 1,
      "paramClassID": 1,
      "paramObis": [0, 0, 1, 1, 0, -1],
      "paramAttrId": 2,
      "rangeType": "double-long-unsigned",
      "maxRangePerPage": 20 * 3600
    }
}

Operations specification

supportedOps is used to specify Opengate operations execution. This property is an array of objects that contains operation name and function to be called. Operations will be executed following the order they are defined in the array.

Property Type Description
name string Opengate operation name.
funcName string Function to be called when specified operation is executed.

Default value:

{
    "supportedOps":
      [{
        "name": "ValveManagement",
        "funcName": "valveManagement"
      }, {
        "name": "ResetDiagnostic",
        "funcName": "resetDiagnostic"
      }, {
        "name": "RequestNonMetroLogs",
        "funcName": "requestNonMetroLogs"
      }, {
        "name": "HourlyValues",
        "funcName": "hourlyValues"
      }, {
        "name": "CommsBatStatus",
        "funcName": "commsBatStatus"
      }, {
        "name": "APNConfig",
        "funcName": "apnConfig"
      }, {
        "name": "PushStrategy",
        "funcName": "pushStrategy"
      }, {
        "name": "FOTA",
        "funcName": "fota"
      }]
}

On one hand it is possible to specify custom array with custom functions. On the other hand it is possible just to override specified function (for example "valveManagement" function) just to customize specific operation behavior.

dlms_gas.default object Functions

default.apnConfig(op)

Apn configuration operation logic. Configures the SIM APN and PLMN code on the device and processes the operation response.

Parameter Type Description
op Object Object returned by operation api.

default.automaticActions()

Orchestrates automatic data retrieval functions. These functions retrieve data from the device depending on last collected data and new received data. Following functions are called in order:

default.closeConnection()

Called at then end of pendingActions function. In this case (default behavior) it is empty.

default.collect()

Sends the gathered datapoints for the device, cell, and organizational unit. It takes into account if dls_gas.devCollection, dls_gas.cellCollection or dls_gas.uoCollection are defined and they have identifier field is defined.

Warning

In the case of cellCollection it will check if cell entity exists and create if necessary.

default.collectBillingPeriodSnapshotData(billingPeriodData)

Collects the billing period data snapshot. Receives an with the values of decoded billing period snapshot:

Parameter Type Description
billingPeriodData object Object containing the billing period data.

default.collectDiagnostic(diagnostic, at, source, sourceInfo)

Decodes a 16-bit diagnostic value into individual status flags that are collected with specified at, source and sourceInfo.

Parameter Type Description
diagnostic number Diagnostic value to be decoded.
at number Timestamp to be used for collection. If not defined current time will be used.
source string If defined it will be used as datapoint source.
sourceInfo object If defined it will be used as datapoint sourceInfo.

default.collectHourlyDiagnostics(diagnosticsArray, unixTime)

Collects an array of hourly diagnostics values with at time as reference.

Parameter Type Description
diagnosticsArray Array Array with hourly diagnostics values
at number Timestamp to be used as reference.

default.collectHourlyVolumes(incsArray, at)

Collects an array of hourly volume increments with at time as reference.

Parameter Type Description
incsArray Array Array with hourly volume increments
at number Timestamp to be used as reference.

default.collectMsRaw(mType, payload, payloadSize)

Internal utility to collect raw messages. It adds msRaw datapoint to device, cell and organizational unit collections. Datapoint is composed by provided arguments.

Parameter Type Description
mType number Message type.
payload string Raw hex payload.
payloadSize number Payload size in bytes.

Examples:

// For received compact frame
dlms_gas.manufacturer.function("collectMsRaw")(contextParams.templateId, utils.bytes.toHexString(payload.value), payload.value.length);
// For dlms request sent to device
dlms_gas.manufacturer.function("collectMsRaw")(-22);
// For dlms response received from device
dlms_gas.manufacturer.function("collectMsRaw")(22);

default.collectNetworkStatus(networkStatus, at)

Decodes an 8-bit network status integer value into individual flags and adds it to the device collection.

Parameter Type Description
networkStatus number Status to be decoded.
at number Timestamp to be used for collection. If not defined current time will be used.

default.collectTarifPlan(tariffPlann, at)

Transforms and collects received array of two numbers into an array of two bytes hexadecimal string.

Parameter Type Description
tariffPlann array Array of bytes representing the tariff plan.
at number Timestamp to be used for collection. If not defined current time will be used.

default.collectDailyLoadProfilesArray(loadProfiles, source, sourceInfo)

Collects from received daily profiles with specified source and sourceInfo. Each element of array must be an object with the following fields:

Parameter Type Description
loadProfiles Array Array of daily profiles to collect.
source string Optional source identifier.
sourceInfo object Optional source information.

Each element of the array is an array with 4 elements:

Element Index Type Description
0 number End of Gas day timestamp.
1 number End of Gas day cumulative diagnostic
2 number End of Gas day volume
3 number End of Gas day volume under alarm.

default.commsBatStatus(op)

Comms bat status retrieval operation logic. Retrieves battery status and communication statistics from the device and processes the operation response.

Parameter Type Description
op Object Object returned by operation api.

default.configClient()

Initializes the dlms client parameters for sending requests to the device. This method is called from dlms_gas.init function.

default.createCellIfNecessary()

Automatically provisions a new NBIoT Cell entity in Opengate if it doesn’t exist. It uses NBcellID as entity name.

default.dateToDateOctet(date)

Converts a JavaScript Date object into DLMS octet-string format for date (5 bytes).

Parameter Type Description
date Date Date to convert.

Returns an object with following fields:

Field Type Description
result Array<number> DLMS octet-string format for date (5 bytes).
error string Error message.

Example:

const date = new Date("2026-04-23T05:30:00.000Z");
const dateOctet = dlms_gas.manufacturer.function("dateToDateOctet")(date);
// Example: dateOctet = { result: [ 7, 234, 4, 23, 4 ] }

default.dateToTimeOctet(date)

Converts a JavaScript Date object into DLMS octet-string format for time (4 bytes).

Parameter Type Description
date Date Date to convert.

Returns an object with following fields:

Field Type Description
result Array<number> DLMS octet-string format for time (4 bytes).
error string Error message.

Example:

const date = new Date("2026-04-23T05:30:00.000Z");
const dateOctet = dlms_gas.manufacturer.function("dateToTimeOctet")(date);
// Example: dateOctet = { result: [ 5, 30, 0, 0 ] }

default.decode(customTemplate, descriptive)

The main entry point for Compact Frame decoding. It identifies the correct template based on the templateId in the context (or it uses the provided customTemplate), performs the decoding, and triggers the collection logic.

If customTemplate is provided, it is used to decode the compact frame, otherwise predefined templates will be used.

For compact frame decoding see dlms api documentation .

Parameter Type Description
customTemplate object Template to be used for compact frame decoding.
descriptive boolean If true, the decoded values will be in a more descriptive format.

Returns an object with following fields:

Field Type Description
result object Decoded data.
error string Error message.
const decodedData = dlms_gas.manufacturer.function("decode")();
// Correct result: decodedData = { result: [22, 225, 37, 203, 0, 15, 225, 233, 128, 255, 123, 32, 241, 71, 57, 187, 177, 79, 2, 48] }
// some error case: decodedData = { error: "error description" }

default.decodeFw(fwBytes)

Decodes a 6-byte array into a descriptive firmware version string including version numbers, build commit (hex), and date.

Returned version will be something like this: Version:${major}.${minor}.${patch};Build:0x${commitField.toString(16).toUpperCase().padStart(4, "0")};Fecha:${year}-${String(month).padStart(2, "0")}-${String(day).padStart(2, "0")}

Parameter Type Description
fwBytes Array<number> Array of 6 bytes representing the firmware version.

Returns an object with following fields:

Field Type Description
result string Decoded firmware version string. It is returned with next template:
error string Error message.
const fwBytes = [0x01, 0x02, 0x03, 0x04, 0x05, 0x06];
const fwVersion = dlms_gas.manufacturer.function("decodeFw")(fwBytes);
// Example: fwVersion = { result: "Version:1.2.3;Build:0x4506;Fecha:2026-04-23" }

default.doPushEventConfiguration(event, conf)

Internal function that executes the actual DLMS set operations to apply push event configurations.

Parameter Type Description
event number Event number (1, 2, 3, 4).
conf object Configuration for the event.

conf object has the following properties:

Property Type Description
cf number Compact frame to be configured
addressOctStr byte[] Ip:port string coded as byte array
randomTime number Random time to be used in communications
schedule Object[] Schedulation specification.

schedule is an array of four objects. Each object has the following properties:

Property Type Description
dateOctet byte[] Communication periodicity expression following DLMS standard.
timeOctet byte[] Communication time specification: [Hour, Minute, Second, Hundredths]

default.encodeIpPort(ip, port)

Encodes an IP address and port into a 22-byte octet-string for push configuration.

Parameter Type Description
ip string IP address to encode.
port number Port to encode.

Returns an byte array

Example:

const ip = "127.0.0.1";
const port = 8080;
const ipPort = dlms_gas.manufacturer.function("encodeIpPort")(ip, port);
// Example: ipPort = [ 49, 50, 55, 46, 48, 46, 48, 46, 49, 58, 56, 48, 56, 48];

default.eventScheduleArray(scheduleData)

Event DLMS schedule array generation logic. Generates the event schedule array for push events configuration. Adds the 4 events with corresponding periodicity and hour specification including disabled events.

Parameter Type Description
scheduleData Object Object with event’s day periodicty value and hour specification value from operation paraemeters.

Returns an array of objects with date and time octet. Example:

[
  {
    "dateOctet": "[-1, -1, -1, 3, -40]",
    "timeOctet": "[0, 5, 0, 0]"
  },
  {
    "dateOctet": "[-1, -1, -1, 3, -40]",
    "timeOctet": "[3, 5, 0, 0]"
  },
  {
    "dateOctet": "[-1, -1, -1, -1, -1]",
    "timeOctet": "[-1, -1, -1, -1]"
  },
  {
    "dateOctet": "[-1, -1, -1, -1, -1]",
    "timeOctet": "[-1, -1, -1, -1]"
  }
]

default.fota(op)

FOTA configuration operation logic. It manages specific scheduling, fota process initialization, blocks transfers by sessions and different process status management. It manage the operation status allong all the process.

Parameter Type Description
op Object Object returned by operation api.

default.fotaAdjustBlocks(imageTransferBlocksMap, expectedNumberOfBlocks)

Recalculates and returns blocks map according to the expectedNumberOfBlocks calculated at the FOTA operation beginig. If received array shorter than expected it is filled with false values. If it is larger, it is truncated to the expected number of blocks.

Parameter Type Description
imageTransferBlocksMap Array List of blocks retrieved in CF22
expectedNumberOfBlocks number Expected number of blocks calculated in FOTA process initialization.

Returns an array with the adjusted blocks status map.

default.fotaBlocksTransfer(op, blocksStatusMap)

Orchestrates the transmission of multiple firmware blocks in a single session, respecting the maximum messages allowed for the current ECL. It manages specially first and last block sent to update operation status. It also manages errors per session.

Parameter Type Description
op Object Object returned by operation api.

default.fotaBlockTransfer(blockIndex, bundleName, bundleVersion, deploymentName, deploymentVersion)

Executes the actual transmission of a single firmware block calling dlms.sendFotaPage method. It increase success and error counters.

Parameter Type Description
op Object Object returned by operation api.

default.fotaCalculateIdentifier(op)

Calculates the unique image identifier based on KDL, hashtag, and activation date. It adds at the beginning of the identifier follwing bytes 014D.

Parameter Type Description
op Object Object returned by operation api.

Returns an object with following properties:

Property Type Description
result Array<number> Array with the calculated image identifier.
error string Error message.

Example:

{
  "result": "[1, 77, 14, 50, 145, 16, 132, 16, 233, 67, 18, 99, 235, 189,...]"
}

default.fotaCheckAllowed(op)

Verifies if the device is correctly configured for FOTA (valid block size and FOTA enabled). It updates operation status according to the validation.

Parameter Type Description
op Object Object returned by operation api.

default.fotaCheckBadSessions()

Aborts the FOTA process if the number of consecutive bad sessions reaches the maximum allowed threshold and throws an error. It uses badSessionsCounter and maxBadSessions from dlms_gas.config.

default.fotaCheckSessionBlocksErrors()

Just checks session errors rate and updates bad sessions counter.

default.fotaContinueProcess(op)

Internal function used to continue FOTA operation from different sessions: it manage different process status, sends blocks and finalizes operation according to final status (including device default scheduling).

It updates operation status using op parameter.

Parameter Type Description
op Object Object returned by operation api.

default.fotaImgActivate(op)

Function intended to invoke image activation DLMS method, but actually is empty function in default behavior. It can be implemented in specific behaviors.

Parameter Type Description
op Object Object returned by operation api.

default.fotaImgVerify(op)

Function intended to invoke image verification DLMS method, but actually is empty function in default behavior. It can be implemented in specific behaviors.

Parameter Type Description
op Object Object returned by operation api.

default.fotaImgTransferInitiate(op)

Invokes image transfer process initiation DLMS method and calculates the total number of blocks based on the firmware size and configured block size. It updates operation status.

Parameter Type Description
op Object Object returned by operation api.

default.fotaRestoreDefaultSchedule(op)

Restores the default push strategy schedule after the FOTA process is finished or cancelled. It updates operation status.

Parameter Type Description
op Object Object returned by operation api.

default.fotaScheduleForFota(op)

Temporary updates the push strategy schedule to a more aggressive frequency (every hour) during the FOTA process to speed up block transmission. It updates operation status.

Parameter Type Description
op Object Object returned by operation api.

default.fotaStartProcess(op)

Internal function used to complete first steps of FOTA operation: device status validation, device special scheduling and fota process initialization in the meter.

It updates operation status using op parameter.

Parameter Type Description
op Object Object returned by operation api.

default.fotaStateFromCf22(op)

It retrieves CF22 and updates session data to continue with FOTA proess.

Parameter Type Description
op Object Object returned by operation api.

It returns an object with transfer status and transfered blocks map. Example:

{
  "transferStatus": 1,
  "blocksMap": "[true, true, false, false]"
}

default.fotaStatus0(op, fotaState)

Executed when the devices Compact Frame 22 retrieve status 0. Actually it calls fotaStatusUnknown function because this function is not supposed to be executed.

Parameter Type Description
op Object Object returned by operation api.
fotaState object FOTA status object with returned by fotaStateFromCf22 function.

default.fotaStatus1(op, fotaState)

Executed when the devices Compact Frame 22 retrieve status 1. Try to send pending blocks or call image verification function.

Parameter Type Description
op Object Object returned by operation api.
fotaState object FOTA status object with returned by fotaStateFromCf22 function.

default.fotaStatus2(op, fotaState)

Executed when the devices Compact Frame 22 retrieve status 2. In default behavior it does nothing.

Parameter Type Description
op Object Object returned by operation api.
fotaState object FOTA status object with returned by fotaStateFromCf22 function.

default.fotaStatus3(op, fotaState)

Executed when the devices Compact Frame 22 retrieve status 3. It just calls to fotaImgActivate function.

Parameter Type Description
op Object Object returned by operation api.
fotaState object FOTA status object with returned by fotaStateFromCf22 function.

default.fotaStatus4(op, fotaState)

Executed when the devices Compact Frame 22 retrieve status 4. It finishes the FOTA process with image verification error.

Parameter Type Description
op Object Object returned by operation api.
fotaState object FOTA status object with returned by fotaStateFromCf22 function.

default.fotaStatus5(op, fotaState)

Executed when the devices Compact Frame 22 retrieve status 5. In default behavior it does nothing.

Parameter Type Description
op Object Object returned by operation api.
fotaState object FOTA status object with returned by fotaStateFromCf22 function.

default.fotaStatus6(op, fotaState)

Executed when the devices Compact Frame 22 retrieve status 6. Asks to device for new firmware data, restores default scheduling and finlizes FOTA operation.

Parameter Type Description
op Object Object returned by operation api.
fotaState object FOTA status object with returned by fotaStateFromCf22 function.

default.fotaStatus7(op, fotaState)

Executed when the devices Compact Frame 22 retrieve status 7. It finishes the FOTA process with image activation error.

Parameter Type Description
op Object Object returned by operation api.
fotaState object FOTA status object with returned by fotaStateFromCf22 function.

default.fotaStatusUnknown(op, fotaState)

Executed when the devices Compact Frame 22 retrieve an unexpected status. In default behavior it just incresaes bad sessions counter.

Parameter Type Description
op Object Object returned by operation api.
fotaState object FOTA status object with returned by fotaStateFromCf22 function.

default.fotaUpdateLostSteps(fotaState, op)

Function that depending on fotaState (process status and blocks maps) updates operation lost steps.

Parameter Type Description
fotaState object FOTA status object with returned by fotaStateFromCf22 function.
op Object Object returned by operation api.

default.fotaUpdateSuccessBlocksFromDevice(imageTransferBlocksMap)

Updates the internal block transmission counter based on the blocks retrieved form CF 22.

Parameter Type Description
imageTransferBlocksMap Array Array with boolean values representing the status of each block.

default.getHourlyArrayWithAt(hourlyArray, refTime)

From an array with hourly data (volumes, diagnostics…) and with refTime as reference, build an array with the at time of each increment.

Parameter Type Description
hourlyArray Array Array with hourly data (volumes, diagnostics…)
refTime number Timestamp to be used as reference

Returns an array with following objects:

[
  {
    "value": "120",
    "at": "1783051200"
  },
  {
    "value": "125",
    "at": "1783054800"
  },
  {
    "value": "150",
    "at": "1783058400"
  },
  {
    "value": "200",
    "at": "1783062000"
  }
  ....
]

default.getPeriodictyOctet(period, time)

Returns the DLMS date octet-string representing the periodicity for push event schedulation. It takes into account both period and time.

Parameter Type Description
period string Name of periodicty. Check table below for supported values.
time string Time value. It is used just to check if it is null and then return Disabled octet

These are codification rules for periodicity:

Periodicty name Returned octet
Disabled [-1, -1, -1, -1, -1]
every1Day [-1, -1, -1, 1, -40]
every2Day [-1, -1, -1, 2, -40]
every3Day [-1, -1, -1, 3, -40]
endOfBilling [-1, -1, -1, -1, -36]
everyMonday [-1, -1, -1, -1, 1]
everyTuesday [-1, -1, -1, -1, 2]
everyWednesday [-1, -1, -1, -1, 3]
everyThursday [-1, -1, -1, -1, 4]
everyFriday [-1, -1, -1, -1, 5]
everySaturday [-1, -1, -1, -1, 6]
everySunday [-1, -1, -1, -1, 7]

If invalid periodicty is used, an exception will be thrown.

default.getTimeOctet(period, time)

Returns the DLMS time octet for push event schedulation. It takes into account both period and time.

Parameter Type Description
period string Name of periodicty. If it is null or Disabled, then “Disabled” time octet ([-1, -1, -1, -1]) will be returned
time string Time value. It is parsed into time octet. If it si null, then “Disabled” ([-1, -1, -1, -1]) octet will be returned

default.getStepByName(op, stepName, checkInCurrentResponse)

Search in passed operation object if the step is already completed. If checkInCurrentResponse is not specified, it will check only in steps completed in the operation. If checkInCurrentResponse is specified and it is true, it will check also in the steps added in current execution.

Parameter Type Description
op Object Object returned by operation api.
stepName string Name of the step to search.
checkInCurrentResponse boolean Whether to check in the current step response. Default value is false

default.hourlyValues(op)

Horly values retrieval operation logic. Retrieves hourly incremental volume values from the device by range and processes the operation response.

Parameter Type Description
op Object Object returned by operation api.

default.initAndCollectCf47(data)

Function called from dlms_gas.decode after decoding 47 compact frame from received notification. Initialize parameters to be used later and collects received fields.

Parameter Type Description
data Object Object with decoded compact frame data return from dlms.getCompactData() method.

default.initAndCollectCf48(data)

Function called from dlms_gas.decode after decoding 48 compact frame from received notification. Initialize parameters to be used later and collects received fields.

Parameter Type Description
data Object Object with decoded compact frame data return from dlms.getCompactData() method.

default.initAndCollectCf49(data)

Function called from dlms_gas.decode after decoding 49 compact frame from received notification. Initialize parameters to be used later and collects received fields.

Parameter Type Description
data Object Object with decoded compact frame data return from dlms.getCompactData() method.

default.initAndCollectCf51(data)

Function called from dlms_gas.decode after decoding 51 compact frame from received notification. Initialize parameters to be used later and collects received fields.

Parameter Type Description
data Object Object with decoded compact frame data return from dlms.getCompactData() method.

default.initAndCollectCf97(data)

Function called from dlms_gas.decode() after decoding 97 compact frame from received notification. Initialize parameters to be used later and collects received fields.

Parameter Type Description
data Object Object with decoded compact frame data return from dlms.getCompactData() method.
Warning

In this case, because received compact frame does not contain onlineFrameCounter it will try to recovery from the device using previously collected frame counter to initilialize client. See default.restoreOnlineFrameCounter() function

default.operations()

Dispatches and executes active operations from the Opengate platform. Retrieves all alive operations for the device using Operations JS Api. It iterates through supportedOps and executes the process for any matching active operation.

default.pendingActions()

The main entry point for a standard communication session. It orchestrates the actions to be performed in a session. It uses dlms_gas.actions object to determine which actions to perform.

The order of actions are:

default.periodicActions()

Orchestrates periodic data retrieval functions. These functions retrieve data from the device periodically:

default.pushStrategy(op)

Push configuration operation logic. Configures the push communication strategy (Compact Frame selection, platform address/port, and scheduling) for the four supported push events and process the operation response.

Parameter Type Description
op Object Object returned by operation api.

default.requestNonMetroLogs(op)

Non metrological logs retrieval operation logic. Retrieves non-metrological event logs from the device by range and processes the operation response.

Parameter Type Description
op Object Object returned by operation api.

default.resetDiagnostic(op)

Reset diagnostic operation logic. Resets the device’s diagnostic status flags by executing the corresponding DLMS method and process the operation response.

Parameter Type Description
op Object Object returned by operation api.

default.restoreOnlineFrameCounter()

This method is used when received compact frame does not contain onlineFrameCounter and it is necessary to request it to the device in order to set correct values for next requests.

In uses previously collected online onlineFrameCounter to initilialize the client’s online frame counter and then it requests the device to retrieve its actual value. If the device does not response it tries again increasing used frames counter with the value specified in onlineFramCounterRetryInc property. It will try to request onlineFrameCounter to the device up to onlineFramCounterRetryMax times.

default.retrieveDailyProfiles()

If the device does not communicate in last days it will ask for all missing daily profiles.

default.retrieveInitialData(force)

Retrieves one-time device information. It will check if device.software datastream is not collected or force parameter is true. If so it will retrieve following data:

  • Metrological and Non-metrological Firmware versions.
  • APN configuration.
  • FOTA block configuration.
Parameter Type Description
force boolean If true, retrieves the data even if it was previously collected.

default.retrieveMetrologicalEvents()

Retrieves missing metrological events from the device by range, starting from the last collected counter.

default.retrievePushEventsConfigurations(force)

Retrieves configuration for all push events (1-4) configuration. It will check for each event if confCFx datastream is not collected or force parameter is true. If so it will retrieve push event configuration.

default.retrieveStatistics(force)

Retrieves periodically communication statistics (Signal Power, RSRQ, RSRP, ECL, Battery remaining time….). It will check statisticsRefDs datastreams at value and if the data is too old (using periodicDataAgeMillis as reference). Statistics retrieval can be forced using force parameter.

Parameter Type Description
force boolean If true, retrieves the data even if the data is not too old.

default.rsrqFromRaw(raw)

Returns converted raw RSRQ to dB/dBm following standard dlms specfication.

default.rsrpFromRaw(raw)

Returns converted raw RSRQ to dB/dBm following standard dlms specfication.

default.setClock()

Checks drift and synchronizes device time.

default.signalQualityFromRaw(raw)

Converts raw CSQ value to dBm following DLMS specification.

Parameter Type Description
raw number Raw signal quality value (0-31).

default.strategy(b1, b0)

Decodes the communication strategy from two bits.

Parameter Type Description
b1 number First bit.
b0 number Second bit.

Return a string with composed strategy.

default.tauInSecondsFromRaw(raw)

Decodes TAU timer to seconds following DLMS specification.

Parameter Type Description
`raw" number 8-bit timer value.

Example:

var s = dlms_gas.manufacturer.function("tauInSecondsFromRaw")(0x21);

default.tmrInSecondsFromRaw(raw)

Decodes raw TMR to seconds following dlms specfication.

Parameter Type Description
`raw" number 8-bit timer value.

default.valveManagement(op)

Valve managment operation logic. Executes valve Open/Close commands and process the operation response.

Property Type Default Description
op Object Operation request object.

dlms_gas.pietro object Properties

There are no specific properties for dlms_gas.pietro.

dlms_gas.pietro object Functions

pietro.decodeFw(fwBytes)

Specific firmware decoding for Pietro devices. It returns a simplified version string.

dlms_gas.honeywell object Properties

Property Type Value Description
conformance string ['GENERAL_PROTECTION', 'SELECTIVE_ACCESS'] Used to define dlms.conformance when initializing client
ignoreSystemTitleInCiphering boolean false Used to define dlms.ignoreSystemTitleInCiphering when initializing client

dlms_gas.honeywell object Functions

honeywell.closeConnection()

Graceful disconnect via DLMS method specific for Honeywell devices.

honeywell.retrieveStatistics(force)

Specific statistics retrieval for Honeywell devices, excluding some attributes not supported by these devices.

honeywell.tauInSecondsFromRaw(raw)

Overrides the default TAU conversion to return directlty the raw value.

honeywell.tmrInSecondsFromRaw(raw)

Overrides the default TMR conversion to return directlty the raw value.

honeywell.eventScheduleArray(scheduleData)

Event DLMS schedule array generation logic. Generates the event schedule array for push events configuration. Adds just the events not disabledwith corresponding periodicity and hour specification.

Parameter Type Description
scheduleData Object Object with event’s day periodicty value and hour specification value from operation paraemeters.

Returns an array of objects with date and time octet. Example:

[
  {
    "dateOctet": "[-1, -1, -1, 3, -40]",
    "timeOctet": "[0, 5, 0, 0]"
  },
  {
    "dateOctet": "[-1, -1, -1, 3, -40]",
    "timeOctet": "[3, 5, 0, 0]"
  }
]

dlms_gas.spark object Properties

Property Type Value Description
forceSetWithoutList boolean true Used to define dlms.forceSetWithoutList when initializing client
eclAttribute number 253 Attribute ID for ECL retrieval.

dlms_gas.spark object Functions

spark.fotaImgVerify(op)

Invokes FOTA image verify DLMS method. It updates the operation status accordingly to the response

Property Type Default Description
op Object Operation request object.

spark.fotaCalculateIdentifier(op)

Calculates the unique image identifier based on KDL, hashtag, and activation date.

Parameter Type Description
op Object Object returned by operation api.

Returns an object with following properties:

Property Type Description
result Array<number> Array with the calculated image identifier.
error string Error message.

Example:

{
  "result": "[14, 50, 145, 16, 132, 16, 233, 67, 18, 99, 235, 189,...]"
}

dlms_gas.watertech object Properties

Property Type Value Description
conformance string ['GENERAL_PROTECTION', 'SELECTIVE_ACCESS'] Used to define dlms.conformance when initializing client
ignoreSystemTitleInCiphering boolean false Used to define dlms.ignoreSystemTitleInCiphering when initializing client

dlms_gas.watertech object Functions

There are no specific properties for dlms_gas.watertech.

IEC102 JavaScript API

Connector functions IEC102 JS API guide

This API allows users to execute operations in the IEC102 client from a connector function.

iec102 Object

The iec object is the main object of the IEC102 client. It allows to connect to communicate with devices using IEC102 protocol.

Establish connection

iec102.connect(registerType)

There is a connect method used to establish the connection with the device. When this method is called, it internally completes several actions:

  • Depending on the registerType parameter (IP, VPN, GSM, ATR), not only will the connection be made, but it may also be necessary to send some commands to establish the connection correctly. If not defined, the IP registration type will be used.
  • Once connection and registration is completed, connection status datapoints will be collected:
    • If ATR or GSM connection types are used, device.communicationModules[].subscription.mobile.presence.gsm with OK or NOK status.
  • In case of error, response status will be set to ERROR_PROCESSING and obtained error description will be added.

After connect method call, returned status must be checked to know if it is possible to continue. If not, response object should be returned.

Connection example:

iec102.ip="127.0.0.1";
iec102.port="3000";
iec102.linkAddress="1";
iec102.useMeasurePoint="1";
iec102.usePasswordAccess="1";

iec102.source="DEVICE_GSM_DATACALL";
iec102.sourcesInfo="Accessing Register through GSM data call to Device";

iec102.msisdn = "123412341324";
iec102.userName = "userName";
iec102.password = "password";
iec102.portConfig = "portConfig";

var connectionStatus = iec102.connect("GSM");
if(!connectionStatus.connected) {
    /* Connection not established. 
    At this point response object is fulfilled 
    with error code and description and skipped steps. 
    */
    return response;
}

In previous example, in case of error, there will be an implicit data collection with some data similar to this:

{
    "datastreams": [
        {
            "id": "device.communicationModules[].subscription.mobile.presence.gsm",
            "datapoints": [
                {
                    "value": "NOK",
                    "at": 1698793200000,
                    "source": "DEVICE_GSM_DATACALL",
                    "sourceInfo": "Accessing Register through GSM data call to Device"
                }
            ]
        }
    ]
}

And the response will be something similar to this:

{
    "version": "8.0",
    "trustedBoot": null,
    "operation": {
        "response": {
            "id": "request_id",
            "name": "GET_METER_INFO",
            "deviceId": "device_id",
            "resultCode": "ERROR_PROCESSING",
            "resultDescription": "Called meter responded an ERROR",
            "steps": [
                {
                    "name": "timeRequest",
                    "result": "SKIPPED",
                    "description": "Unable to make a data call"
                }
            ],
            "timestamp": 1698793200000
        }
    }
}

ASDUs definition and execution.

Once the connection is established, it is possible to execute the desired ASDUs. There are three ways to execute ASDUs:

  1. Execute directly one ASDU.
  2. Define one by one all iec102.asdus and then execute.
  3. Define iec102.asdus to be executed from operation params and then execute.

ASDUs execution behavior specification

Each ASDU to be executed must be defined with some extra params to specify correctly its behavior. For this configuration a JSON object will be used:

Field Type Description
period json Depending on the ASDU, it is necessary to specify a PERIOD
sleepTimeBeforeExec number Wait time in milliseconds before ASDU is executed. If not defined or 0 value, no wait will be done.
step json Specify if related step must added and sent to response object. If not defined, no step will be added to response object
collection json Specify if related collection must added and sent to collection object. If not defined, no datastream will be added to collection object. If defined, default datastreams will be added.

period format:

Field Type Description
initial number Initial instant of the period in milliseconds
final boolean Final instant of the period in milliseconds
type string Period type. This type can be one of: previousQuarter, previousDay, previousWeek, previousMonth, custom, lastMinutes, lastHours, lastDays

There are several utils methods to calculate this period. See date utils

step format:

Field Type Description
name string Step’s name, if not defined default step will be added.
sent boolean If added step must be sent directly after ASDU execution

collection format:

Field Type Description
sent boolean If added datastreams must be sent directly after ASDU execution

An example of ASDU execution configuration:

{
    "period": {
        "initial": 1698840000000,
        "final": 1698840899000,
        "type": "previousQuarter"
    }, 
    "sleepTimeBeforeExec": 1000,
    "step": {
        "name": "custom_name",
        "send": true
    },
    "step": {
        "send": true
    }
}

ASDUs direct execution

iec102.asdus.timeRequest()

It is possible to execute one asdu directly. For example:

var asduResult = iec102.asdus.timeRequest();

Execution result will be an object with following parameters:

Returned value will have following format:

Parameter Type Description
status boolean true if ASDU finished correctly.
description string Descriptive message with execution result
readingState string Parameter used to communicate all iec102.asdus execution status
data object Json with ASDU execution result data. Each ASDU will have specific data

In the previous example, the result could be:

{
    "status": false,
    "description": "Success",
    "readingState": "READ",
    "data":{
        "Datetime": {
            "date": "2023-11-01",
            "time": "12:00:00",
            "timezone": "GMT+1",
            "dst": 0
        }
    }
}

In this case, response steps and collected data must defined and sent manually. For example:

var asduResult = iec102.asdus.timeRequest();
if(asduResult.result){
    response.addStep("TIME_REQUEST", "SUCCESSFUL", asduResult.description);
    response.send();
    collection.addDatapoint("device.clock", asduResult.data.Datetime);
    collection.send();
}

An alternative to previous code:

var execConfig = {
    "step": {
        "sent": true
    },
    "collection": {
        "sent": true
    }
}
var asduResult = iec102.asdus.timeRequest(execConfig);

ASDUs definition from operations parameters

If launched operation has specific parameters and steps, it will be possible to calculate ASDUs from these parameters using iec102.asdus.addFromParams().

Expected parameters are:

  • Booleans with following names to know which iec102.asdus to execute.
    • doTimeRequest
    • doParameters
    • doDeviceAndManufacturer
    • doLoadCurveAbsolut
    • doLoadCurveIncremental
    • doStoredPricing
    • doConfiguration
    • doCurrentPricing
  • dataPeriod.period[0].tipo that is a string with one of following values:
    • previousQuarter
    • previousDay
    • previousWeek
    • previousMonth
    • custom
  • If dataPeriod is custom, following parameters must be defined with dates ISO string:
    • dataPeriod.period[0].parameters[0].startDate
    • dataPeriod.period[0].parameters[0].finishDate

If operation params do not match previous content, no ASDUs will be calculated.

Taking previous operation parameters specification and taking entities datastreams status into account, ASDUS to be executed will be calculated based on some predefined conditions to avoid losing data and avoid unnecessary retries.

By default, login and logout ASDUs will be added to the list.

An example of thi method usage:

/*
    Operation params:
    {
      "doTimeRequest": true,
      "doParameters": true,
      "doDeviceAndManufacturer": false,
      "doLoadCurveAbsolut": false,
      "doLoadCurveIncremental": false,
      "doStoredPricing": false,
      "doConfiguration": false,
      "doCurrentPricing": false,
      "dataPeriod": {
        "period": [
            "tipo": previousQuarter
        ]
      }
    }
*/

iec102.asdus.addFromParams();
var executionResult = iec102.asdus.execute();

/*
    iec102.asdus to be executed:
    [
        {
            "name": "login"
        },{
            "name": "timeRequest",
            "execConfig": {
                "period":{
                    "initial": 1698840000000,
                    "final": 1698840899000,
                    "type": "previousQuarter"
                },
                "sleepTimeBeforeExec": 5000
                "step": {
                    "send": true
                },
                "collection": {
                    "sent": true
                }
            }
        },{
            "name": "parameters",
            "execConfig": {
                "period":{
                    "initial": 1698840000000,
                    "final": 1698840899000,
                    "type": "previousQuarter"
                },
                "sleepTimeBeforeExec": 5000
                "step": {
                    "send": true
                },
                "collection": {
                    "sent": true
                }
            }
        },{
            "name": "logout",
            "execConfig": {
                "sleepTimeBeforeExec": 5000
            }
        }
    ]
*/

In this case, when executing all ASDUS, depending on executed ASDU, default steps could be sent directly and default collection could be done.

As explained, this method implements default behavior for ASDUs executions. If this behaviour is no valid, ASDUs to be executed must be defined manually. See ASDUs manual definition.

ASDUs manual definition:

iec102.asdus.add(name, execConfig)

It is possible to add manually using iec102.asdus.add method. This method expect following parameters to define ASDU execution correctly:

  • name: ASDU to be executed name. One of:
    • login
    • logout
    • dayLightSavingTime
    • timeRequest
    • parameters
    • deviceManufacturer
    • loadCurve
    • loadCurveQuarter
    • loadCurveIncremental
    • loadCurveIncrementalQuarter
    • storedPricing
    • currentPricing
    • configuration
  • execConfig: Json defined ASDU execution configuration

For example to define ’timeRequest’ ASDU this call must be done:

var execConfig = {
    "period":{
        "initial": 1698840000000,
        "final": 1698840899000,
        "type": "previousQuarter"
    },
    "sleepTimeBeforeExec": 5000
    "step": {
        "send": true
    },
    "collection": {
        "sent": true
    }
}
iec102.asdus.add("timeRequest", execConfig);

Previous code will add to asdus.asdusToExec array following object:

{
    "name": "timeRequest",
    "execConfig": {
            "period":{
                "initial": 1698840000000,
                "final": 1698840899000,
                "type": "previousQuarter"
            },
            "sleepTimeBeforeExec": 5000,
            "step": {
                "send": true
            },
            "collection": {
                "sent": true
            }
        }
}

In this case, after executing this ASDU default step will be sent with execution result and default datastream will be collected:

// Step to be sent
{
    "version": "8.0",
    "trustedBoot": null,
    "operation": {
        "response": {
            "steps": [
                {
                    "name": "TIME_REQUEST",
                    "result": "SUCCESS",
                    "description": "Success."
                }
            ],
        }
    }
}
// Collection to be sent
{
    "datastreams": [
        "id": "device.clock",
        "datapoints":[
            {
                "value": {
                    "date": "2023-11-01",
                    "time": "12:00:00",
                    "timezone": "GMT+1",
                    "dst": 0
                },
                "at": 1698793200000
            }
        ]
    ]
}

Defined ASDUs execution

If ASDUs are not executed one by one, but they are added from operation params or defining them one by one, iec102.asdus.execute() method must be used to execute all defined ASDUs.

iec102.asdus.execute() method will execute all added ASDUs one by one, and depending ASDU specification related steps and collection will be send.

For example, first we define manually following ASDUs and then we do execution:

var period = utils.date.period.previousQuarter(iec102.referenceTime); 

iec102.asdus.add("login");

iec102.asdus.add("loadCurveIncremental", {
    "period": period,
    "sleepTimeBeforeExec": 1000,
    "step": {
        "sent": true,
    },
    "collection":{
        "sent": false
    }
});

iec102.asdus.add("loadCurve", 
    "period": period,
    "sleepTimeBeforeExec": 1000,
    "step": {
        "name": "CUSTOM_LOAD_CURVE_STEP",
        "sent": false,
    }
});

iec102.asdus.add("logout",{
    "sleepTimeBeforeExec": 1000
});

var executionResult = iec102.asdus.execute();

/* ASDUs to be executed
[
    {
        "name": "login"
    },{
        "name": "timeRequest",
        "execConfig": {
                "sleepTimeBeforeExec": 1000
                "step": {
                    "send": true
                },
                "collection": {
                    "sent": true
                }
            }
    },{
        "name": "loadCurve",
        "execConfig": {
                "period":{
                    "initial": 1698840000000,
                    "final": 1698840899000
                },
                "sleepTimeBeforeExec": 1000
                "step": {
                    "name": "CUSTOM_LOAD_CURVE_STEP",
                    "send": false
                }
            }
    },{
        "name": "logout",
        "execConfig": {
            "sleepTimeBeforeExec": 5000 
        }
    }
]
*/

In this example, we will suppose that timeRequest ASDU finish correctly:

  1. First, login ASDU will be executed. After execution, no step or collection will be sent.

  2. Before executing timeRequest, 1000 milliseconds wait will be done.

  3. After timeRequest execution, default TIME_REQUEST step will be added because no name has been specified and it will be sent because step.send has been defined to true. This is the step to be sent directly:

    {
        "operation": {
            "response" :{
                //...
                "steps": [
                    {
                        "name": "TIME_REQUEST",
                        "result": "SUCCESSFUL",
                        "description": "Step completed successfully"
                    }
                ]
                //...
            }
        }
    }
  1. After timeRequest execution, following datastream will be added to collection object because collection is defined and it will be sent directly because collection.send is true. Datastream to be collected:
{
    "datastreams": [
        {
            "id": "device.clock",
            "datapoints":[
                {
                    "value": {
                        "date": "2023-11-01",
                        "time": "12:00:00",
                        "timezone": "GMT+1",
                        "dst": 0
                    },
                    "at": 1698793200000
                }
            ]
        }
    ]
}
  1. Before executing loadCurve, 1000 milliseconds wait will be done.

  2. After loadCurve execution, instead of adding default STEP_NAME_LOAD_CURVE_ABSOLUT step, a step with name CUSTOM_LOAD_CURVE_STEP will be added because name parameter has been specified. In this case, the step will be added to response, but not sent send has been defined to false. This is the step added to response object:

    {
        "operation": {
            "response" :{
                //...
                "steps": [
                    {
                        "name": "CUSTOM_LOAD_CURVE_STEP",
                        "result": "SUCCESSFUL",
                        "description": "Step completed successfully"
                    }
                ]
                //...
            }
        }
    }
  1. After loadCurve execution no datastream will be added to collection object because no collection field has been defined in execConfig.

  2. Finally, after 1000 milliseconds wait logout ASDU will be executed.

  3. Final executionResult will contain all ASDUs execution result.

Returned value will have following format:

Parameter Type Description
status boolean true if all ASDUs finished correctly.
iec102.asdus object Json with each ASDU execution result object.

Execution result could be something similar to this

{
    "status": false,
    "asdus": {
        "login": {
            "status": true,
            "description": "Success"
            "readingState": null,
        },
        "timeRequest": {
            "status": true,
            "description": "Success",
            "readingState": "READ",
            "data":{
                "Datetime": {
                    "date": "2023-11-01",
                    "time": "12:00:00",
                    "timezone": "GMT+1",
                    "dst": 0
                }
            }
        },
        "loadCurve": {
            "status": true,
            "description": "Success",
            "readingState": "READ",
            "data":{
                "frames": [
                    {
                        "ImportedActive": 10,
                        "Quadrant4Reactive": 10,
                        "Quadrant2Reactive": 333,
                        "Quadrant3Reactive": 334,
                        "ExportedActive": 1000,
                        "Quadrant1Reactive": 333,
                        "Timestamp": 1705536000000
                    }
                ]
            }
        },
        "logout": {
            "status": false,
            "description": "Error in logout"
            "readingState": null,
        }
    }
}

Although, login, timeRequest, and loadCurve finished correctly, because logout ASDU failed, status is failed. timeRequest, loadCurve ASDUs finished correctly and returns obtained data. Returned data depends on each ASDU.

Default steps for ASDUs

These are defined default steps for each ASDU:

ASDU STEP
login
logout
timeRequest TIME_REQUEST
configuration CONFIGURATION
parameters PARAMETERS
dayLightSavingTime
loadCurve LOAD_CURVE_ABSOLUT
loadCurveQuarter LOAD_CURVE_ABSOLUT
loadCurveIncremental LOAD_CURVE_INCREMENTAL
loadCurveIncrementalQuarter LOAD_CURVE_INCREMENTAL
deviceManufacturer DEVICE_AND_MANUFACTURER
currentPricing CURRENT_PRICING
storedPricing STORED_PRICING

Default datastreams for ASDUs

ASDU Field Datastream
login
logout
timeRequest DateTime device.clock
configuration ManufacturerCode manufacturerCode
configuration Model device.model
configuration Firmware device.software
configuration SerialNumber device.serialNumber
configuration StandardDate protocolRevDate
configuration Datetime protocolDate
configuration BatteryPercentage device.powersupply
configuration SerialPort1Baudrate serialPort1Speed
configuration SerialPort1Codification serialPort1Conf
configuration SerialPort1Mode serialPort1ShipMode
configuration SerialPort1StartingAsciiString serialPort1AsciiString
configuration SerialPort2Baudrate serialPort2Speed
configuration SerialPort2Codification serialPort2Conf
configuration VoltagePrimary voltPrim
configuration VoltageSecondary voltSec
configuration IntensityPrimary intenPrim
configuration IntensitySecondary intenSec
configuration IntegrationPeriod1 IntPerLoadCurve1
configuration IntegrationPeriod2 IntPerLoadCurve2
configuration IntegrationPeriod3 IntPerLoadCurve3
configuration ContractType contractType
configuration Contract1 contractState
parameters LinkAddressCollected elinkAddress
parameters MeasurePointsQuantity measurePointsQuantity
parameters MeasurePoint measurePoint
parameters AccessPassword accessPass
parameters IntegrationPeriod intPeriod
parameters RegistryDepth regDepth
deviceManufacturer ManufacturerCode manufacturerCode
deviceManufacturer DeviceId contIdentifier
dayLightSavingTime ToDaylightSavingTime
dayLightSavingTime ToStandardTime
loadCurve Timestamp
loadCurve ImportedActive eImpActTotDia
loadCurve ExportedActive eExpActTotDia
loadCurve Quadrant1Reactive eImpReQ1TotDia
loadCurve Quadrant2Reactive eImpReQ2TotDia
loadCurve Quadrant3Reactive eImpReQ3TotDia
loadCurve Quadrant4Reactive eImpReQ4TotDia
loadCurveQuarter frames[].Timestamp
loadCurveQuarter frames[].ImportedActive eImpActTot
loadCurveQuarter frames[].ExportedActive eExpActTot
loadCurveQuarter frames[].Quadrant1Reactive eImpReQ1Tot
loadCurveQuarter frames[].Quadrant2Reactive eImpReQ2Tot
loadCurveQuarter frames[].Quadrant3Reactive eImpReQ3Tot
loadCurveQuarter frames[].Quadrant4Reactive eImpReQ4Tot
loadCurveIncremental frames[].Timestamp
loadCurveIncremental frames[].ImportedActive eImpActIncDia
loadCurveIncremental frames[].ExportedActive eExpActIncDia
loadCurveIncremental frames[].Quadrant1Reactive eImpReQ1IncDia
loadCurveIncremental frames[].Quadrant2Reactive eImpReQ2IncDia
loadCurveIncremental frames[].Quadrant3Reactive eImpReQ3IncDia
loadCurveIncremental frames[].Quadrant4Reactive eImpReQ4IncDia
loadCurveIncrementalQuarter frames[].Timestamp
loadCurveIncrementalQuarter frames[].ImportedActive eImpActInc
loadCurveIncrementalQuarter frames[].ExportedActive eExpActInc
loadCurveIncrementalQuarter frames[].Quadrant1Reactive eImpReQ1Inc
loadCurveIncrementalQuarter frames[].Quadrant2Reactive eImpReQ2Inc
loadCurveIncrementalQuarter frames[].Quadrant3Reactive eImpReQ3Inc
loadCurveIncrementalQuarter frames[].Quadrant4Reactive eImpReQ4Inc
currentPricing frames[].Timestamp
currentPricing frames[].RateIndex ({ri})
currentPricing frames[].Memory ({m})
currentPricing frames[].AbsoluteActive eRate{ri}ActTot{m}
currentPricing frames[].IncrementalActive eRate{ri}ActInc{m}
currentPricing frames[].AbsoluteInductiveReactive eRate{ri}ReIndTot{m}
currentPricing frames[].IncrementalInductiveReactive eRate{ri}ReIndInc{m}
currentPricing frames[].AbsoluteCapacitiveReactive eRate{ri}ReCapTot{m}
currentPricing frames[].IncrementalCapacitiveReactive eRate{ri}ReCapInc{m}
currentPricing frames[].MaximumPower eRate{ri}PowerMaxVal{m}
currentPricing frames[].ExcessPower eRate{ri}PowerExVal{m}
currentPricing frames[].InitPeriodDateAsDatetime eRate{ri}PricInitPeri{m}
currentPricing frames[].EndPeriodDateAsDatetime eRate{ri}PricEndPeri{m}
storedPricing frames[].Timestamp
storedPricing frames[].RateIndex ({ri})
storedPricing frames[].Memory ({m})
storedPricing frames[].AbsoluteActive eRate{ri}ActTot{m}
storedPricing frames[].IncrementalActive eRate{ri}ActInc{m}
storedPricing frames[].AbsoluteInductiveReactive eRate{ri}ReIndTot{m}
storedPricing frames[].IncrementalInductiveReactive eRate{ri}ReIndInc{m}
storedPricing frames[].AbsoluteCapacitiveReactive eRate{ri}ReCapTot{m}
storedPricing frames[].IncrementalCapacitiveReactive eRate{ri}ReCapInc{m}
storedPricing frames[].MaximumPower eRate{ri}PowerMaxVal{m}
storedPricing frames[].ExcessPower eRate{ri}PowerExVal{m}
storedPricing frames[].InitPeriodDateAsDatetime eRate{ri}PricInitPeri{m}
storedPricing frames[].EndPeriodDateAsDatetime eRate{ri}PricEndPeri{m}

iec102 Object Properties

Property Type Default Description
ip string IP address to connect.
port number Port to connect
isTls boolean false Specifies if secure protocol must be used
retries number 5 Number of retries.
timeout number 30000 Timeout in milliseconds.
linkAddress number Mandatory parameter used as part of IEC102 protocol
useMeasurePoint number Mandatory parameter used as part of IEC102 protocol
usePasswordAccess number Mandatory parameter used as part of IEC102 protocol
msisdn string Parameter used when connection is done with a data call through some caller
userName string Parameter used when connection is done with a data call through some caller
password string Parameter used when connection is done with a data call through some caller
referenceTime number Current It will be used as reference time for period calculation and as datapoints ‘at’ value
readingState string Current Internally used parameter to keep ASDUs execution status
portConfig string Parameter used when connection is done with a data call through some caller
source string It will be used as datapoints ‘source’ value
sourcesInfo string It will be used as datapoints ‘sourcesInfo’ value
manufacturerCodeName object Manufacturer code->name map
asdus.asdusToExec array Internal array with the list of ASDUs to be executed. It must be initialized before connecting

iec102 Object Methods

connect (registerType, waitFor) ⇒ Object

Establish connection with specified device. Before using this method connection parameters such as ip, port, timeout, etc. must be specified (some of them can have default values).

See Establish connection

Parameter Type Description
registerType string Specify connection procedure.
waitFor array Strings to wait for in the response.

This method will return an object with following format:

{
    "status": true,
    "description": "Success"
}

connectWithIpAndPorts (ports, waitFor) ⇒ Object

Establish connection with specified device trying different ports. Before using this method connection parameters such as ip, timeout, etc. must be specified (some of them can have default values). In this case, a list of ports will be passed as parameters. For each port of the list, the connect method will be called until the connection is established correctly.

See Establish connection

Parameter Type Description
ports array List of ports to be used
waitFor array Strings to wait for in the response.

This method will return an object with following format:

{
    "status": true,
    "description": "Success"
}

connectWithEndpoints (endpoints) ⇒ Object

This method is special case for GSM connection.

Establish connection with specified device trying different endpoints. Each endpoint is an object with following information:

  • ip
  • port
  • userName
  • password

For example:

var endpoints = [
    {
        "ip": "127.0.0.1",
        "port": "3000",
        "userName": "userName",
        "password": "password"
    },
    {
        "ip": "127.0.0.2",
        "port": "3001",
        "userName": "userName2",
        "password": "password2"
    }
];
iec102.connectWithEndpoints(endpoints);

In this case, GSM register type will be used.

See Establish connection

Parameter Type Description
endpoints array List of objects with endpoints spec

This method will return an object with following format:

{
    "status": true,
    "description": "Success"
}

disconnect ()

Closes IEC102 connection

send (command, waitFor, pattern) ⇒ Object

Sends a command.

Parameter Type Description
command string Command to send.
waitFor List Strings to wait for in the response.
pattern string Pattern to extract response from sent command.

Returns a json with status and description properties:

{
    "status": true,
    "description": "Success"
}

iec102.asdus.add(name, execConfig)

Define an ASDU to be executed and add to asdus.asdusToExec array.

See ASDUs Definition and Execution

Parameter Type Description
name string ASDU name
execConfig object Execution configuration

iec102.asdus.addFromParameters()

Calculates all ASDUs to be executed from operations parameters adding them to asdus.asdusToExec array. This method only works if parameters object has specific properties.

See ASDUs Definition and Execution

iec102.asdus.login(execConfig)

Execute directly login ASDU.

See ASDUs Definition and Execution

Parameter Type Description
execConfig object Execution configuration

Return a json with following format:

{
    "status": true,
    "description": "Success",
    "readingState": null,
}

iec102.asdus.logout(execConfig)

Execute directly logout ASDU.

See ASDUs Definition and Execution

Parameter Type Description
execConfig object Execution configuration

Return a json with following format:

{
    "status": true,
    "description": "Success",
    "readingState": null,
}

iec102.asdus.timeRequest(execConfig)

Execute directly timeRequest ASDU.

See ASDUs Definition and Execution

Parameter Type Description
execConfig object Execution configuration

Return a json with following format:

{
    "status": true,
    "description": "Success",
    "readingState": "READ",
    "data": {
        "Datetime": {
            "date": "2024-01-19",
            "time": "09:36:58",
            "timezone": "GMT+1",
            "dst": 0
        }
    }
}

data object will contain data retrieved from executed ASDU.

iec102.asdus.configuration(execConfig)

Execute directly configuration ASDU.

See ASDUs Definition and Execution

Parameter Type Description
execConfig object Execution configuration

Return a json with following format:

{
    "status": true,
    "description": "Success",
    "readingState": "READ",
    "data": {
        "Contract1": "unknown",
        "VoltageSecondary": 0,
        "ManufacturerCode": "1",
        "BatteryPercentage": 44,
        "SerialPort1StartingAsciiString": "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000",
        "IntensityPrimary": 0,
        "IntegrationPeriod3": 0,
        "VoltagePrimary": 0,
        "IntegrationPeriod1": 60,
        "IntegrationPeriod2": 15,
        "SerialPort1Mode": 0,
        "IntensitySecondary": 0,
        "SerialNumber": 333,
        "Model": {
            "name": "AQ",
            "version": "",
            "manufacturer": "",
            "manufacturerOUI": ""
        },
        "SerialPort1Codification": "8/No/2",
        "ContractType": "Contract I",
        "StandardDate": "2002-05-01",
        "Firmware": [
            {
                "name": "Firmware version",
                "version": "2",
                "type": "FIRMWARE"
            }
        ],
        "SerialPort1Baudrate": 9600,
        "SerialPort2Baudrate": 0,
        "SerialPort2Codification": "8/No/2",
        "Datetime": {
            "date": "2002-04-10",
            "time": "00:00:00",
            "timezone": "GMT+1",
            "dst": 0
        }
    }
}

data object will contain data retrieved from executed ASDU.

iec102.asdus.parameters(execConfig)

Execute directly parameters ASDU.

See ASDUs Definition and Execution

Parameter Type Description
execConfig object Execution configuration

Return a json with following format:

{
    "status": true,
    "description": "Success",
    "readingState": "READ",
    "data": {
        "RegistryDepth": 4000,
        "LinkAddressCollected": 1,
        "IntegrationPeriod": 60,
        "AccessPassword": 1,
        "MeasurePoint": 1,
        "MeasurePointsQuantity": 1
    }
}

data object will contain data retrieved from executed ASDU.

iec102.asdus.deviceManufacturer(execConfig)

Execute directly deviceManufacturer ASDU.

See ASDUs Definition and Execution

Parameter Type Description
execConfig object Execution configuration

Return a json with following format:

{
    "status": true,
    "description": "Success",
    "readingState": "READ",
    "data": {
        "ManufacturerCode": "81",
        "DeviceId": "501606407"
    }
}

data object will contain data retrieved from executed ASDU.

iec102.asdus.dayLightSavingTime(execConfig)

Execute directly dayLightSavingTime ASDU.

See ASDUs Definition and Execution

Parameter Type Description
execConfig object Execution configuration

Return a json with following format:

{
    "status": true,
    "description": "Success",
    "readingState": "READ",
    "data": {
        "ToDaylightSavingTime": {
            "date": "2002-04-10",
            "time": "00:00:00",
            "timezone": "GMT+1",
            "dst": 0
        },
        "ToStandardTime": {
            "date": "2002-04-10",
            "time": "00:00:00",
            "timezone": "GMT+1",
            "dst": 0
        }      
    }
}

data object will contain data retrieved from executed ASDU.

iec102.asdus.loadCurve(execConfig)

Execute directly loadCurve ASDU.

See ASDUs Definition and Execution

Parameter Type Description
execConfig object Execution configuration

Return a json with following format:

{
    "status": true,
    "description": "Success",
    "readingState": "READ",
    "data": {
        "frames": [
            {
                "ImportedActive": 10,
                "Quadrant4Reactive": 10,
                "Quadrant2Reactive": 333,
                "Quadrant3Reactive": 334,
                "ExportedActive": 1000,
                "Quadrant1Reactive": 333,
                "Timestamp": 1705536000000
            },
            //...
        ]
    }
}

data object will contain a field named frames that is an array. Each array element is an object with the data retrieved.

iec102.asdus.loadCurveQuarter(execConfig)

Execute directly loadCurveQuarter ASDU.

See ASDUs Definition and Execution

Parameter Type Description
execConfig object Execution configuration

Return a json with following format:

{
    "status": true,
    "description": "Success",
    "readingState": "READ",
    "data": {
        "frames": [
            {
                "ImportedActive": 10,
                "Quadrant4Reactive": 10,
                "Quadrant2Reactive": 333,
                "Quadrant3Reactive": 334,
                "ExportedActive": 1000,
                "Quadrant1Reactive": 333,
                "Timestamp": 1705536000000
            },
            {
                "ImportedActive": 0,
                "Quadrant4Reactive": 125,
                "Quadrant2Reactive": 125,
                "Quadrant3Reactive": 125,
                "ExportedActive": 500,
                "Quadrant1Reactive": 125,
                "Timestamp": 1705536900000
            }
            //...
        ]
    }
}

data object will contain a field named frames that is an array. Each array element is an object with the data retrieved.

iec102.asdus.loadCurveIncremental(execConfig)

Execute directly loadCurveIncremental ASDU.

See ASDUs Definition and Execution

Parameter Type Description
execConfig object Execution configuration

Return a json with following format:

{
    "status": true,
    "description": "Success",
    "readingState": "READ",
    "data": {
        "frames": [
            {
                "ImportedActive": 10,
                "Quadrant4Reactive": 10,
                "Quadrant2Reactive": 333,
                "Quadrant3Reactive": 334,
                "ExportedActive": 1000,
                "Quadrant1Reactive": 333,
                "Timestamp": 1705536000000
            }
            //...
        ]
    }
}

data object will contain a field named frames that is an array. Each array element is an object with the data retrieved.

iec102.asdus.loadCurveIncrementalQuarter(execConfig)

Execute directly loadCurveIncrementalQuarter ASDU.

See ASDUs Definition and Execution

Parameter Type Description
execConfig object Execution configuration

Return a json with following format:

{
    "status": true,
    "description": "Success",
    "readingState": "READ",
    "data": {
        "frames": [
            {
                "ImportedActive": 2,
                "Quadrant4Reactive": 0,
                "Quadrant2Reactive": 1,
                "Quadrant3Reactive": 1,
                "ExportedActive": 1,
                "Quadrant1Reactive": 2,
                "Timestamp": 1705536000000
            },
            {
                "ImportedActive": 0,
                "Quadrant4Reactive": 0,
                "Quadrant2Reactive": 0,
                "Quadrant3Reactive": 0,
                "ExportedActive": 2,
                "Quadrant1Reactive": 0,
                "Timestamp": 1705536900000
            }
            //...
        ]
    }
}

data object will contain a field named frames that is an array. Each array element is an object with the data retrieved.

iec102.asdus.currentPricing(execConfig)

Execute directly currentPricing ASDU.

See ASDUs Definition and Execution

Parameter Type Description
execConfig object Execution configuration

Return a json with following format:

{
    "status": true,
    "description": "Success",
    "readingState": "READ",
    "data": {
        "frames": [
            {
                "IncrementalActive": 5060,
                "IncrementalCapacitiveReactive": 54,
                "Memory": "Cur",
                "AbsoluteCapacitiveReactive": 4564,
                "Timestamp": 1705653489884,
                "MaximumPower": 19,
                "EndPeriodDateAsDatetime": {
                    "date": "2024-02-29",
                    "time": "23:59:00",
                    "timezone": "GMT+1",
                    "dst": 0
                },
                "RateIndex": "Tot",
                "InitPeriodDateAsDatetime": {
                    "date": "2024-02-01",
                    "time": "00:00:00",
                    "timezone": "GMT+1",
                    "dst": 0
                },
                "ExcessPower": 0,
                "AbsoluteActive": 595452,
                "AbsoluteInductiveReactive": 1207,
                "IncrementalInductiveReactive": 6
            },
            //...
        ]
    }
}

data object will contain a field named frames that is an array. Each array element is an object with the data retrieved.

iec102.asdus.storedPricing(execConfig)

Execute directly storedPricing ASDU.

See ASDUs Definition and Execution

Parameter Type Description
execConfig object Execution configuration

Return a json with following format:

{
    "status": true,
    "description": "Success",
    "readingState": "READ",
    "data": {
        "frames": [
            {
                "IncrementalActive": 5060,
                "IncrementalCapacitiveReactive": 54,
                "Memory": "Mem",
                "AbsoluteCapacitiveReactive": 4564,
                "Timestamp": 1705653478357,
                "MaximumPower": 19,
                "EndPeriodDateAsDatetime": {
                    "date": "2024-02-29",
                    "time": "23:59:00",
                    "timezone": "GMT+1",
                    "dst": 0
                },
                "RateIndex": "Tot",
                "InitPeriodDateAsDatetime": {
                    "date": "2024-02-01",
                    "time": "00:00:00",
                    "timezone": "GMT+1",
                    "dst": 0
                },
                "ExcessPower": 0,
                "AbsoluteActive": 595452,
                "AbsoluteInductiveReactive": 1207,
                "IncrementalInductiveReactive": 6
            }
            //...
        ]
    }
}

data object will contain a field named frames that is an array. Each array element is an object with the data retrieved.

iec102.asdus.execute()

Execute one by one all the ASDUs defined in asdus.asdusToExec.

See ASDUs Definition and Execution

Returns an object with following format:

{
    "status": true,
    "asdus": {
        "login": {
            "data": null,
            "description": "Success",
            "readingState": null,
            "status": true
        },
        "timeRequest": {
            "data": {
                "Datetime": {
                    "date": "2024-01-19",
                    "time": "09:36:58",
                    "timezone": "GMT+1",
                    "dst": 0
                }
            },
            "description": "Success",
            "readingState": "READ",
            "status": true
        },
        "parameters": {
            "data": {
                "RegistryDepth": 4000,
                "LinkAddressCollected": 1,
                "IntegrationPeriod": 60,
                "AccessPassword": 1,
                "MeasurePoint": 1,
                "MeasurePointsQuantity": 1
            },
            "description": "Success",
            "readingState": "READ",
            "status": true
        },
        "deviceManufacturer": {
            "data": {
                "ManufacturerCode": "81",
                "DeviceId": "501606407"
            },
            "description": "Success",
            "readingState": "READ",
            "status": true
        },
        "loadCurve": {
            "data": {
                "frames": [
                    {
                        "ImportedActive": 10,
                        "Quadrant4Reactive": 10,
                        "Quadrant2Reactive": 333,
                        "Quadrant3Reactive": 334,
                        "ExportedActive": 1000,
                        "Quadrant1Reactive": 333,
                        "Timestamp": 1705536000000
                    }
                ]
            },
            "description": "Success",
            "readingState": "READ",
            "status": true
        },
        "loadCurveQuarter": {
            "data": {
                "frames": [
                    {
                        "ImportedActive": 10,
                        "Quadrant4Reactive": 10,
                        "Quadrant2Reactive": 333,
                        "Quadrant3Reactive": 334,
                        "ExportedActive": 1000,
                        "Quadrant1Reactive": 333,
                        "Timestamp": 1705536000000
                    }
                    //...
                ]
            },
            "description": "Success",
            "readingState": "READ",
            "status": true
        },
        "loadCurveIncremental": {
            "data": {
                "frames": [
                    {
                        "ImportedActive": 10,
                        "Quadrant4Reactive": 10,
                        "Quadrant2Reactive": 333,
                        "Quadrant3Reactive": 334,
                        "ExportedActive": 1000,
                        "Quadrant1Reactive": 333,
                        "Timestamp": 1705536000000
                    }
                ]
            },
            "description": "Success",
            "readingState": "READ",
            "status": true
        },
        "loadCurveIncrementalQuarter": {
            "data": {
                "frames": [
                    {
                        "ImportedActive": 2,
                        "Quadrant4Reactive": 0,
                        "Quadrant2Reactive": 1,
                        "Quadrant3Reactive": 1,
                        "ExportedActive": 1,
                        "Quadrant1Reactive": 2,
                        "Timestamp": 1705536000000
                    }
                    //...
                ]
            },
            "description": "Success",
            "readingState": "READ",
            "status": true
        },
        "storedPricing": {
            "data": {
                "frames": [
                    {
                        "IncrementalActive": 5060,
                        "IncrementalCapacitiveReactive": 54,
                        "Memory": "Mem",
                        "AbsoluteCapacitiveReactive": 4564,
                        "Timestamp": 1705653478357,
                        "MaximumPower": 19,
                        "EndPeriodDateAsDatetime": {
                            "date": "2024-02-29",
                            "time": "23:59:00",
                            "timezone": "GMT+1",
                            "dst": 0
                        },
                        "RateIndex": "Tot",
                        "InitPeriodDateAsDatetime": {
                            "date": "2024-02-01",
                            "time": "00:00:00",
                            "timezone": "GMT+1",
                            "dst": 0
                        },
                        "ExcessPower": 0,
                        "AbsoluteActive": 595452,
                        "AbsoluteInductiveReactive": 1207,
                        "IncrementalInductiveReactive": 6
                    }
                    //...
                ]
            },
            "description": "Success",
            "readingState": "READ",
            "status": true
        },
        "configuration": {
            "data": {
                "Contract1": "unknown",
                "VoltageSecondary": 0,
                "ManufacturerCode": "1",
                "BatteryPercentage": 44,
                "SerialPort1StartingAsciiString": "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000",
                "IntensityPrimary": 0,
                "IntegrationPeriod3": 0,
                "VoltagePrimary": 0,
                "IntegrationPeriod1": 60,
                "IntegrationPeriod2": 15,
                "SerialPort1Mode": 0,
                "IntensitySecondary": 0,
                "SerialNumber": 333,
                "Model": {
                    "name": "AQ",
                    "version": "",
                    "manufacturer": "",
                    "manufacturerOUI": ""
                },
                "SerialPort1Codification": "8/No/2",
                "ContractType": "Contract I",
                "StandardDate": "2002-05-01",
                "Firmware": [
                    {
                        "name": "Firmware version",
                        "version": "2",
                        "type": "FIRMWARE"
                    }
                ],
                "SerialPort1Baudrate": 9600,
                "SerialPort2Baudrate": 0,
                "SerialPort2Codification": "8/No/2",
                "Datetime": {
                    "date": "2002-04-10",
                    "time": "00:00:00",
                    "timezone": "GMT+1",
                    "dst": 0
                }
            },
            "description": "Success",
            "readingState": "READ",
            "status": true
        },
        "currentPricing": {
            "data": {
                "frames": [
                    {
                        "IncrementalActive": 5060,
                        "IncrementalCapacitiveReactive": 54,
                        "Memory": "Cur",
                        "AbsoluteCapacitiveReactive": 4564,
                        "Timestamp": 1705653489884,
                        "MaximumPower": 19,
                        "EndPeriodDateAsDatetime": {
                            "date": "2024-02-29",
                            "time": "23:59:00",
                            "timezone": "GMT+1",
                            "dst": 0
                        },
                        "RateIndex": "Tot",
                        "InitPeriodDateAsDatetime": {
                            "date": "2024-02-01",
                            "time": "00:00:00",
                            "timezone": "GMT+1",
                            "dst": 0
                        },
                        "ExcessPower": 0,
                        "AbsoluteActive": 595452,
                        "AbsoluteInductiveReactive": 1207,
                        "IncrementalInductiveReactive": 6
                    }
                    //...
                ]
            },
            "description": "Success",
            "readingState": "READ",
            "status": true
        },
        "logout": {
            "data": null,
            "description": "Success",
            "readingState": null,
            "status": true
        }
    }
}

Catalog GetMeterInfo operation example

Following code shows the catalog connector function for GetMeterInfo operation

var registerType = entityValue(entity, 'provision.type');

iec102.ip = entityValue(entity, 'provision.ip');
iec102.port = entityValue(entity, 'provision.port');

iec102.linkAddress = Number(entityValue(entity, 'provision.linkAddress'));
iec102.useMeasurePoint = Number( entityValue(entity, 'provision.measurePoint'));
iec102.usePasswordAccess = Number( entityValue(entity, 'provision.passwordAccess'));

iec102.msisdn =  entityValue(entity, 'provision.device.communicationModules[].subscription.mobile.msisdn', 0);
iec102.userName =  entityValue(entity, 'provision.user');
iec102.password =  entityValue(entity, 'provision.password');
iec102.portConfig =  entityValue(entity, 'provision.portConfig');

if (!registerType) {
    response.errorProcessing('Meter type was not specified');
    return response;
}

var connectionStatus = iec102.connect(registerType);
collection.addDatapoint('atd.response', connectionStatus.description, iec102.referenceTime, iec102.source, iec102.sourceInfo);
if (!connectionStatus.status) {
    collection.addDatapoint('readingState', iec102.readingState, iec102.referenceTime, iec102.source, iec102.sourceInfo);
    collection.send();
    return response;
}

iec102.asdus.addFromParams();
var asdusResult = iec102.asdus.execute();

iec102.disconnect();

collection.addDatapoint('readingState', iec102.readingState, iec102.referenceTime, iec102.source, iec102.sourceInfo);
collection.send();
if (asdusResult.status) {
    response.successful('Finished Correctly');
}

log('Final response: ', response);
return response;

Kite Javascript API

Connector functions Kite JS API guide

This API allows users to execute operations in the Kite connector from a connector function.

Kite Object

The Kite object is the main object of the Kite connector. It allows to connect to the Kite server and execute operations.

Kite Object Properties

Property Type Default Description
uriHost string Host of the Kite server.
uriService string Service of the Kite server.
proxyEnabled boolean false Enable proxy.
proxyHost string Host of the proxy (if the proxy is enabled).
proxyPort number Port of the proxy (if the proxy is enabled).
proxyProtocol string Protocol of the proxy (if proxy is enabled).

It should be noted that these properties will be used in all communication methods with Kite Service.

Specific datastreams to use Kite

Datastream Type Description
provision.administration.connection.kite.certificate String Certificate to communication with Kite
provision.administration.connection.kite.privateKey String Private Key to communication with Kite

These data streams can be specified:

  • To a chosen device.
  • To a chosen channel. Please use these values for all the entities in the selected channel.
  • To a chosen organization. This set of values should be used in the same way in every part of the organization.

Kite Object Methods

kite.requestChangeTerminalStatus(status)

Changes the subscription status using the specified parameter and completes the collection object with a new administrative status.

Parameter Type Description
status string Status of the subscription.

Returns an object with the following properties:

  • isOk (boolean): true if the request is ok
  • description: Result description of the operation.

This method also triggers the collection of the following data stream:

  • device.communicationModules[].subscription.administrativeState

This data stream is automatically populated after calling the method.

Example of use:

let result = kite.requestChangeTerminalStatus()
if (result.isOk) {
    collection.send()
    response.successful(result.description)
} else {
    response.errorProcessing(result.description)
}

return response

kite.requestTerminalDetails()

Gets the details of the subscription and complete collection object with result.

Returns an object with the following properties:

  • isOk (boolean): true if the request is ok
  • description: Description of the operation’s result.

This method also triggers the collection of the following data streams:

  • device.communicationModules[].mobile.imei
  • device.communicationModules[].model
  • device.communicationModules[].subscription.address
  • device.communicationModules[].subscription.administrativeState
  • device.communicationModules[].subscription.counters.totalBytesLastDay
  • device.communicationModules[].subscription.counters.totalBytesLastMonth
  • device.communicationModules[].subscription.identifier
  • device.communicationModules[].subscription.mobile.ggsn.ipAddress
  • device.communicationModules[].subscription.mobile.icc
  • device.communicationModules[].subscription.mobile.imsi
  • device.communicationModules[].subscription.mobile.msisdn
  • device.communicationModules[].subscription.mobile.ratType
  • device.communicationModules[].subscription.mobile.sgsn.countryCode
  • device.communicationModules[].subscription.mobile.sgsn.ipAddress
  • device.communicationModules[].subscription.mobile.sgsn.operatorName
  • device.communicationModules[].subscription.mobile.uli.cgi
  • entity.location

These data streams are automatically populated after calling the method.

Example of use:

let result = kite.requestTerminalDetails()
if (result.isOk) {
    collection.send()
    response.successful(result.description)
} else {
    response.errorProcessing(result.description)
}
return response

SNMP JavaScript API

Connector functions SNMP JS API guide

This JavaScript code provides predefined functions to execute SNMP requests from the connector function. They are explained below.

JS SNMP API

For REQUEST Connector Functions we will use the functions get and set described below. You have an object, named snmp, with those functions described. You must use snmp.get or snmp.set.

If you want to collect data after executing any of these function you can call collectCF and you can set various oids in the URL provided as you can see in the next example:

collectCF(result.data, "snmps://<oidValue>");

snmp.addOid()

Adds an OID to the list of OIDs to be retrieved/setted.

Param Type Description
oid string OID to add.
type string Type of the value.
value string Value to set.

Example of use:

// Example for get
snmp.addOid('1.3.6.1.4.1.2007.4.1.2.2.2.18.3.2.1.10.3');
snmp.get()

//Example for set
snmp.addOid('1.0.1.4.5.123456.1.6', 'INTEGER', '3');
snmp.set()

snmp.get()

Executes a multi SNMP get attribute request with specified payload. You must have previously given value to the properties snmp.ip, snmp.port (161 by default), snmp.community (in case of snmp version 1), snmp.version (3 by default), snmp.retries (3 by default), snmp.timeout (5000 by default) and security info in case of snmpv3 version (snmp.securityName, snmp.authentication, snmp.privacy, snmp.authPassphrase and snmp.privPassphrase). In addition, you have to add the oids you want to get using the snmp.addOid function with the oid string as many times as you want.

Kind: global function
Returns: String - A JSON with response. This JSON will have two fields: ‘result’ of the get operation and ‘data’ with response of the device.

SNMP Field Type Description
ip string IP address of the device you want to connect to.
port number Port of the device you want to connect to. By default is 161.
oids Array Array of strings with the list of wanted oids. To add items to the list, you must call the function ‘snmp.addOid’ with the oid as parameter as many times as you want oids.
community string The community octet string. This is a convenience method to set the security name for community based SNMP (v1 and v2c).
securityName string The security name of the user (typically the user name).
authentication string The authentication protocol ID to be associated with this user. If set to null, this user only supports unauthenticated messages.
authPassphrase string The authentication passphrase. If not null, authentication must also be not null.
privacy string The privacy protocol ID to be associated with this user. If set to null, this user only supports unencrypted messages.
privPassphrase string The privacy passphrase. If not null, privacy must also be not null.
version number Version number of the SNMP. By default is 3.
retries number Number of retries for the request. By default is 3.
timeout number Timeout of the request in millis. By default is 5000.

Here is an example of use for the snmp.addOid function for snmp.get:

snmp.addOid('1.3.6.1.4.1.2007.4.1.2.2.2.18.3.2.1.10.3');
snmp.addOid('1.3.6.1.4.1.2007.4.1.2.2.2.18.3.2.1.11.3');
snmp.get();

snmp.set()

Executes a multi SNMP set attribute request with specified payload. You must have previously given value to the properties snmp.ip, snmp.port (161 by default), snmp.community (in case of snmp version 1), snmp.version (3 by default), snmp.retries (3 by default), snmp.timeout (5000 by default) and security info in case of snmpv3 version (snmp.securityName, snmp.authentication, snmp.privacy, snmp.authPassphrase and snmp.privPassphrase). In addition, you have to add the oids you want to set using the snmp.addOid function with the oid string, the type of the value and the value you want to set to as many times as you want.

Kind: global function
Returns: String - A JSON with response. This JSON will have two fields: ‘result’ of the get operation and ‘data’ with response of the device. This ‘data’ contains pairs of (oid, value).

SNMP Field Type Description
ip string IP address of the device you want to connect to.
port number Port of the device you want to connect to. By default is 161.
oids Array Array of items with the list of oids you want to set. To add items to the list, you must call the function ‘snmp.addOid’ with the oid you want to set, the type of the value for that oid and the value you want to set as parameters as many times as you want oids.
community string The community octet string. This is a convenience method to set the security name for community based SNMP (v1 and v2c).
securityName string The security name of the user (typically the user name).
authentication string The authentication protocol ID to be associated with this user. If set to null, this user only supports unauthenticated messages.
authPassphrase string The authentication passphrase. If not null, authentication must also be not null.
privacy string The privacy protocol ID to be associated with this user. If set to null, this user only supports unencrypted messages.
privPassphrase string The privacy passphrase. If not null, privacy must also be not null.
version number Version number of the SNMP. By default is 3.
retries number Number of retries for the request. By default is 3.
timeout number Timeout of the request in millis. By default is 5000.

Here is an example of use for the snmp.addOid function for snmp.set:

snmp.addOid('1.0.1.4.5.123456.1.5', 'OCTET_STRING', params.variableList[0].value);
snmp.addOid('1.0.1.4.5.123456.1.6', 'INTEGER', '3');
snmp.set();

The allowed values for type are: OBJECT_IDENTIFIER, INTEGER, BIT_STRING, OCTET_STRING, GAUGE32, COUNTER32, COUNTER64, TIMETICKS, OPAQUE and IPADDRESS.

Here is a successful response example:

{
  "result": {
    "code": "SUCCESSFUL",
    "description": "Operation executed successfully"
  },
  "data": {
    "oid":"value",
    "oid1":"value1",
    ....
    "oidN":"valueN"
  }
}

And here an error response example:

{
  "result": {
    "code": "ERROR_PROCESSING",
    "description": "Error getting data"
  },
  "data": {}
}

SSH JavaScript API

Connector functions SSH JS API guide

This API allows users to execute operations in the SSH client from a connector function.

Ssh Object

The ssh object is the main object of the SSH client. It allows to connect to an SSH server, send commands and receive responses and disconnect from the SSH server.

Ssh Object Properties

Property Type Default Description
ip string IP address of the SSH server.
port number 23 Port of the SSH server.
retries number 3 Number of retries.
timeout number 5000 Timeout in milliseconds.
user string SSH user.
password string SSH password.
identity string Rsa key content.

Ssh Object Methods

ssh.connect(waitFor)

Establish a connection with the SSH server.

Property Type Default Description
waitFor List Strings to wait for in the response.

Connects to the SSH server using the properties of the ssh object:

  • ip: IP address of the SSH server.
  • port: Port of the SSH server.
  • retries: Number of retries.
  • timeout: Timeout in milliseconds.
  • user: SSH user.
  • password: SSH password.
  • identity: Rsa key content.

Returns an object with the following properties:

  • result: true if the connection was successful, false otherwise.
  • message: Empty if the connection was successful, error message otherwise.

Example of use:

ssh.ip = "[IP_ADDRESS]";
ssh.port = 22;
ssh.user = "sshuser";
ssh.password = "password";

// this example shows how to connect to an SSH server and wait for the "Connection established" string.
var connectResult = ssh.connect(["Connection established"]);

if (connectResult.result) {
    // Connection was successful
} else {
    // Connection failed
}

ssh.send(command, pattern, waitFor)

Sends a command to the SSH server and waits for the response.

Parameter Type Description
command string Command to send to the SSH server.
pattern string Pattern to extract response from sent command.
waitFor List Strings to wait for in the response.
  • retries: Number of retries.
  • timeout: Timeout in milliseconds.

Returns the response of the SSH server in string format.

Example of use:

// this example shows how to send a command to an SSH server and wait for the "/home/sshuser" string.
var sendResult = ssh.send("ls -la", "*", ["/home/sshuser"]);

ssh.disconnect()

Disconnects from the SSH server.

Example of use:

ssh.disconnect();

Telnet Javascript API

Connector functions Telnet JS API guide

This API allows users to execute operations in the Telnet connector from a connector function.

Telnet Object

The Telnet object is the main object of the Telnet connector. It allows to connect to a Telnet server, send commands and receive responses, and disconnect from the Telnet server.

Telnet Object Properties

Property Type Default Description
ip string IP address of the Telnet server.
port number 23 Port of the Telnet server.
retries number 3 Number of retries.
timeout number 5000 Timeout in milliseconds.

Telnet Object Methods

telnet.connect (waitFor)

Connects to the Telnet server using the properties of the Telnet object and the specified parameters.

Parameter Type Description
waitFor string String to wait for in the response.
  • ip: IP address of the Telnet server.
  • port: Port of the Telnet server.
  • retries: Number of retries.
  • timeout: Timeout in milliseconds.

Returns an object with the following properties:

  • result: true if the connection was successful, false otherwise.
  • message: Empty if the connection was successful, error message otherwise.

Example of use:

telnet.ip = "[IP_ADDRESS]";
telnet.port = 23;

var connectResult = telnet.connect(">");

if (connectResult.result) {
    // Connection was successful
} else {
    // Connection failed
}

telnet.send (command, pattern, waitFor)

Sends a command to the Telnet server and waits for the response with the specified parameters:

Parameter Type Description
command string Command to send to the Telnet server.
pattern string String to pattern match in the response. In RegExp format.
waitFor string String to wait for in the response. If not specified, the default is >.
  • retries: Number of retries.
  • timeout: Timeout in milliseconds.

Returns the response of the Telnet server in an array of strings.

Example of use:

var sendResult = telnet.send("ls -la", "*", ">");

telnet.disconnect ()

Disconnects from the Telnet server.

Example of use:

telnet.disconnect();

ICMP JavaScript API

Introduction

This API allows users to send PING operations to an IP address.

Icmp Object

The icmp object is the main object of the ICMP client. It allows sending a PING operation to an IP address, and receiving the response (in synchronous or asynchronous mode).

Icmp Object Properties

Property Type Default Description
ip string (*) IP address to send PING.
retries number 5 Number of PING delivery retries.
timeout number 2500 Timeout in milliseconds of retry.
async boolean true Decide if the request is asynchronous (true) or synchronous (false).

(*) By default, select the IP of the device or the provisioned subscription.

Icmp Object Methods

icmp.send()

Send PING using the properties of the icmp object:

  • ip: IP address to send PING.
  • retries: Number of PING delivery retries.
  • timeout: Timeout in milliseconds of retry.
  • async: Decide if the request is asynchronous or synchronous.
  • RETURN: If the async property is false, then returns an object with the following properties:

    • result: String. The value will be “OK” when the result is successfull or “NOK” when the result of the request had error, for example, timeout.
    • deviceId: String. Entity receiving the ping.
    • datastreams: An array with the information of the request result.

Example of use:

icmp.ip = "10.10.10.174";
icmp.send();

Result:

  • SUCESSFULL:
{
  "result": "OK",
  "datastreams": [
    {
        "id":"device.communicationModules[].subscription.address",
        "datapoints":[
            {
                "value":{
                    "value": "10.10.10.174"
                }
            }
        ]
    },
    {
        "id":"device.communicationModules[].subscription.presence.ip",
        "datapoints":[
            {
                "value": "OK"
            }
        ]
    },
    {
        "id":"device.communicationModules[].subscription.presence.ipRtt",
        "datapoints":[
            {
                "value": 6
            }
        ]
    }
  ]
}
  • ERROR:
{
  "result": "NOK",
  "deviceId": "deviceId",
  "datastreams": [
    {
      "datastreamId": "collected.device.communicationModules.subscription.address",
      "value": "172.19.18.95"
    },
    {
      "datastreamId": "collected.device.communicationModules.subscription.presence.ip",
      "value": "NOK"
    }
  ]
}

ICMP Response Javascript

Connector function ICMP-Response JS API guide

This API allows users to receive response of another ICMP-Request Connector Function. You can process the data as necessary.

Response Object

The response object is the main object of the response, it is the payload.

The object received has the following properties:

  • operationResult: Parent object of the result.
    • version: String. Version of the response message received.
    • trustedboot: Boolean. Trusted boot value.
    • operation: Object with the operation properties:
      • response: Object with the response operation properties:
        • id: String. Request Id of the launched operation.
        • name: String. The name of the launched operation.
        • deviceId: String. Entity identifier that receives the operation.
        • resultCode: String. Result code of the launched operation.
        • resultDescription: String. Result description of the launched operation.
        • additionalDescription: String. Additional result description of the launched operation.
        • path: String. Device usage URL.
        • variables: Array with the device usage variables.
        • entityType: Enum. Type of entity that receives the operation. Possible values: “DEVICE”, “SUBSCRIPTION”, “SUBSCRIBER”, “COMMS_MODULE”
        • steps: Array with the steps of the launched operation.
          • name: String. Result step name.
            • result: String. Result step code.
            • description: String. Result step description
            • response: Json. Json information of the step.
            • timestamp: Number. Timestamp of the step.
        • timestamp: Number. Timestamp of the launched operation.
        • iotData: Collection object with the following properties:
          • version: String. Version of the message IoT received.
          • datastreams: Array with information about the launched operation. (IoT message)
            • id: String. Identifier of the datastream collected.
            • datapoints: Array with the information of the datastream.

Example:

{
  "operationResult": {
    "operation": {
      "response": {
      	"id": "86a52ffe-9f4f-427b-8154-aef7bc2935a0",
      	"name": "REFRESH_PRESENCE",
        "resultCode": "SUCCESSFUL",
      	"resultDescription": "RESULT OK",
      	"additionalDescription": "",
      	"deviceId": "devicedId",
      	"timestamp": 1701288987,
      	"path": [ "/deviceId/request" ],
      	"steps": [{
      	  "name": "Step Name",
        	"result": "Step Result",
        	"description": "Step description",
        	"response": {},
        	"timestamp": 1701288960
      	}],
      	"variables": [ "address", "" ],
      	"replacements": {
      	},
      	"entityType": {
      	  "enum": ["DEVICE", "SUBSCRIPTION", "SUBSCRIBER", "COMMS_MODULE"]
      	},
      	"iotData": {
          "version": "1.0",
          "datastreams":[
            {
              "id":"device.communicationModules[].subscription.address",
              "datapoints":[
                {
                   "value":{
                       "value": "10.10.10.174",
                       "type": "IPV4",
                       "apn": "movistar.es"
                   }
                }
              ]
            }
          ]
        }
      }
    }
  }
}

Catalog API

Connector Functions Catalog API guide

The Connector Functions Catalog API enables users to perform CRUD operations on the Connector Functions Catalog, which comprises a default set of Connector Functions.

A new field, cloneable, has been introduced in this Connector Functions Catalog to indicate whether a Connector Function can be replicated for a specific organization and channel.

Comprehensive API actions

Permissions
  • CREATE, UPDATE, DELETE: users with root profile.
  • GET and GET List: users with admin, admin_domain, super_admin_domain or root profiles.

API specification

Security

OpenGate security

This section describes how access to the OpenGate REST APIs is secured. It covers the two supported authentication mechanisms, JWT and API keys, and the user password reset procedure.

Subsections of Security

Authentication

OpenGate authentication

The OpenGate REST APIs, and device integration mechanisms are enabled by default on all accounts. You don’t have to do anything to turn on these features. However, JWT (JSON Web Token) and API keys are mandatory and are used to control the access to the resources via the REST APIs and connectors.

The OpenGate REST APIs allow third-party applications or back-office systems to communicate with OpenGate. All users in your organization can use third-party applications to access your entity’s data, such as iPhone apps, Android apps, or network-based communication built onto your server. The OpenGate authentication mechanisms ensure the proper access to the information.

Subsections of Authentication

JWT

Authenticating using JWT

What is JWT (JSON Web Token)?

JSON Web Token (JWT) is an open standard RFC 7519 that defines a compact and self-contained way for securely transmitting information between parties as a JSON object. This information can be verified and trusted because it is digitally signed. JWTs can be signed using a secret (with the HMAC algorithm) or a public/private key pair using RSA or ECDSA.

A JWT consists of three strings separated by dots: the header, the payload and the signature as shown in the following text.

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.
eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.
SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Part Name Value
Header eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9
Payload eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ
Signature SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c

Token structure

The header typically consists of two parts: the type of the token, which is JWT, and the signing algorithm being used, such as HMAC SHA256 or RSA.

Payload

The second part of the token is the payload, which contains the claims. Claims are statements about an entity (typically, the user) and additional data. There are three types of claims: registered, public, and private claims.

  • Registered claims: These are a set of predefined claims which are not mandatory but recommended, to provide a set of useful, interoperable claims. Some of them are: iss (issuer), exp (expiration time), sub (subject), aud (audience), and others.
  • Public claims: These can be defined at will by those using JWTs. But to avoid collisions they should be defined in the IANA JSON Web Token Registry or be defined as a URI that contains a collision resistant namespace.
  • Private claims: These are the custom claims created to share information between parties that agree on using them and are neither registered nor public claims.

Signature

To create the signature part you have to take the encoded header, the encoded payload, a secret, the algorithm specified in the header, and sign that.

Obtain a JWT with OpenGate

To obtain a JWT token with OpenGate platform, you should do login with the resource /provision/users/login in the next link JWT.

The JWT (JSON Web Token) can be sent using as a request header.

POST /north/v80/provision/organizations/{organizationId}
Host: [api.opengate.es]
Authorization: Bearer YOUR-JWT-HERE

It is sent using the Authorization HTTP header. An example of POST request may look like this:

curl --request POST \
     --verbose \
     --header "Authorization: Bearer YOUR-JWT-HERE" \
     --header "Content-type: application/json" \
     --data-binary @device.json \
     https://[your_opengate_address]/north/v80/provision/organizations/{organizationId}

API key

Authenticating using API keys

This option can be disabled through configuration in all interfaces, with the exception of those used for device integration. The API keys can be sent using one of the following methods:

  • As a request header
  • As a parameter in the request URL (with the former preferred for security reasons). This option is only available for device integration

Using an HTTP header

This is the recommended method of sending your API key. While it is not secure if sent over an unencrypted connection, it is less likely to be logged as part of the URL:

API Key in HTTP header example:

POST /south/v80/devices/YOUR-DEVICE-ID/collect/dmm
Host: [api.opengate.es]
X-ApiKey: YOUR-API-KEY-HERE

The API key is sent using the X-ApiKey HTTP header. An example of POST request may look like this:

curl --request POST \
     --verbose \
     --header "X-ApiKey: YOUR-API-KEY-HERE" \
     --header "Content-type: application/json" \
     --data-binary @device.json \
     https://api.opengate.es/north/v80/provision/organizations/{organizationName}/devices

As a request parameter

Parameter Name Value
X-ApiKey YOUR_API_KEY_HERE
https://api.opengate.es/south/v80/devices/{device.id}/collect/dmm?X-ApiKey=YOUR-API-KEY-HERE

API key as URL parameter example:

POST /south/v80/devices/{device.id}/collect/dmm?X-ApiKey=YOUR-API-KEY-HERE
Host: [api.opengate.es]

User password reset

Introduction

This API provides a secure procedure to change a user’s password when it has been lost or forgotten. The process has two steps: first, request a password reset for the user’s email, which sends a recovery email with a reset identifier; then, set the new password using that reset identifier.

Usage examples

Request a password reset for a user (the platform generates a token and sends a password recovery email):

curl --request POST \
     https://api.opengate.es/north/v80/provision/users/{userEmail}/reset

Set the new password using the reset identifier received by email:

curl --request POST \
     --header "Content-Type: application/json" \
     --data '{"password": "<new-password>"}' \
     https://api.opengate.es/north/v80/provision/users/{userEmail}/reset/{resetId}

API specification

Catalogs

This section gathers the reference catalogs used across the OpenGate API: the mobile network operators search endpoint, the HTTP response status codes and error messages returned by the API, and the list of supported time zones.

Subsections of Catalogs

Operators

Introduction

Endpoint for operators searching.

Usage examples

Search the operators catalog:

curl --request POST \
     --header "X-ApiKey: <your-api-key>" \
     --header "Content-Type: application/json" \
     https://www.amplia-iiot.com/north/v80/search/catalog/operators

API specification

Response status and error messages

HTTP Status Codes

The OpenGate OSS API attempts to return appropriate HTTP status codes for every request.

Time zones

OpenGate supported time zones

  • ACT
  • AET
  • Africa/Abidjan
  • Africa/Accra
  • Africa/Addis_Ababa
  • Africa/Algiers
  • Africa/Asmara
  • Africa/Asmera
  • Africa/Bamako
  • Africa/Bangui
  • Africa/Banjul
  • Africa/Bissau
  • Africa/Blantyre
  • Africa/Brazzaville
  • Africa/Bujumbura
  • Africa/Cairo
  • Africa/Casablanca
  • Africa/Ceuta
  • Africa/Dar_es_Salaam
  • Africa/Djibouti
  • Africa/Douala
  • Africa/El_Aaiun
  • Africa/Freetown
  • Africa/Gaborone
  • Africa/Harare
  • Africa/Johannesburg
  • Africa/Juba
  • Africa/Kampala
  • Africa/Khartoum
  • Africa/Kigali
  • Africa/Kinshasa
  • Africa/Lagos
  • Africa/Libreville
  • Africa/Lome
  • Africa/Luanda
  • Africa/Lubumbashi
  • Africa/Lusaka
  • Africa/Malabo
  • Africa/Maputo
  • Africa/Maseru
  • Africa/Mbabane
  • Africa/Mogadishu
  • Africa/Monrovia
  • Africa/Nairobi
  • Africa/Ndjamena
  • Africa/Niamey
  • Africa/Nouakchott
  • Africa/Ouagadougou
  • Africa/Porto-Novo
  • Africa/Sao_Tome
  • Africa/Timbuktu
  • Africa/Tripoli
  • Africa/Tunis
  • Africa/Windhoek
  • AGT
  • America/Adak
  • America/Anchorage
  • America/Anguilla
  • America/Antigua
  • America/Araguaina
  • America/Argentina/Buenos_Aires
  • America/Argentina/Catamarca
  • America/Argentina/ComodRivadavia
  • America/Argentina/Cordoba
  • America/Argentina/Jujuy
  • America/Argentina/La_Rioja
  • America/Argentina/Mendoza
  • America/Argentina/Rio_Gallegos
  • America/Argentina/Salta
  • America/Argentina/San_Juan
  • America/Argentina/San_Luis
  • America/Argentina/Tucuman
  • America/Argentina/Ushuaia
  • America/Aruba
  • America/Asuncion
  • America/Atikokan
  • America/Atka
  • America/Bahia
  • America/Bahia_Banderas
  • America/Barbados
  • America/Belem
  • America/Belize
  • America/Blanc-Sablon
  • America/Boa_Vista
  • America/Bogota
  • America/Boise
  • America/Buenos_Aires
  • America/Cambridge_Bay
  • America/Campo_Grande
  • America/Cancun
  • America/Caracas
  • America/Catamarca
  • America/Cayenne
  • America/Cayman
  • America/Chicago
  • America/Chihuahua
  • America/Coral_Harbour
  • America/Cordoba
  • America/Costa_Rica
  • America/Creston
  • America/Cuiaba
  • America/Curacao
  • America/Danmarkshavn
  • America/Dawson
  • America/Dawson_Creek
  • America/Denver
  • America/Detroit
  • America/Dominica
  • America/Edmonton
  • America/Eirunepe
  • America/El_Salvador
  • America/Ensenada
  • America/Fort_Nelson
  • America/Fort_Wayne
  • America/Fortaleza
  • America/Glace_Bay
  • America/Godthab
  • America/Goose_Bay
  • America/Grand_Turk
  • America/Grenada
  • America/Guadeloupe
  • America/Guatemala
  • America/Guayaquil
  • America/Guyana
  • America/Halifax
  • America/Havana
  • America/Hermosillo
  • America/Indiana/Indianapolis
  • America/Indiana/Knox
  • America/Indiana/Marengo
  • America/Indiana/Petersburg
  • America/Indiana/Tell_City
  • America/Indiana/Vevay
  • America/Indiana/Vincennes
  • America/Indiana/Winamac
  • America/Indianapolis
  • America/Inuvik
  • America/Iqaluit
  • America/Jamaica
  • America/Jujuy
  • America/Juneau
  • America/Kentucky/Louisville
  • America/Kentucky/Monticello
  • America/Knox_IN
  • America/Kralendijk
  • America/La_Paz
  • America/Lima
  • America/Los_Angeles
  • America/Louisville
  • America/Lower_Princes
  • America/Maceio
  • America/Managua
  • America/Manaus
  • America/Marigot
  • America/Martinique
  • America/Matamoros
  • America/Mazatlan
  • America/Mendoza
  • America/Menominee
  • America/Merida
  • America/Metlakatla
  • America/Mexico_City
  • America/Miquelon
  • America/Moncton
  • America/Monterrey
  • America/Montevideo
  • America/Montreal
  • America/Montserrat
  • America/Nassau
  • America/New_York
  • America/Nipigon
  • America/Nome
  • America/Noronha
  • America/North_Dakota/Beulah
  • America/North_Dakota/Center
  • America/North_Dakota/New_Salem
  • America/Ojinaga
  • America/Panama
  • America/Pangnirtung
  • America/Paramaribo
  • America/Phoenix
  • America/Port_of_Spain
  • America/Port-au-Prince
  • America/Porto_Acre
  • America/Porto_Velho
  • America/Puerto_Rico
  • America/Rainy_River
  • America/Rankin_Inlet
  • America/Recife
  • America/Regina
  • America/Resolute
  • America/Rio_Branco
  • America/Rosario
  • America/Santa_Isabel
  • America/Santarem
  • America/Santiago
  • America/Santo_Domingo
  • America/Sao_Paulo
  • America/Scoresbysund
  • America/Shiprock
  • America/Sitka
  • America/St_Barthelemy
  • America/St_Johns
  • America/St_Kitts
  • America/St_Lucia
  • America/St_Thomas
  • America/St_Vincent
  • America/Swift_Current
  • America/Tegucigalpa
  • America/Thule
  • America/Thunder_Bay
  • America/Tijuana
  • America/Toronto
  • America/Tortola
  • America/Vancouver
  • America/Virgin
  • America/Whitehorse
  • America/Winnipeg
  • America/Yakutat
  • America/Yellowknife
  • Antarctica/Casey
  • Antarctica/Davis
  • Antarctica/DumontDUrville
  • Antarctica/Macquarie
  • Antarctica/Mawson
  • Antarctica/McMurdo
  • Antarctica/Palmer
  • Antarctica/Rothera
  • Antarctica/South_Pole
  • Antarctica/Syowa
  • Antarctica/Troll
  • Antarctica/Vostok
  • Arctic/Longyearbyen
  • ART
  • Asia/Aden
  • Asia/Almaty
  • Asia/Amman
  • Asia/Anadyr
  • Asia/Aqtau
  • Asia/Aqtobe
  • Asia/Ashgabat
  • Asia/Ashkhabad
  • Asia/Baghdad
  • Asia/Bahrain
  • Asia/Baku
  • Asia/Bangkok
  • Asia/Barnaul
  • Asia/Beirut
  • Asia/Bishkek
  • Asia/Brunei
  • Asia/Calcutta
  • Asia/Chita
  • Asia/Choibalsan
  • Asia/Chongqing
  • Asia/Chungking
  • Asia/Colombo
  • Asia/Dacca
  • Asia/Damascus
  • Asia/Dhaka
  • Asia/Dili
  • Asia/Dubai
  • Asia/Dushanbe
  • Asia/Gaza
  • Asia/Harbin
  • Asia/Hebron
  • Asia/Ho_Chi_Minh
  • Asia/Hong_Kong
  • Asia/Hovd
  • Asia/Irkutsk
  • Asia/Istanbul
  • Asia/Jakarta
  • Asia/Jayapura
  • Asia/Jerusalem
  • Asia/Kabul
  • Asia/Kamchatka
  • Asia/Karachi
  • Asia/Kashgar
  • Asia/Kathmandu
  • Asia/Katmandu
  • Asia/Khandyga
  • Asia/Kolkata
  • Asia/Krasnoyarsk
  • Asia/Kuala_Lumpur
  • Asia/Kuching
  • Asia/Kuwait
  • Asia/Macao
  • Asia/Macau
  • Asia/Magadan
  • Asia/Makassar
  • Asia/Manila
  • Asia/Muscat
  • Asia/Nicosia
  • Asia/Novokuznetsk
  • Asia/Novosibirsk
  • Asia/Omsk
  • Asia/Oral
  • Asia/Phnom_Penh
  • Asia/Pontianak
  • Asia/Pyongyang
  • Asia/Qatar
  • Asia/Qyzylorda
  • Asia/Rangoon
  • Asia/Riyadh
  • Asia/Saigon
  • Asia/Sakhalin
  • Asia/Samarkand
  • Asia/Seoul
  • Asia/Shanghai
  • Asia/Singapore
  • Asia/Srednekolymsk
  • Asia/Taipei
  • Asia/Tashkent
  • Asia/Tbilisi
  • Asia/Tehran
  • Asia/Tel_Aviv
  • Asia/Thimbu
  • Asia/Thimphu
  • Asia/Tokyo
  • Asia/Tomsk
  • Asia/Ujung_Pandang
  • Asia/Ulaanbaatar
  • Asia/Ulan_Bator
  • Asia/Urumqi
  • Asia/Ust-Nera
  • Asia/Vientiane
  • Asia/Vladivostok
  • Asia/Yakutsk
  • Asia/Yekaterinburg
  • Asia/Yerevan
  • AST
  • Atlantic/Azores
  • Atlantic/Bermuda
  • Atlantic/Canary
  • Atlantic/Cape_Verde
  • Atlantic/Faeroe
  • Atlantic/Faroe
  • Atlantic/Jan_Mayen
  • Atlantic/Madeira
  • Atlantic/Reykjavik
  • Atlantic/South_Georgia
  • Atlantic/St_Helena
  • Atlantic/Stanley
  • Australia/ACT
  • Australia/Adelaide
  • Australia/Brisbane
  • Australia/Broken_Hill
  • Australia/Canberra
  • Australia/Currie
  • Australia/Darwin
  • Australia/Eucla
  • Australia/Hobart
  • Australia/LHI
  • Australia/Lindeman
  • Australia/Lord_Howe
  • Australia/Melbourne
  • Australia/North
  • Australia/NSW
  • Australia/Perth
  • Australia/Queensland
  • Australia/South
  • Australia/Sydney
  • Australia/Tasmania
  • Australia/Victoria
  • Australia/West
  • Australia/Yancowinna
  • BET
  • Brazil/Acre
  • Brazil/DeNoronha
  • Brazil/East
  • Brazil/West
  • BST
  • Canada/Atlantic
  • Canada/Central
  • Canada/East-Saskatchewan
  • Canada/Eastern
  • Canada/Mountain
  • Canada/Newfoundland
  • Canada/Pacific
  • Canada/Saskatchewan
  • Canada/Yukon
  • CAT
  • CET
  • Chile/Continental
  • Chile/EasterIsland
  • CNT
  • CST
  • CST6CDT
  • CTT
  • Cuba
  • EAT
  • ECT
  • EET
  • Egypt
  • Eire
  • EST
  • EST5EDT
  • Etc/GMT
  • Etc/GMT-0
  • Etc/GMT-1
  • Etc/GMT-10
  • Etc/GMT-11
  • Etc/GMT-12
  • Etc/GMT-13
  • Etc/GMT-14
  • Etc/GMT-2
  • Etc/GMT-3
  • Etc/GMT-4
  • Etc/GMT-5
  • Etc/GMT-6
  • Etc/GMT-7
  • Etc/GMT-8
  • Etc/GMT-9
  • Etc/GMT+0
  • Etc/GMT+1
  • Etc/GMT+10
  • Etc/GMT+11
  • Etc/GMT+12
  • Etc/GMT+2
  • Etc/GMT+3
  • Etc/GMT+4
  • Etc/GMT+5
  • Etc/GMT+6
  • Etc/GMT+7
  • Etc/GMT+8
  • Etc/GMT+9
  • Etc/GMT0
  • Etc/Greenwich
  • Etc/UCT
  • Etc/Universal
  • Etc/UTC
  • Etc/Zulu
  • Europe/Amsterdam
  • Europe/Andorra
  • Europe/Astrakhan
  • Europe/Athens
  • Europe/Belfast
  • Europe/Belgrade
  • Europe/Berlin
  • Europe/Bratislava
  • Europe/Brussels
  • Europe/Bucharest
  • Europe/Budapest
  • Europe/Busingen
  • Europe/Chisinau
  • Europe/Copenhagen
  • Europe/Dublin
  • Europe/Gibraltar
  • Europe/Guernsey
  • Europe/Helsinki
  • Europe/Isle_of_Man
  • Europe/Istanbul
  • Europe/Jersey
  • Europe/Kaliningrad
  • Europe/Kiev
  • Europe/Kirov
  • Europe/Lisbon
  • Europe/Ljubljana
  • Europe/London
  • Europe/Luxembourg
  • Europe/Madrid
  • Europe/Malta
  • Europe/Mariehamn
  • Europe/Minsk
  • Europe/Monaco
  • Europe/Moscow
  • Europe/Nicosia
  • Europe/Oslo
  • Europe/Paris
  • Europe/Podgorica
  • Europe/Prague
  • Europe/Riga
  • Europe/Rome
  • Europe/Samara
  • Europe/San_Marino
  • Europe/Sarajevo
  • Europe/Simferopol
  • Europe/Skopje
  • Europe/Sofia
  • Europe/Stockholm
  • Europe/Tallinn
  • Europe/Tirane
  • Europe/Tiraspol
  • Europe/Ulyanovsk
  • Europe/Uzhgorod
  • Europe/Vaduz
  • Europe/Vatican
  • Europe/Vienna
  • Europe/Vilnius
  • Europe/Volgograd
  • Europe/Warsaw
  • Europe/Zagreb
  • Europe/Zaporozhye
  • Europe/Zurich
  • GB
  • GB-Eire
  • GMT
  • GMT0
  • Greenwich
  • Hongkong
  • HST
  • Iceland
  • IET
  • Indian/Antananarivo
  • Indian/Chagos
  • Indian/Christmas
  • Indian/Cocos
  • Indian/Comoro
  • Indian/Kerguelen
  • Indian/Mahe
  • Indian/Maldives
  • Indian/Mauritius
  • Indian/Mayotte
  • Indian/Reunion
  • Iran
  • Israel
  • IST
  • Jamaica
  • Japan
  • JST
  • Kwajalein
  • Libya
  • MET
  • Mexico/BajaNorte
  • Mexico/BajaSur
  • Mexico/General
  • MIT
  • MST
  • MST7MDT
  • Navajo
  • NET
  • NST
  • NZ
  • NZ-CHAT
  • Pacific/Apia
  • Pacific/Auckland
  • Pacific/Bougainville
  • Pacific/Chatham
  • Pacific/Chuuk
  • Pacific/Easter
  • Pacific/Efate
  • Pacific/Enderbury
  • Pacific/Fakaofo
  • Pacific/Fiji
  • Pacific/Funafuti
  • Pacific/Galapagos
  • Pacific/Gambier
  • Pacific/Guadalcanal
  • Pacific/Guam
  • Pacific/Honolulu
  • Pacific/Johnston
  • Pacific/Kiritimati
  • Pacific/Kosrae
  • Pacific/Kwajalein
  • Pacific/Majuro
  • Pacific/Marquesas
  • Pacific/Midway
  • Pacific/Nauru
  • Pacific/Niue
  • Pacific/Norfolk
  • Pacific/Noumea
  • Pacific/Pago_Pago
  • Pacific/Palau
  • Pacific/Pitcairn
  • Pacific/Pohnpei
  • Pacific/Ponape
  • Pacific/Port_Moresby
  • Pacific/Rarotonga
  • Pacific/Saipan
  • Pacific/Samoa
  • Pacific/Tahiti
  • Pacific/Tarawa
  • Pacific/Tongatapu
  • Pacific/Truk
  • Pacific/Wake
  • Pacific/Wallis
  • Pacific/Yap
  • PLT
  • PNT
  • Poland
  • Portugal
  • PRC
  • PRT
  • PST
  • PST8PDT
  • ROK
  • Singapore
  • SST
  • SystemV/AST4
  • SystemV/AST4ADT
  • SystemV/CST6
  • SystemV/CST6CDT
  • SystemV/EST5
  • SystemV/EST5EDT
  • SystemV/HST10
  • SystemV/MST7
  • SystemV/MST7MDT
  • SystemV/PST8
  • SystemV/PST8PDT
  • SystemV/YST9
  • SystemV/YST9YDT
  • Turkey
  • UCT
  • Universal
  • US/Alaska
  • US/Aleutian
  • US/Arizona
  • US/Central
  • US/East-Indiana
  • US/Eastern
  • US/Hawaii
  • US/Indiana-Starke
  • US/Michigan
  • US/Mountain
  • US/Pacific
  • US/Pacific-New
  • US/Samoa
  • UTC
  • VST
  • W-SU
  • WET
  • Zulu