Skip to main content
Version: V2 (Ignition 8.1)

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:

ParameterTypeNullableDescription
idString (ULID)FalseThe ID of the Meter Configuration to retrieve.

By Equipment and Name:

ParameterTypeNullableDescription
equipmentIdOrPathStringFalseThe ID or path of the equipment.
nameStringFalseThe name of the Meter Configuration.

Returns

Returns a JSON representation of the Meter Configuration. Returns nothing if no Meter Configuration is found.

NameTypeDescription
idString (ULID)The ULID of the Meter Configuration.
nameStringDisplay name for this meter configuration.
descriptionStringOptional description.
equipmentIdString (ULID)The ULID of the equipment this configuration is attached to.
equipmentPathStringPath of the associated equipment.
locationPathStringPath of the equipment's location.
maxRecordDurationSecondsIntegerMaximum record duration in seconds. Minimum value: 30.
maxTimeBetweenExecutionsSecondsIntegerMaximum seconds between data collection executions. Minimum value: 1.
maxFlushIntervalSecondsIntegerMaximum seconds between database flush operations. Minimum value: 10.
pruneDaysIntegerNumber of days to retain completed records before pruning.
meterTypeIdString (ULID)The ULID of the Meter Type being measured.
meterTypeNameStringName of the associated Meter Type.
usageExpressionStringIgnition expression returning the current usage counter value.
overflowValueDoubleMaximum counter value before rollover. Null means no rollover.
costSourceStringSource for cost calculation. One of: STATIC, FROM_METER_TYPE, EXPRESSION.
costDoubleStatic cost per unit of measure (used when costSource is STATIC).
costExpressionStringIgnition expression returning cost per unit (used when costSource is EXPRESSION).
usageUnitOfMeasureIdString (ULID)The ULID of the unit of measure for usage values.
usageUnitOfMeasureNameStringDisplay name of the usage unit of measure.
usageUnitOfMeasureSymbolStringSymbol of the usage unit of measure.
costUnitOfMeasureIdString (ULID)The ULID of the unit of measure for cost values.
costUnitOfMeasureNameStringDisplay name of the cost unit of measure.
costUnitOfMeasureSymbolStringSymbol of the cost unit of measure.
notesStringNotes related to the meter configuration.
enabledBooleanIndicates if the meter configuration is active and enabled.
spare1StringAdditional field for user-defined context.
spare2StringAdditional field for user-defined context.
spare3StringAdditional 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)