Files
EOS/docs/akkudoktoreos/measurement.md
T
Bobby NoelteandClaude Opus 5.5 f441759dfa fix(measurement): use quality-aware meter energy for load and PV
Additional fixes
Measurement.meter_energy_kwh converts meter energy over the whole period in one read; the 31-day and 10000-interval limits apply to the public energy queries only.
Load intervals a meter does not fully cover are NaN and the load adjustment skips them; load_total_kwh returns an empty array for an empty store and keeps full last intervals.
The load adjustment compares over the period the load meters report, skips a stale load meter period and says when no load meter is configured.
PV calibration, snow feedback and the load adjustment fall back without measurements when a conversion fails, logged as error once per failure streak and consumer.
Measurement.keys_first_datetime and keys_last_datetime find each meter's first and last valid reading in bounded scans, keep each meter's newest reading and return stamps in the configured zone.
Measurement.keys_common_period derives the common meter period for PV calibration and the load adjustment and names the meter that ends it, also when meters share no period.
PV calibration warns once per stale period when a stopped PV meter holds it on old data; snow feedback warns once about a stale feedback meter.
Lasting meter conditions (silent, reset, gap, replaced meter, no shared period) are warned once per condition and consumer through one helper and warned again when they recur.
A replaced meter whose readings touch the new one is reported; a single reading is not; a meter group waiting for its second reading is an info once.
The PV meter resolution is detected from valid readings only (pre-existing), using one shared valid-reading rule in energy.py.
Stale meter stamps are compared with compare_datetimes; new meter tests create durations with datetimeutil.
The unused legacy Measurement._energy_from_meter_readings is removed; its test scenarios cover meter_energy_kwh.
The converter's range error no longer mentions the API's 31-day limit, and its duplicate interval check is gone.
Measurement and prediction docs describe the meter coverage rule, even gap spreading and when the load forecast stays unadjusted.
Tests reset the warn-once state of the shared measurement store and restore the EMS start they change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Assisted-by: Claude Code (claude-opus-5-5)
2026-11-15 18:30:00 +01:00

4.3 KiB

% SPDX-License-Identifier: Apache-2.0 (measurement-page)=

Measurements

Measurements are utilized to refine predictions using real data from your system, thereby enhancing accuracy.

  • Household Load Measurement
  • Grid Export Measurement
  • Grid Import Measurement

Storing Measurements

EOS stores measurements in a key-value store, where the term measurement key refers to the unique identifier used to store and retrieve specific measurement data.

Several endpoints of the EOS REST server allow for the management and retrieval of these measurements.

The measurement data must be or is provided in one of the following formats:

1. DateTimeData

A dictionary with the following structure:

{
    "start_datetime": "2024-01-01 00:00:00",
    "interval": "1 hour",
    "<measurement key>": [value, value, ...],
    "<measurement key>": [value, value, ...],
    ...
}

2. DateTimeDataFrame

A JSON string created from a pandas dataframe with a DatetimeIndex. Use pandas.DataFrame.to_json(orient="index"). The column name of the data must be the same as the names of the measurement keys.

3. DateTimeSeries

A JSON string created from a pandas series with a DatetimeIndex. Use pandas.Series.to_json(orient="index").

Creates a dictionary like this:

{
  "data": {
     "2024-01-01T00:00:00+01:00": 1,
     "2024-01-02T00:00:00+01:00": 2,
     "2024-01-03T00:00:00+01:00": 3,
     ...
  },
  "dtype": "float64",
  "tz": "Europe/Berlin"
}

Load Measurement

The EOS measurement store provides for storing energy meter readings of loads.

The associated measurement keys can be configured by:

{
  "measurement": {
    "load_emr_keys": ["load0_emr", "my special load", ...]
  }
}

Load measurements can be stored for any datetime. The values between different meter readings are linearly approximated. Storing values between optimization intervals is generally not useful.

The EOS measurement store automatically sums all given loads to create a total load value series for specified intervals, usually one hour. This aggregated data can be used for load predictions. An interval that the meters do not fully cover (before the first or after the last reading, a meter reset, or a gap longer than the channel's max_gap_seconds) has no value instead of zero load; with several load meters, all of them must cover it. Without max_gap_seconds a gap between two readings is spread evenly over it. The LoadAkkudoktorAdjusted provider skips hours without a value.

:::{admonition} Warning :class: warning Only use actual meter readings in kWh, not energy consumption. Example: 112345.77, 112389.23, 112412.55, … :::

Grid Export/ Import Measurement

The EOS measurement store also allows for the storage of meter readings for grid import and export.

The associated measurement keys can be configured by:

{
  "measurement": {
    "grid_export_emr_keys": ["grid_export_emr", ...],
    "grid_import_emr_keys": ["grid_import_emr", ...],
  }
}

:::{admonition} Todo :class: note Currently not used. Integrate grid meter readings into the respective predictions. :::

Battery/ Electric Vehicle State of Charge (SoC) Measurement

The state of charge (SoC) measurement of batteries and electric vehicle batteries can be stored.

The associated measurement key is pre-defined by the device configuration. It can be determined from the device configuration by the read-only measurement_key_soc_factor configuration option.

Battery/ Electric Vehicle Power Measurement

The charge/ discharge power measurements of batteries and electric vehicle batteries can be stored. Charging power is denoted by a negative value, discharging power by a positive value.

The associated measurement keys are pre-defined by the device configuration. They can be determined from the device configuration by read-only configuration options:

  • measurement_key_power_l1_w
  • measurement_key_power_l2_w
  • measurement_key_power_l3_w
  • measurement_key_power_3_phase_sym_w