Skip to main content
Version: V3 (Ignition 8.3)

system.mes.meter.validateMeterConfiguration

Description

Validates the specified parameters for a Meter Configuration record and returns any validation errors. This only checks if the Meter Configuration object can be saved based on the attributes given. It does not persist the record.

Permissions

This method requires the METERING.READ.VALIDATE permission.

Syntax

system.mes.meter.validateMeterConfiguration(**meterConfigData)

Parameters

ParameterTypeNullableDescription
idString (ULID)TrueThe ULID of the Meter Configuration (optional, for validating an update).
nameStringFalseDisplay name for this meter configuration.
descriptionStringTrueOptional description.
equipmentIdString (ULID)FalseThe ULID of the equipment this configuration is attached to.
maxRecordDurationSecondsIntegerFalseMaximum record duration in seconds. Minimum value: 30.
maxTimeBetweenExecutionsSecondsIntegerFalseMaximum seconds between data collection executions. Minimum value: 1.
maxFlushIntervalSecondsIntegerTrueMaximum seconds between database flush operations. Minimum value: 10.
pruneDaysIntegerTrueNumber of days to retain completed records before pruning.
meterTypeIdString (ULID)FalseThe ULID of the Meter Type being measured.
usageExpressionStringFalseIgnition expression returning the current usage counter value.
overflowValueDoubleTrueMaximum counter value before rollover.
costSourceStringFalseSource for cost calculation. One of: STATIC, FROM_METER_TYPE, EXPRESSION.
costDoubleTrueStatic cost per unit of measure.
costExpressionStringTrueIgnition expression returning cost per unit.
costUnitOfMeasureIdString (ULID)TrueThe ULID of the unit of measure for cost values.
notesStringTrueNotes related to the meter configuration.
enabledBooleanTrueIndicates if the meter configuration is active and enabled.
spare1StringTrueAdditional field for user-defined context.
spare2StringTrueAdditional field for user-defined context.
spare3StringTrueAdditional field for user-defined context.

Returns

Returns a JSON object where keys are field names and values are lists of validation violation messages. An empty object indicates no violations.

Code Examples

# Validate a Meter Configuration before saving
meterConfigData = system.mes.meter.newMeterConfiguration()
meterConfigData['name'] = 'Main Panel kWh'
meterConfigData['equipmentId'] = '01J9YP3JBR-WQ8GWRR2-8Y879V2D'
meterConfigData['meterTypeId'] = '01J9YP3JBR-WQ8GWRR2-8Y879V2E'
meterConfigData['usageExpression'] = '[.]Energy_kWh'
meterConfigData['costSource'] = 'FROM_METER_TYPE'

violations = system.mes.meter.validateMeterConfiguration(**meterConfigData)

# Output any validation violations
print(violations)