MiroxMirox
  • Platform

    • Philosophy
    • Platform Overview
    • Platform Resources
    • Availability and Maintenance Windows
    • Releases and Versions
  • Mirox-Cloud

    • Cloud Overview
    • Connected Microservices
  • Mirox-Agent

    • Agent Overview
    • Deployment Options
    • Data Scraper
    • Digital Twin
  • Technical Details

    • Metric Collection
  • Information

    • Supported Plants
  • Plant Types

    • Solar Plants
    • Solar Trackers and Park Controllers
    • Wind Plants
    • Battery Storage
    • Alarm System
  • Monitoring & Visualization

    • Real-time Monitoring
    • Digital Twin
    • Component States
    • Inverter Status Codes
    • Inverter Events
    • Loss Detection
    • Power Limits & Curtailment
    • Efficiency Detection
    • KPI Dashboard
  • Data Management

    • Events
    • Alarm Levels
    • Tickets
    • Forecasts
    • Reports
    • Metrics
  • Alert Manager

    • Overview
    • Alert Rules
    • Alerts & Notifications
    • Examples
  • Integration & Sharing

    • Cooperations
    • API Tokens
    • VPN
    • VPN Address Conflicts
    • Proxy
  • AI

    • AI Assistant & Wizards
    • Agentic Access (MCP)
  • Billing

    • Market & Tariffs
    • How Revenue Is Calculated
    • Accounting & Billing
    • Contracts
  • Collaboration

    • Invitations
  • Security

    • Authentication
    • Account Lockout
    • Organization Security Policy
    • Permission System
    • Network Segmentation
    • Cooperation Restrictions
    • Access Audit Logging
    • Activity & Audit Trail
    • Data Isolation
  • Getting Started

    • Onboarding
    • Setup
  • Personal

    • Using the VPN
    • Using the Proxy
    • Two-Factor Authentication
    • Sessions
    • API Tokens
    • Notifications
    • Connect Microsoft Teams
  • Per Park

    • Contacts
    • Network Devices
    • Data Loggers
    • Generic Modbus Reader
    • Components
    • Direct VPN (per Agent)
    • Data Volume
    • History Import
  • Organization

    • Member Permissions
    • Security Policy
    • Cooperations
    • File Storage
    • VPN Services
    • Working with Reports
  • Data Export

    • Metric Export
    • Metric Export API
    • Migrating to the Metric Export
    • Legacy Export API
    • External Report Generation
    • Grafana
    • Grafana Dashboards
    • API Overview
    • MiroxQL Formulas (API)
  • Support

    • Request an Integration
  • Reporting

    • External Report Generator
    • Metric Export for Excel
  • Remote Access
  • Account Security
  • AI in Mirox
  • History Import
  • Reports
  • Data Export
  • English
  • Deutsch
  • Español
  • Français
  • Português
  • Italiano
  • English
  • Platform

    • Philosophy
    • Platform Overview
    • Platform Resources
    • Availability and Maintenance Windows
    • Releases and Versions
  • Mirox-Cloud

    • Cloud Overview
    • Connected Microservices
  • Mirox-Agent

    • Agent Overview
    • Deployment Options
    • Data Scraper
    • Digital Twin
  • Technical Details

    • Metric Collection
  • Information

    • Supported Plants
  • Plant Types

    • Solar Plants
    • Solar Trackers and Park Controllers
    • Wind Plants
    • Battery Storage
    • Alarm System
  • Monitoring & Visualization

    • Real-time Monitoring
    • Digital Twin
    • Component States
    • Inverter Status Codes
    • Inverter Events
    • Loss Detection
    • Power Limits & Curtailment
    • Efficiency Detection
    • KPI Dashboard
  • Data Management

    • Events
    • Alarm Levels
    • Tickets
    • Forecasts
    • Reports
    • Metrics
  • Alert Manager

    • Overview
    • Alert Rules
    • Alerts & Notifications
    • Examples
  • Integration & Sharing

    • Cooperations
    • API Tokens
    • VPN
    • VPN Address Conflicts
    • Proxy
  • AI

    • AI Assistant & Wizards
    • Agentic Access (MCP)
  • Billing

    • Market & Tariffs
    • How Revenue Is Calculated
    • Accounting & Billing
    • Contracts
  • Collaboration

    • Invitations
  • Security

    • Authentication
    • Account Lockout
    • Organization Security Policy
    • Permission System
    • Network Segmentation
    • Cooperation Restrictions
    • Access Audit Logging
    • Activity & Audit Trail
    • Data Isolation
  • Getting Started

    • Onboarding
    • Setup
  • Personal

    • Using the VPN
    • Using the Proxy
    • Two-Factor Authentication
    • Sessions
    • API Tokens
    • Notifications
    • Connect Microsoft Teams
  • Per Park

    • Contacts
    • Network Devices
    • Data Loggers
    • Generic Modbus Reader
    • Components
    • Direct VPN (per Agent)
    • Data Volume
    • History Import
  • Organization

    • Member Permissions
    • Security Policy
    • Cooperations
    • File Storage
    • VPN Services
    • Working with Reports
  • Data Export

    • Metric Export
    • Metric Export API
    • Migrating to the Metric Export
    • Legacy Export API
    • External Report Generation
    • Grafana
    • Grafana Dashboards
    • API Overview
    • MiroxQL Formulas (API)
  • Support

    • Request an Integration
  • Reporting

    • External Report Generator
    • Metric Export for Excel
  • Remote Access
  • Account Security
  • AI in Mirox
  • History Import
  • Reports
  • Data Export
  • English
  • Deutsch
  • Español
  • Français
  • Português
  • Italiano
  • English
  • Getting Started

    • Onboarding
    • Setup
  • Personal

    • Using the VPN
    • Using the Proxy
    • Setting Up Two-Factor Authentication
    • Managing Your Sessions
    • API Tokens
    • Notifications
    • Connect Microsoft Teams
  • Per Park

    • Managing Plant Contacts
    • Managing Network Devices
    • Configuring Data Loggers
    • Generic Modbus Reader
    • Configuring Components
    • Configuring VPN Servers per Agent (Direct VPN)
    • Data Volume per Plant
    • Importing a Plant's History
  • Organization

    • Managing Member Permissions
    • Setting Your Organization's Security Policy
    • Creating Cooperations
    • Using File Storage
    • Organization VPN Services
    • Working with Reports
  • Data Export

    • Metric Export
    • Metric Export API
    • Migrating to the Metric Export
    • Legacy Export API
    • External Report Generation
    • Using Grafana as an External Read Platform
    • Building Your Own Grafana Dashboards
    • API Overview
    • MiroxQL Formulas (API Reference)
  • Support

    • Request an Integration

