Create Virtual Meters

Create Virtual Meters

Virtual meters are intended to represent aggregated measurements derived from data that is not physically collected. Their values are computed using a virtual meter formula. For example, a simple virtual feed-in meter can be created using the following API request:

curl -X POST 'https://api.solarize.energy/v1/meters' \
  -H 'Content-Type: application/json' \
  -d '{
    "siteId": "50d4d102-881d-4979-9c0f-589d236a96e4",
    "mpo": "virtual",
    "formula": [
      { "type": "aggregation", "aggregation": "sum_local_producer" },
      { "type": "arithmetic", "arithmetic": "subtraction" },
      { "type": "aggregation", "aggregation": "sum_local_consumer" }
    ],
    "direction": "consumer",
    "grid": true,
    "identifier": "vZ1-FEEDIN",
    "serial": "vZ1-FEEDIN-5678",
    "startDate": "2025-12-31T23:00:00.000Z",
    "measuring": "load_profile_accurate"
  }'

When creating virtual meters, it is important to pay attention to several key aspects: set the MPO to virtual, use the measuring type load_profile_accurate and define a valid formula. A formula consists of components, with each component representing a single step in the calculation process. The following sections explain the available component types and the rules for building a valid formula.

Formula Component Types

There are three component types that can be used in a virtual meter formula. The following table summarizes these component types:


TypeDescription
aggregationDefines an aggregation operation to sum values from multiple meters based on specific criteria.
arithmeticSpecifies an arithmetic operation (addition or subtraction) to be applied between two components.
meterReferences another meter by its unique identifier to include its measurements in the formula.

Each component type has its own structure and allowed values, which are detailed below.

Aggregation

An aggregation formula component defines a method to combine measurements from multiple meters based on certain criteria. The aggregation type determines which meters are included in the summation. We provide several predefined aggregation types:


TypeDescription
sum_local_producerSums the values from all local production meters, whether or not a balancing setting is assigned.
sum_local_consumerSums the values from all local consumption meters, whether or not a balancing setting is assigned.
sum_local_participant_producerSums the values from all local production meters, that have an assigned participant balancing setting.
sum_local_participant_consumerSums the values from all local consumption meters, that have an assigned participant balancing setting.
sum_customer_consumersSums the values from all consumption meters of a customer, whether or not a balancing setting is assigned. This requires an additional property customerId.

Examples:

{
  "type": "aggregation",
  "aggregation": "sum_local_producer"
}
{
  "type": "aggregation",
  "aggregation": "sum_customer_consumers",
  "customerId": "612e64b8-1679-4fdb-887d-c5b00ad394a1"
}

Arithmetic

An arithmetic formula component specifies a mathematical operation to be performed between two components in the formula. The allowed operations are addition and subtraction.

Examples:

{
  "type": "arithmetic",
  "arithmetic": "addition"
}
{
  "type": "arithmetic",
  "arithmetic": "subtraction"
}

Meter

A meter formula component references an existing meter by its unique identifier (UUID). This allows the virtual meter to include measurements from that specific meter in its calculations.

Example:

{
  "type": "meter",
  "meterId": "612e64b8-1679-4fdb-887d-c5b00ad394a1"
}

Formula Construction Rules

When constructing a virtual meter formula, the following rules must be followed to ensure the formula is valid:

  • The formula must be an array with at least one component.
  • Aggregation and meter components must be separated by an arithmetic component.
  • The formula cannot end with an arithmetic component.

Valid Example:

[
  { "type": "aggregation", "aggregation": "sum_local_producer" },
  { "type": "arithmetic", "arithmetic": "subtraction" },
  { "type": "meter", "meterId": "612e64b8-1679-4fdb-887d-c5b00ad394a1" }
]

Invalid Example:

The formula ends with an arithmetic:

[
  { "type": "aggregation", "aggregation": "sum_local_producer" },
  { "type": "arithmetic", "arithmetic": "addition" }
]

Two aggregations without arithmetics in between:

[
  { "type": "aggregation", "aggregation": "sum_local_producer" },
  { "type": "aggregation", "aggregation": "sum_local_consumer" }
]