Skip to main content
Version: V2 (Ignition 8.1)

system.mes.meter.setMeterRecordNotesAndSpares

Description

Updates the notes and spare fields of a Meter Record without modifying usage or cost data. This is the safe way to add annotations to a Meter Record while preserving the integrity of metering data.

Permissions

This method requires the METERING.WRITE.SAVE permission.

Syntax

system.mes.meter.setMeterRecordNotesAndSpares(id=id, notes=notes, spare1=spare1, spare2=spare2, spare3=spare3)

Parameters

ParameterTypeNullableDescription
idString (ULID)FalseThe ID of the Meter Record to update.
notesStringTrueNotes to set on the Meter Record.
spare1StringTrueValue to set in the spare1 field.
spare2StringTrueValue to set in the spare2 field.
spare3StringTrueValue to set in the spare3 field.

Returns

Returns a JSON representation of the updated Meter Record. The object has the same properties as those returned by getMeterRecord.

Code Examples

# Add a note to a Meter Record
updatedRecord = system.mes.meter.setMeterRecordNotesAndSpares(
id='01J9YP3JBR-WQ8GWRR2-8Y879V2G',
notes='Maintenance window - compressor replaced',
spare1='WO-12345'
)

# Output the updated Meter Record
print(updatedRecord)