MiroxQL Formulas (API Reference)

A MiroxQL formula combines daily metrics of the legacy export into a calculated column, for example a performance ratio from an energy and a target.

The Formula Editor Was Retired From the App

Formulas are no longer created or edited in Mirox itself. This page is the reference of the API, which stays fully usable:

  • Existing formulas keep being evaluated wherever they are used: in legacy export templates and on the legacy export links.
  • Formulas can still be listed, created, changed and deleted through the API described here.
  • The successor for figures you define yourself is Metrics. A metric is evaluated on the 15-minute values of a plant, can be reported per component, appears in reports, and can be exported at every step with the Metric Export.

Open in Mirox

Data Export ▸ Glossary — define a new figure as a metric of your organization.

MiroxQL or Metrics?

MiroxQL formulaMetric
Works ondaily values of a plantthe 15-minute values of a plant
Reports per componentnoyes
Used inlegacy export templatesreports, the Metric Export and its templates
Finest stepday15 minutes
Edited inthe APIthe app, with live validation and an assistant, and the API

Formula Routes

All paths follow https://service.mirox.io/api/v1/export/metric/formula. The routes need a login or an API token of the group Full Access; a Metric Export token does not reach them. Reading is open to the members of the organization, writing to the organization roles Admin, Moderator, Asset Manager (Technical) and Asset Manager (Commercial).

RequestPurpose
GET (no further path)List the formulas of your organization and the formulas Mirox ships. Parameters: page, limit, include_system (default true), only_active (default false), search.
GET /{org_uid}/{metric_id}Read one formula. org_uid is system for a formula Mirox ships.
GET /{org_uid}/{metric_id}/referencesThe templates and formulas that use the formula.
GET /config-fieldsThe plant configuration values a formula can read.
POST /validateCheck the text of a formula. The answer lists the metrics and configuration values it reads.
POST /testEvaluate a formula on values you send.
POST /previewEvaluate a formula on the data of plants, with park or portfolio, year and quarter, month, week or day, and resolution.
POST /{org_uid}Create a formula in your organization.
PUT /{org_uid}/{metric_id}Change a formula.
DELETE /{org_uid}/{metric_id}Delete a formula.

Formulas Mirox ships cannot be changed or deleted.

Fields of a Formula

FieldValuesDefaultMeaning
metric_idlowercase letters, digits and underscores, starting with a letter; up to 100 charactersrequiredThe id other formulas and templates use.
nameup to 100 charactersrequiredThe column name.
descriptionup to 1000 charactersemptyWhat the formula calculates.
unitup to 50 charactersrequiredThe unit of the result, for example kWh or %.
formulatextrequiredThe expression. It must read at least one metric.
scalenumber1.0The result is multiplied by this factor when it is exported.
digits0 to 102The decimals of the exported value.
calculation_leveldaily, periodperiodWhen the formula runs. See Calculation level.
aggregation_methodsum, averageaverageHow daily results become a period value, with calculation_level=daily.
activetrue, falsetrueOnly when changing a formula. An inactive formula is not evaluated.
{
  "metric_id": "energy_total_incl_losses",
  "name": "Total Energy Including Losses",
  "description": "Sum of grid energy and all shutdown losses",
  "unit": "kWh",
  "scale": 0.001,
  "digits": 2,
  "formula": "@energy_grid_daily + @energy_shutdown_grid_daily + @energy_shutdown_external_daily",
  "calculation_level": "daily",
  "aggregation_method": "sum"
}

