system.mes.meter.getMeterConfiguration
Description
By ID:
Retrieves a Meter Configuration record by its ID.
By Equipment and Name:
Retrieves a Meter Configuration record by the equipment ID or path and the configuration name.
Permissions
This method requires the METERING.READ.GET permission.
Syntax
system.mes.meter.getMeterConfiguration(id)
system.mes.meter.getMeterConfiguration(equipmentIdOrPath, name)
Parameters
By ID:
| Parameter | Type | Nullable | Description |
|---|---|---|---|
id | String (ULID) | False | The ID of the Meter Configuration to retrieve. |
By Equipment and Name:
| Parameter | Type | Nullable | Description |
|---|---|---|---|
equipmentIdOrPath | String | False | The ID or path of the equipment. |
name | String | False | The name of the Meter Configuration. |
Returns
Returns a JSON representation of the Meter Configuration. Returns nothing if no Meter Configuration is found.
| Name | Type | Description |
|---|---|---|
id | String (ULID) | The ULID of the Meter Configuration. |
name | String | Display name for this meter configuration. |
description | String | Optional description. |
equipmentId | String (ULID) | The ULID of the equipment this configuration is attached to. |
equipmentPath | String | Path of the associated equipment. |
locationPath | String | Path of the equipment's location. |
maxRecordDurationSeconds | Integer | Maximum record duration in seconds. Minimum value: 30. |
maxTimeBetweenExecutionsSeconds | Integer | Maximum seconds between data collection executions. Minimum value: 1. |
maxFlushIntervalSeconds | Integer | Maximum seconds between database flush operations. Minimum value: 10. |
pruneDays | Integer | Number of days to retain completed records before pruning. |
meterTypeId | String (ULID) | The ULID of the Meter Type being measured. |
meterTypeName | String | Name of the associated Meter Type. |
usageExpression | String | Ignition expression returning the current usage counter value. |
overflowValue | Double | Maximum counter value before rollover. Null means no rollover. |
costSource | String | Source for cost calculation. One of: STATIC, FROM_METER_TYPE, EXPRESSION. |
cost | Double | Static cost per unit of measure (used when costSource is STATIC). |
costExpression | String | Ignition expression returning cost per unit (used when costSource is EXPRESSION). |
usageUnitOfMeasureId | String (ULID) | The ULID of the unit of measure for usage values. |
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 values. |
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 configuration. |
enabled | Boolean | Indicates if the meter configuration 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 Configuration by ID
meterConfig = system.mes.meter.getMeterConfiguration('01J9YP3JBR-WQ8GWRR2-8Y879V2F')
print(meterConfig)
# Retrieve a Meter Configuration by equipment path and name
meterConfig = system.mes.meter.getMeterConfiguration('Enterprise/Site/Line1', 'Main Panel kWh')
print(meterConfig)