Skip to main content
Version: V3 (Ignition 8.3)

Meter API

Welcome to the Meter API documentation. This API provides a comprehensive set of functions for managing and interacting with metering data within the system. Below is a list of available functions, each with a brief description and a link to its detailed documentation.

Meter Type Functions

newMeterType

Generates an empty non-persisted Meter Type object to provide the structure required by the API to save a new record into the database. This method must be combined with the saveMeterType method in order to persist the record. Returns a JSON representation of the newly created Meter Type object.

getMeterType

Retrieves a Meter Type record by its ID or name. Returns a JSON representation of the Meter Type. Returns nothing if no Meter Type is found.

getAllMeterTypes

Retrieves a list of all Meter Type records in the system. Returns a list of JSON objects representing all Meter Types.

findMeterTypes

Retrieves Meter Type records based on the specified pagination, sort, and column constraint parameters. Returns a Query Result object.

saveMeterType

Creates or updates a Meter Type record in the system based on the provided parameters. Returns a JSON representation of the saved Meter Type.

validateMeterType

Validates the specified parameters for a Meter Type record and returns any validation errors. Returns a JSON object where keys are field names and values are lists of validation violation messages.

deleteMeterType

Deletes a Meter Type record by its ID or name. This cannot delete a Meter Type that is referenced by a Meter Configuration. If successful, an ApiResponse object is returned with the success bool set to True.

deleteMeterTypes

Deletes multiple Meter Type records by the given IDs or names. This cannot delete any Meter Types with references to them. If successful, an ApiResponse object is returned with the success bool set to True.

getMeterTypeReferences

Retrieves a list of entities that reference a Meter Type record, preventing deletion. Returns a JSON object of referencing entities.

importMeterTypesFromCsv

Imports Meter Type records from a CSV file. Returns a JSON representation of the import response.

importMeterTypesFromJson

Imports Meter Type records from a JSON file. Returns a JSON representation of the import response.

exportMeterTypesAsJson

Exports all Meter Types as JSON, or specific ones by IDs or names. Returns the JSON export as bytes.

exportMeterTypesAsCsv

Exports all Meter Types as CSV, or specific ones by IDs or names. Returns the CSV export as bytes.

getMeterTypeImportQueueSize

Gets the current size of the Meter Type import queue. Returns an integer indicating the number of items pending import.

cancelMeterTypeImportQueue

Cancels all pending Meter Type imports. No response is returned.

Meter Configuration Functions

newMeterConfiguration

Generates an empty non-persisted Meter Configuration object to provide the structure required by the API to save a new record into the database. This method must be combined with the saveMeterConfiguration method in order to persist the record. Returns a JSON representation of the newly created Meter Configuration object.

getMeterConfiguration

Retrieves a Meter Configuration record by its ID, or by its equipment ID/path and name. Returns a JSON representation of the Meter Configuration. Returns nothing if no Meter Configuration is found.

getMeterConfigurationsForEquipment

Retrieves all Meter Configuration records for a specific piece of equipment. Returns a list of JSON objects representing the Meter Configurations.

getMeterConfigurationsForEquipmentPath

Retrieves all Meter Configuration records for the equipment at a path and every equipment beneath it (a path-prefix/subtree match). Returns a list of JSON objects representing the Meter Configurations.

getAllMeterConfigurations

Retrieves a list of all Meter Configuration records in the system. Returns a list of JSON objects representing all Meter Configurations.

findMeterConfigurations

Retrieves Meter Configuration records based on the specified pagination, sort, and column constraint parameters. Returns a Query Result object.

saveMeterConfiguration

Creates or updates a Meter Configuration record in the system based on the provided parameters. Returns a JSON representation of the saved Meter Configuration.

validateMeterConfiguration

Validates the specified parameters for a Meter Configuration record and returns any validation errors. Returns a JSON object where keys are field names and values are lists of validation violation messages.

deleteMeterConfiguration

Deletes a Meter Configuration record by its ID, or by its equipment ID and name. If successful, an ApiResponse object is returned with the success bool set to True.

deleteMeterConfigurations

Deletes multiple Meter Configuration records by the given IDs. If successful, an ApiResponse object is returned with the success bool set to True.

getMeterConfigurationReferences

Retrieves a list of entities that reference a Meter Configuration record, preventing deletion. Returns a JSON object of referencing entities.

importMeterConfigurationsFromCsv

Imports Meter Configuration records from a CSV file. Returns a JSON representation of the import response.

importMeterConfigurationsFromJson

Imports Meter Configuration records from a JSON file. Returns a JSON representation of the import response.

exportMeterConfigurationsAsJson

Exports all Meter Configurations as JSON, or specific ones by IDs. Returns the JSON export as bytes.

exportMeterConfigurationsAsCsv

Exports all Meter Configurations as CSV, or specific ones by IDs. Returns the CSV export as bytes.

getMeterConfigurationImportQueueSize

Gets the current size of the Meter Configuration import queue. Returns an integer indicating the number of items pending import.

cancelMeterConfigurationImportQueue

Cancels all pending Meter Configuration imports. No response is returned.

Meter Record Functions

getMeterRecord

Retrieves a Meter Record by its ID. Returns a JSON representation of the Meter Record. Returns nothing if no Meter Record is found.

getMeterRecords

Retrieves Meter Records within a date range with optional filters. Returns a list of JSON objects representing the matching Meter Records.

findMeterRecords

Retrieves Meter Record records based on the specified pagination, sort, and column constraint parameters. Returns a Query Result object.

splitMeterRecord

Splits a Meter Record at a specified date, closing the original record and creating a new record for the remainder. Returns a JSON representation of the newly created Meter Record.

scheduleMeterRecordPruning

Schedules Meter Records for pruning by setting their toBePruned flag. Matching records are permanently deleted during the next nightly maintenance window.

unscheduleMeterRecordPruning

Cancels all scheduled Meter Record pruning by clearing the toBePruned flag on all Meter Records.

setMeterRecordNotesAndSpares

Updates the notes and spare fields of a Meter Record without modifying usage or cost data. Returns a JSON representation of the updated Meter Record.

Calculation Functions

calculateMeterSummary

Calculates a comprehensive meter summary of usage and cost within a date range with optional filters and unit conversions. Returns aggregated totals, rates, and peak and minimum values for the period.

calculateMeterSummaryByTimeInterval

Calculates meter summaries bucketed by a specified time interval within a date range with optional filters. Returns a list of summary objects, one per interval bucket.

Engine State Functions

flushMeterDataStateToDB

Flushes all in-memory meter data collection state to the database immediately. No response is returned.

reloadMeterStateFromDB

Reloads meter data collection state from the database, discarding any in-memory changes. No response is returned.

Permission Functions

getMeteringPermissions

Gets all permission strings available in the metering module. Returns a list of permission strings.

Enum Functions

getMeterCostSourceEnum

Returns the values of the MeterCostSource enum, which defines how the cost per unit of measure is determined for a Meter Configuration. Returns a list of MeterCostSource enum values.


Explore each function's documentation for detailed usage examples and additional information.