Skip to main content
Version: V2 (Ignition 8.1)

system.mes.meter.splitMeterRecord

Description

Splits a Meter Record at a specified date. The original record is closed at the split date and a new record is created starting from that date, carrying forward the same equipment, meter type, and configuration.

Permissions

This method requires the METERING.WRITE.SAVE permission.

Syntax

system.mes.meter.splitMeterRecord(meterRecordId, splitDate)

Parameters

ParameterTypeNullableDescription
meterRecordIdString (ULID)FalseThe ID of the Meter Record to split.
splitDateDateFalseThe date and time at which to split the Meter Record.

Returns

Returns a JSON list of two Meter Records. Both records have the same properties as those returned by getMeterRecord.

IndexDescription
[0]The original record, closed (COMPLETED) at the split date with proportionally allocated usage and cost.
[1]The new record starting from the split date, inheriting the remaining usage and cost.

Code Examples

# Split a running Meter Record 4 hours ago
splitDate = system.date.addHours(system.date.now(), -4)
records = system.mes.meter.splitMeterRecord('01J9YP3JBR-WQ8GWRR2-8Y879V2G', splitDate)

closedRecord = records[0] # Original record, now closed at the split date
newRecord = records[1] # New record starting from the split date
print(newRecord)