Meter Configuration
Overview
The MeterConfiguration entity defines how the data collection engine monitors and records utility usage for a specific piece of equipment. Each configuration references a meter type, an Ignition expression that returns the current usage counter value, and parameters that control how frequently records are created, flushed to the database, and pruned. Cost can be sourced statically, inherited from the meter type, or evaluated from an expression.
Table Structure
The following table outlines the SQL columns for the meter_configurations 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 configuration. Required and unique within the equipment (uk_meter_configuration_equipment_name). Defaults to the meter type name. | Conveyor Water Meter |
description | String | Optional description of the meter configuration. | Water usage on conveyor line 1 |
equipment_id | String (ULID) | References the equipment this configuration is attached to. Required. See equipment. | 01JAP8R5RT-3FPXQABY-7KQZT6VF |
max_record_duration_seconds | Integer | Maximum record duration. Controls how often the engine cuts over to a new meter record. Required. Defaults to 600. | 600 |
max_time_between_executions_seconds | Integer | Maximum number of seconds between data collection executions. Required. Defaults to 5. | 5 |
max_flush_interval_seconds | Integer | Maximum number of seconds between flush operations to the database. Optional. Defaults to 30. | 30 |
prune_days | Integer | Number of days to retain completed records. Optional; null retains records indefinitely. | 10 |
meter_type_id | String (ULID) | References the meter type this configuration measures. Required. See meter_types. | 01JAP8RJBN-4VYZUKE1-LY2QHV8X |
usage_expression | String | Ignition expression that returns the current usage counter value. Required. | {[provider]Meters/Water/Counter} |
overflow_value | Double | Maximum counter value before the counter rolls over to zero. Optional; null means the counter does not overflow. | 9999.0 |
cost_source | String (Enum) | Source used to determine the cost per unit: STATIC, FROM_METER_TYPE, or EXPRESSION. Required. Defaults to STATIC. | STATIC |
cost | Double | Static cost per unit of measure. Used when cost_source is STATIC. Optional. | 0.38 |
cost_expression | String | Ignition expression that returns the cost per unit. Used when cost_source is EXPRESSION. Optional. | {[provider]Meters/Water/Rate} |
cost_unit_of_measure_id | String (ULID) | References the unit of measure for cost values. Required. See unit_of_measures. | 02K4M9QY3F-7XW8A2ZL-QM9D6B1P |
Field Details
name
The name of the meter configuration. Required and must be unique within the associated equipment. Defaults to the name of the associated meter type when not explicitly provided.
equipment_id
References the Equipment that this configuration is attached to. Required. See equipment for details.
max_record_duration_seconds
Maximum record duration. Controls how often the data collection engine cuts over to a new meter record. Required, defaults to 600, and must be at least 30 seconds.
max_time_between_executions_seconds
Maximum number of seconds between data collection executions. Controls how frequently the engine reads the usage counter expression. Required, defaults to 5, and must be at least 1 second.
max_flush_interval_seconds
Maximum number of seconds between flush operations to the database. When null, the engine only flushes on record cutover or explicit request. Optional, defaults to 30, and when set must be at least 10 seconds.
prune_days
Number of days to retain completed meter records. Records older than this threshold are pruned by the pruning service. When null, records are retained indefinitely. Must be greater than 0.
usage_expression
The Ignition expression that returns the current usage counter value. The engine reads this expression on each execution cycle and computes the delta since the last reading. Required.
overflow_value
The maximum value the usage counter reaches before it rolls over to zero. When specified, the data collection engine detects a rollover event (when the new counter reading is less than the previous reading) and computes the usage delta as (overflow_value - previous_value) + new_value. If null, the counter is assumed to increase indefinitely and rollovers are not handled.
cost_source
The source used to determine the cost per unit for meter records created by this configuration:
STATIC- a fixedcostvalue stored on this configuration.FROM_METER_TYPE- the cost is inherited from the associated meter type.EXPRESSION- cost is evaluated at runtime viacost_expression.
Required, and defaults to STATIC.
cost
Static cost per unit of measure. Used when cost_source is STATIC. May be null for other cost sources.
cost_expression
Ignition expression that returns the cost per unit. Used when cost_source is EXPRESSION. May be null for other cost sources.
cost_unit_of_measure_id
References the UnitOfMeasure for cost values (e.g. USD). Required.