system.mes.meter.getMeterConfigurationsForEquipmentPath
Description
Retrieves all Meter Configuration records for the equipment at the specified path and every equipment beneath it - a path-prefix (subtree) match.
This differs from getMeterConfigurationsForEquipment, which returns the configurations of a single equipment. Use this method when you want the configurations for an entire branch of the equipment hierarchy (for example, every meter configured anywhere under a site or line).
The path is matched as a literal prefix on whole path segments, so Enterprise/Site/Line1 matches Enterprise/Site/Line1 and any descendant such as Enterprise/Site/Line1/Pump1, but not Enterprise/Site/Line10. Any * or % characters in the supplied path are ignored.
Permissions
This method requires the METERING.READ.GET permission.
Syntax
system.mes.meter.getMeterConfigurationsForEquipmentPath(path, [includeDisabled])
Parameters
| Parameter | Type | Nullable | Description |
|---|---|---|---|
path | String | False | The equipment path. Configurations for the equipment at this path and all of its descendants are returned. |
includeDisabled | Boolean | True | Optional. When True, soft-deleted (disabled) Meter Configurations are also returned. When False (the default), only enabled configurations are returned. |
Returns
Returns a list of JSON objects representing all Meter Configurations for the equipment subtree. Each object in the list has the following properties:
| 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. |
maxTimeBetweenExecutionsSeconds | Integer | Maximum seconds between data collection executions. |
maxFlushIntervalSeconds | Integer | Maximum seconds between database flush operations. |
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. |
costExpression | String | Ignition expression returning cost per unit. |
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 every enabled Meter Configuration under a site, across all equipment beneath the path
meterConfigs = system.mes.meter.getMeterConfigurationsForEquipmentPath('Enterprise/Site')
# Output the list of Meter Configurations
print(meterConfigs)
# Include soft-deleted (disabled) configurations as well
allMeterConfigs = system.mes.meter.getMeterConfigurationsForEquipmentPath('Enterprise/Site', includeDisabled=True)
print(allMeterConfigs)