system.mes.meter.getMeterRecord
Description
Retrieves a Meter Record by its ID.
Permissions
This method requires the METERING.READ.GET permission.
Syntax
system.mes.meter.getMeterRecord(id)
Parameters
| Parameter | Type | Nullable | Description |
|---|---|---|---|
id | String (ULID) | False | The ID of the Meter Record to retrieve. |
Returns
Returns a JSON representation of the Meter Record. Returns nothing if no Meter Record is found.
| Name | Type | Description |
|---|---|---|
id | String (ULID) | The ULID of the Meter Record. |
name | String | Display name of the Meter Record. |
description | String | Optional description. |
equipmentId | String (ULID) | The ULID of the equipment this record belongs to. |
equipmentPath | String | Path of the associated equipment. |
locationId | String (ULID) | The ULID of the location where the equipment is stationed. |
locationPath | String | Path of the associated location. |
meterTypeId | String (ULID) | The ULID of the Meter Type being tracked. |
meterTypeName | String | Name of the Meter Type. |
status | String | Status of this record. One of: RUNNING, COMPLETED, FAULTED, CANCELLED, IDLE. |
startDate | Instant | Start date and time of this record. |
endDate | Instant | End date and time of this record. Null if the record is still running. |
totalDurationSec | Double | Total duration of this record in seconds. |
usage | Double | Total usage accumulated during this record period. |
cost | Double | Total cost accumulated during this record period. |
usageUnitOfMeasureId | String (ULID) | The ULID of the unit of measure for usage. |
usageUnitOfMeasureName | String | Display name of the usage unit of measure. |
usageUnitOfMeasureSymbol | String | Symbol of the usage unit of measure. |
costUnitOfMeasureId | String (ULID) | The ULID of the unit of measure for cost. |
costUnitOfMeasureName | String | Display name of the cost unit of measure. |
costUnitOfMeasureSymbol | String | Symbol of the cost unit of measure. |
notes | String | Notes related to the meter record. |
enabled | Boolean | Indicates if the meter record is active and enabled. |
spare1 | String | Additional field for user-defined context. |
spare2 | String | Additional field for user-defined context. |
spare3 | String | Additional field for user-defined context. |
Code Examples
# Retrieve a Meter Record by ID
meterRecord = system.mes.meter.getMeterRecord('01J9YP3JBR-WQ8GWRR2-8Y879V2G')
# Output the Meter Record
print(meterRecord)