Ids

An id must be free. 409 metric_id_taken means that a formula or a metric of your organization, or a metric of Mirox, already has the id. This also applies when you change an existing formula whose id is taken in the meantime; deactivating it with active=false stays possible.

Scale and Digits

Calculate in base units and convert with scale. The daily metrics are evaluated in base units (Wh, W, Wh/m²), so a sum of energies with scale=0.001 is exported in kWh. scale and digits apply to the exported value only. A formula that reads another formula receives its unscaled, unrounded result.

Calculation Level

calculation_levelHow a monthly value is formedUse it for
dailyThe formula runs for every day. The daily results are added (sum) or averaged (average).sums of energy
periodThe metrics are rolled up to the month first. The formula runs once on the monthly values.ratios such as a performance ratio

Syntax

References

A metric is read with @ and its id. The ids are the legacy metric ids and the ids of other formulas.

@energy_grid_daily
@gti_sensor_daily

A value of the plant configuration is read with $ and its path:

ReferenceDescriptionUnit
$park.peak_production_wTotal peak powerW
$park.latitudeGeographic latitude°
$park.longitudeGeographic longitude°
$park.self_consumptionSelf-consumption factor (0.0 to 1.0)ratio
$park.information.string_peak_power_wTotal peak power of all stringsW
$park.information.inverter_max_power_wMaximum inverter powerW
$park.information.inverter_totalNumber of inverters—
$park.information.gak_totalNumber of combiner boxes—
$park.information.strings_totalNumber of strings—
$park.information.modules_totalNumber of modules—

GET /config-fields answers the current list.

Operators

KindOperatorsExample
Arithmetic+ - * / %@energy_grid_daily / $park.peak_production_w
Comparison== != < <= > >=@gti_sensor_daily > 0
Logic&& || !@gti_sensor_daily > 0 && @energy_grid_daily > 0
Conditioncondition ? a : b@gti_sensor_daily > 0 ? @gti_sensor_daily : @gti_weather_daily
Functionsmax(a, b), min(a, b)max(@energy_grid_daily, 0)

A comparison answers 1 or 0. A division by zero answers 0. A metric without data counts as 0.

Operations are evaluated in this order, highest first: parentheses, functions, * / %, + -, < <= > >=, == !=, &&, ||.

Examples

Specific yield:

@energy_grid_daily / $park.peak_production_w

Irradiation from the sensor, or from the weather model where the sensor has no value:

@gti_sensor_daily > 0 ? @gti_sensor_daily : @gti_weather_daily

Share of the shutdown losses:

(@energy_shutdown_grid_daily + @energy_shutdown_external_daily) / (@energy_grid_daily + @energy_shutdown_grid_daily + @energy_shutdown_external_daily) * 100

Rules

  • A formula reads at least one metric.
  • Parentheses are balanced, and two operators do not follow each other, except !.
  • A formula must not depend on itself, directly or through other formulas.
  • A formula works on daily values. It cannot read values within a day, and it cannot look back over earlier rows.

Moving a Formula to Metrics

A formula and a metric are written in different languages, so a formula is rewritten, not converted. In most cases the metric is shorter, because it states what happens in one 15-minute interval and leaves the rest to its Fold.

  1. Open Data Export ▸ Glossary and click New metric.
  2. Describe the figure to the assistant in the editor, or write the expression yourself. The side panel lists the series you can build from.
  3. Choose the Fold that matches the formula:
FormulaFold of the metric
A sum of energies, calculation_level=daily with sumSum
An averageAverage
A ratio of two sums, calculation_level=periodRatio, or Weighted mean
A share of time in which a condition holdsRatio with an expression that answers 1 or 0
  1. Check the preview on a plant, then use the metric in a report or export it.

The performance ratio, the expected production and the specific yield need no metric of your own. The collection has them: plant.pr_weather, plant.pr_pyranometer, plant.expected_weather, plant.expected_pyranometer, plant.specific_yield.

Related Features

  • Metrics — the successor: figures your organization defines itself
  • Metric Export — export metrics at every step
  • Legacy Export API — the templates and links that evaluate formulas
  • Migrating to the Metric Export — the calculated columns and their counterparts
  • API Tokens — a Full Access token for the formula routes
Prev
API Overview
© 2026 Mirox Verwaltungs GmbH. All rights reserved. | Privacy Policy