Skip to main content

Data Models

Sourceful uses a standardized data model structure for Distributed Energy Resources (DER) data collection. The system supports three main device types: photovoltaic (PV) systems, battery storage systems (Home Batteries and EV Batteries), and meters. Each device type inherits from a common base structure while adding device-specific fields.

Base Structure

DERData Root Structure

The root data structure can contain up to three subsystems:

  • pv: Photovoltaic system data
  • battery: Battery storage system data
  • meter: Meter data

Inheritance Model

All device types inherit from BaseDeviceData:

{
"type": "Device",
"make": "Deye",
"timestamp": 1755701251122,
"read_time_ms": 42
}

Units and Conventions

Units

All measurements use base SI units:

  • Power: W (watts)
  • Energy: Wh (watt-hours)
  • Voltage: V (volts)
  • Current: A (amperes)
  • Frequency: Hz (hertz)
  • Temperature: °C (Celsius)
  • State of Charge: fraction (0.0 = empty, 1.0 = full)
  • Time: s (seconds), ms (milliseconds for timestamps)

Sign Conventions

  • Generation: Negative power (PV: W < 0)
  • Charging: Positive power/current (Battery: W > 0, A > 0)
  • Discharging: Negative power/current (Battery: W < 0, A < 0)
  • Import: Positive power (Meter: W > 0)
  • Export: Negative power (Meter: W < 0)
  • Energy Totals: Always positive values

Device Types

BaseDeviceData

Common fields shared by all device types:

FieldUnitData TypeDescription
type-stringObject type ("pv", "battery", "meter")
make-stringManufacturer/brand name (optional)
timestampmillisecondsintegerTimestamp of reading start (optional)
read_time_msmillisecondsintegerTime taken to complete the reading (optional)

PV Data Model

Photovoltaic system data with solar generation metrics:

Example:

{
"type": "pv",
"make": "Deye",
"W": -1500,
"rated_power_W": 3000,
"mppt1_V": 400,
"mppt1_A": -3.75,
"mppt2_V": 380,
"mppt2_A": -3.68,
"heatsink_C": 45,
"total_generation_Wh": 15000
}

Fields:

FieldUnitData TypeDescription
WWfloatPower Generation (always negative)
rated_power_WWfloatSystem Rated Power
mppt1_VVfloatMPPT1 Voltage
mppt1_AAfloatMPPT1 Current
mppt2_VVfloatMPPT2 Voltage
mppt2_AAfloatMPPT2 Current
heatsink_C°CfloatInverter Temperature
total_generation_WhWhintegerTotal Energy Generated

Battery Data Model

Battery storage system data with charge/discharge metrics:

Example:

{
"type": "battery",
"make": "Tesla",
"W": 500,
"A": 10.5,
"V": 48.2,
"SoC_nom_fract": 0.75,
"heatsink_C": 25,
"total_charge_Wh": 8000,
"total_discharge_Wh": 7200
}

Fields:

FieldUnitData TypeDescription
WWfloatActive Power (+ charge, - discharge)
AAfloatCurrent (+ charge, - discharge)
VVfloatVoltage
SoC_nom_fractfractionfloatState of Charge (0.0-1.0)
heatsink_C°CfloatBattery Temperature
total_charge_WhWhintegerTotal Energy Charged
total_discharge_WhWhintegerTotal Energy Discharged

Meter Data Model

Grid meter data with import/export and phase-level measurements:

Example:

{
"type": "meter",
"make": "Kamstrup",
"W": 1200,
"Hz": 50.0,
"L1_V": 230,
"L1_A": 5.2,
"L1_W": 400,
"L2_V": 229,
"L2_A": 5.1,
"L2_W": 380,
"L3_V": 231,
"L3_A": 5.3,
"L3_W": 420,
"total_import_Wh": 25000,
"total_export_Wh": 18000
}

Fields:

FieldUnitData TypeDescription
WWfloatTotal Active Power (+ import, - export)
HzHzfloatGrid Frequency
L1_VVfloatL1 Phase Voltage
L1_AAfloatL1 Phase Current
L1_WWfloatL1 Phase Power
L2_VVfloatL2 Phase Voltage
L2_AAfloatL2 Phase Current
L2_WWfloatL2 Phase Power
L3_VVfloatL3 Phase Voltage
L3_AAfloatL3 Phase Current
L3_WWfloatL3 Phase Power
total_import_WhWhintegerTotal Energy Imported
total_export_WhWhintegerTotal Energy Exported