Skip to main content
Version: Latest

Flux Domain Model

The Flux platform manages real-time battery control and energy trading through a set of core domain entities. This section describes the key concepts and their relationships.

Entity Relationship Diagram

Core Entities

Devices (mg_device_registry)

Represents physical equipment connected to the Flux platform:

FieldTypeDescription
idUUIDUnique identifier
nameStringHuman-readable device name
typeStringDevice type (bess, meter)
siteStringSite identifier (WLCE, HMCE, LFCE)
metadataJSONAdditional configuration

Device Types:

  • BESS: Battery Energy Storage Systems (PowerPack)
  • Meter: Power meters (Acuvim II)

BESS Readings (mg_bess_readings)

High-frequency telemetry from battery systems:

FieldTypeDescription
idUUIDReading identifier
device_idUUIDBESS device reference
timeTimestampReading timestamp (UTC)
soeFloatState of Energy (0-100%)
target_powerFloatCommanded power (kW)
command_sourceIntegerControl mode identifier
available_inverter_blocksIntegerAvailable capacity units

Command Sources:

  • 0: Manual/Default
  • 1: NIV Chase
  • 2: Dynamic Peak
  • 3: Import Avoidance
  • 4: Export Avoidance
  • 5: Axle Dispatch

Meter Readings (mg_meter_readings)

Power flow measurements from site meters:

FieldTypeDescription
idUUIDReading identifier
device_idUUIDMeter device reference
timeTimestampReading timestamp (UTC)
frequencyFloatGrid frequency (Hz)
voltage_line_averageFloatAverage line voltage (V)
current_phase_[a|b|c]FloatPhase currents (A)
power_phase_[a|b|c]_activeFloatPhase active power (kW)
power_total_activeFloatTotal active power (kW)
power_total_reactiveFloatTotal reactive power (kVAR)
power_total_apparentFloatTotal apparent power (kVA)
power_factor_totalFloatPower factor
energy_imported_activeFloatCumulative import (kWh)
energy_exported_activeFloatCumulative export (kWh)

Market Data (market_data)

External market signals and prices:

FieldTypeDescription
idUUIDData point identifier
timeTimestampData timestamp (UTC)
typeIntegerMarket data type reference
valueFloatData value
metadataJSONAdditional context

Market Data Types (market_data_types)

Categories of market information:

FieldTypeDescription
idIntegerType identifier
nameStringType name
descriptionStringType description

Standard Types:

  • 1: NIV Estimate (MW)
  • 2: Wholesale Price (£/MWh)
  • 3: Imbalance Price (£/MWh)
  • 4: Axle Dispatch (kW)

Aggregated Views

5-Minute Aggregations

Rolled-up telemetry for analysis:

mg_meter_readings_5m_intermediate:

  • Time-bucketed averages of power measurements
  • Energy deltas calculated using counter aggregates
  • Interpolation for missing data points

mg_bess_readings_5m:

  • Average SOE over period
  • Total energy charged/discharged
  • Mode utilization statistics

30-Minute Aggregations

Settlement period aggregations:

mg_meter_readings_30m_intermediate:

  • Half-hourly energy consumption/generation
  • Peak demand within period
  • Power factor statistics

Hourly Aggregations

Long-term analysis views:

mg_meter_readings_1h:

  • Hourly energy totals
  • Daily peak tracking
  • Monthly accumulations

Data Flow

Key Relationships

Device to Readings

  • One-to-many relationship
  • Devices generate multiple readings over time
  • Unique constraint on (device_id, time) prevents duplicates

Raw to Aggregated Data

  • Continuous aggregation policies
  • Automatic roll-up from 1-minute to 5/30/60-minute buckets
  • Retention policies for data lifecycle

Market Data Integration

  • Time-series join with telemetry data
  • Enables correlation of battery operation with market signals
  • Supports backtesting and analysis

Data Characteristics

Volume

  • ~1,440 readings per device per day (1-minute frequency)
  • ~100 MB per site per month
  • Automatic compression via TimescaleDB

Precision

  • Timestamps: Microsecond precision
  • Power measurements: 0.001 kW resolution
  • Energy measurements: 0.01 kWh resolution

Retention

  • Raw data: 90 days
  • 5-minute aggregations: 1 year
  • 30-minute aggregations: 5 years
  • Hourly aggregations: Indefinite

Next Steps