Meter Record
Overview
The MeterRecord entity is a historical record of utility usage for a specific meter type, equipment, and location over a period of time. Records are created automatically by the data collection engine while a meter configuration is active. The engine reads the usage counter expression on each execution cycle, detects state changes (such as a counter rollover or record cutover), and commits completed records to the database. Each record captures the time period, accumulated usage, computed cost, and status of the measurement run.
Table Structure
The following table outlines the SQL columns for the meter_records table, providing a brief description of each.
| Column | Type | Description | Example |
|---|---|---|---|
id | String (ULID) | Unique identifier for the entity. | 01JAP8RJBN-8ZTPXSGY-J9GSDPE1 |
enabled | Boolean | If the entity is enabled or not. | true |
created_date | DateTime | Date the entity was created. | 2024-12-31T19:48:44Z |
created_by | String | Person who created the entity. | TamakiMES |
modified_date | DateTime | Date the entity was modified. Value is null upon creation, and gets initially populated upon the first edit. | 2024-12-31T19:48:44Z |
modified_by | String | Last person to modify the entity. Value is null upon creation, and gets initially populated upon the first edit. | TamakiMES |
notes | String | Notes about the entity. | This entity has these extra notes |
spare1 | String | The first spare column that can be used for additional context on the entity. | some extra context 1 |
spare2 | String | The second spare column that can be used for additional context on the entity. | some extra context 2 |
spare3 | String | The third spare column that can be used for additional context on the entity. | some extra context 3 |
name | String | Name of the meter record. Required. | Conveyor Water Meter Run 1 |
description | String | Optional description of the meter record. | Water usage on conveyor line 1 |
location_id | String (ULID) | References the location where the equipment was stationed at record creation. Optional. See locations. | 01JAP8RJBN-4VYZUKE1-LY2QHV8X |
equipment_id | String (ULID) | References the equipment this meter record is for. Required. See equipment. | 01JAP8R5RT-3FPXQABY-7KQZT6VF |
meter_type_id | String (ULID) | References the meter type being tracked by this record. Required. See meter_types. | 01JAP8RJBN-8ZTPXSGY-J9GSDPE1 |
status | String (Enum) | Current status of the meter record. Required. | RUNNING |
start_date | DateTime | Start date and time of the record. Required. | 2025-12-09T19:48:44Z |
end_date | DateTime | End date and time of the record. Null while the record is running; set on transition to a terminal status. | 2025-12-09T20:24:44Z |
total_duration_sec | Double | Total duration of the record in seconds. Required. Defaults to 0.0. | 2160.0 |
usage_value | Double | Total usage accumulated during the record period, in the meter type's usage unit of measure. Required. Defaults to 0.0. | 36.054 |
cost | Double | Total cost accumulated during the record period, computed as usage multiplied by the cost per unit. Required. Defaults to 0.0. | 13.7 |
usage_unit_of_measure_id | String (ULID) | References the unit of measure for the usage value. Required. See unit_of_measures. | 02K4M9QY3F-7XW8A2ZL-QM9D6B1P |
cost_unit_of_measure_id | String (ULID) | References the unit of measure for the cost value. Required. See unit_of_measures. | 02K4M9QY3F-7XW8A2ZL-QM9D6B1P |
to_be_pruned | Boolean | When true, the record is scheduled for pruning and will be permanently deleted during the next maintenance window. Defaults to false. | false |
Field Details
location_id
References the Location where the equipment was stationed at the time this record was created. Set from the equipment's location at record creation and does not change if the equipment is later moved. Optional. See locations for details.
status
The current status of the meter record. Possible values are IDLE, RUNNING, COMPLETED, FAULTED, CANCELLED, UNKNOWN, and PAUSED. A record is typically RUNNING while actively being updated by the engine, COMPLETED once a cutover occurs, FAULTED if an error occurred during measurement, and CANCELLED if it was cancelled before completion.
usage_value
The total usage accumulated during this record period, in the unit of measure defined by the meter type. Computed by the data collection engine as the sum of usage deltas across all measurement cycles. The column is named usage_value (not usage) to avoid the MySQL/MariaDB reserved keyword. Required, and defaults to 0.0.
cost
The total cost accumulated during this record period, computed as usage_value multiplied by the cost per unit. Required, and defaults to 0.0.
to_be_pruned
When true, this record has been scheduled for pruning and will be permanently deleted during the next nightly maintenance window. Defaults to false.