How does the adapter calculate?
Is SourceAnalytix still being developed?
In short: Yes. After a long break between v0.4.14 (February 2022) and v0.5.0 (July 2026), new versions are being released regularly again, most recently v0.6.0 on 26 September 2026 and v0.6.1 on 7 November 2026. v0.6.2 brings bug fixes, and v0.7.0 brings the new settings page with actions for fixing problems.
SourceAnalytix is currently in the "latest" (beta) repository. It only moves to "stable" after a test phase. To get a new version, see How do I update SourceAnalytix (and what is a downgrade)?.
Where to take questions and bugs
- From v0.7.0, first look at the "Problems" tab in the instance settings. It checks all sources and suggests a fix.
- Read the troubleshooting pages.
- Report a bug or a feature request as an issue in the GitHub repository. Check first whether there is already an issue for it. Include the versions of SourceAnalytix, js-controller and Node.js, and attach the log of the affected source.
Features that many people ask for, such as "Switch datapoint" (#1271) or a "Sum of all sources", are marked as planned. On the settings page they carry the label "planned".
Why do the values differ from my meter, portal or evcc?
In short: There are usually four possible reasons: the source is a power value in W that sends only rarely; a portal or wallbox assigns the consumption to a different point in time; the device measures differently from your meter; or the start values, unit or total don't fit. The table helps you find the cause.
| Cause | How to recognize it | What helps |
|---|---|---|
| The source is a power value (W) that sends only every few minutes | The values differ a lot, often by a multiple | Use the device's total counter in kWh, or make the device send more often, for example every 10 seconds |
| A power source had a pause | After an outage, consumption is missing or far too high | See Pauses, from v0.7.0 "Maximum gap between power values (minutes)" |
| Different point in time for assigning the consumption | Daily values differ, but the sum over several days matches | Nothing, both values are right. Compare longer periods |
| The device measures differently from the grid operator's meter | Consumption and feed-in don't match the meter in the basement | Read the meter itself, for example with a reading head |
| Start values, unit or total are wrong | Values are negative, far too high or off by a fixed amount | See Correct wrong values |
Power instead of a meter reading
From a power value, SourceAnalytix can only estimate the consumption. Each value applies until the next one. If a device sends only every 5 minutes, SourceAnalytix counts every short peak for the whole 5 minutes. If the device offers a meter reading in kWh, that is more accurate. For how the conversion works, see How does SourceAnalytix convert watts to kWh?.
Different point in time for assigning the consumption
SourceAnalytix books consumption on the day it was measured: The daily value is the total now minus the total at 0:00. A wallbox or evcc, on the other hand, often books a whole charging session on the day it ends. Manufacturer portals sometimes work with 15-minute values. Over days or months, this evens out.
The device measures differently
A Shelly 3EM counts consumption and feed-in per phase. The grid operator's meter offsets the phases against each other. With feed-in on one phase and consumption on another, the two therefore differ, even though SourceAnalytix calculates correctly.
See also: Which datapoint do I activate: meter (kWh) or power (W)? · What do I enter for the start values (and in which unit)?
How does SourceAnalytix convert watts to kWh?
In short: With every new power value, SourceAnalytix calculates the energy since the previous value: previous power × time since the previous value. This is a left Riemann sum. With "Average power values" it uses the average of the previous and the new value instead. The energy is converted to the target unit and added to the total.
The formula
Energy in Wh = power in W × time in hours. An example with three values:
| Time | Value | without averaging | with averaging |
|---|---|---|---|
| 10:00 | 0 W | Starting point | Starting point |
| 10:30 | 1,000 W | 0 W × 0.5 h = 0 Wh | 500 W × 0.5 h = 250 Wh |
| 11:00 | 1,000 W | 1,000 W × 0.5 h = 500 Wh | 1,000 W × 0.5 h = 500 Wh |
| Sum | 500 Wh = 0.5 kWh | 750 Wh = 0.75 kWh |
Without averaging, the calculation suits devices that switch abruptly and send only when something changes. With averaging, it suits sensors whose power rises and falls smoothly and that send regularly.
It only calculates when a new value arrives
SourceAnalytix calculates as soon as the source writes a value, even if the value stays the same. What counts is the value's timestamp. A device that sends only when something changes is still calculated correctly: The last value applies until a new one arrives.
Pauses
- First value: After activation, after a restart of SourceAnalytix and after a change of the settings, the first value is only the starting point. The energy of the pause before it is missing.
- Long silence while the instance is running: If no new value arrives for a long time, SourceAnalytix extends the last value over the whole pause. From v0.7.0, "Maximum gap between power values (minutes)" limits this. Longer pauses then count as 0 (#1266).
- Midnight: From v0.6.2, SourceAnalytix books the energy up to 0:00 to the old day and carries on with the same value in the new day. A value that is older than the previous day is not extrapolated (#1254).
- Negative values: With "Ignore negative values" they count as 0 W.
Power sources have no reset detection and no start values to enter. Their total starts at 0 on activation.
See also: Which datapoint do I activate: meter (kWh) or power (W)? · Can SourceAnalytix calculate consumption and a meter reading from power (W)?
How is consumption calculated, and why is currentYear lower than my meter reading?
In short: This is by design. currentYear.consumed.05_currentYear is this year's consumption, not the meter reading: total minus the "Year" start value. You find the meter reading itself in sourceanalytix.0.<device>.cumulativeReading.
The same formula applies to every period: consumption = total − start value of the period. The start value is the total at the beginning of the period. SourceAnalytix sets it itself at every period rollover, for example on 1 January at 0:00 for "Year".
| Value | |
|---|---|
Total (cumulativeReading) | 12,480 kWh |
| "Year" start value (total on 1 January) | 11,900 kWh |
05_currentYear | 580 kWh |
If you only activated SourceAnalytix during the year, the "Year" start value is the total at the time of activation. The year then counts from that day. If you want it to count from 1 January, enter the meter reading from 1 January as the start value, see What do I enter for the start values (and in which unit)?.
SourceAnalytix stores the meter reading at the end of each period under currentYear.meterReadings if "Store meter readings" is on.
See also: Meter readings per period (meterReadings) · Where do I find my values (daily consumption today/yesterday)?