Describe the bug
fenecon_battery_power only reports positive values or zero. Regardless whether the battery is charging or discharging, the metric shows a positive value. This makes it impossible to distinguish between "battery idle" and "battery charging" and renders the metric useless for energy flow dashboards.
Important note Starting from here, the analysis was written by Claude after having created a workaround using JSON exporter.
The root cause appears to be that the exporter uses _sum/EssDischargePower as its source, which only covers one direction of power flow. _sum/EssChargePower does not exist on this system (empty API response).
To Reproduce
Query the relevant FENECON REST API channels while the battery is discharging:
curl http://x:user@fems:8084/rest/channel/_sum/EssActivePower
{"value":941, "text": "Negative values for charge; positive for discharge", ...}
curl http://x:user@fems:8084/rest/channel/_sum/EssDischargePower
{"value":0, ...}
curl http://x:user@fems:8084/rest/channel/_sum/EssChargePower
(empty response)
EssActivePower correctly reports 941 W while EssDischargePower reports 0.
Expected behavior
fenecon_battery_power should be a signed metric: positive values for discharge, negative values for charge — consistent with how OpenEMS documents _sum/EssActivePower.
Suggestion
Use _sum/EssActivePower as the source instead of _sum/EssDischargePower. It is signed, reliably implemented, and explicitly documented by OpenEMS as the authoritative AC-side ESS power value.
Workaround
Scraping _sum/EssActivePower directly via prometheuscommunity/json-exporter as a separate job yields correct signed values.
Environment
- Image:
webdevops/fenecon-exporter:latest
- FENECON/OpenEMS REST API endpoint:
_sum/EssActivePower, _sum/EssDischargePower
Describe the bug
fenecon_battery_poweronly reports positive values or zero. Regardless whether the battery is charging or discharging, the metric shows a positive value. This makes it impossible to distinguish between "battery idle" and "battery charging" and renders the metric useless for energy flow dashboards.Important note Starting from here, the analysis was written by Claude after having created a workaround using JSON exporter.
The root cause appears to be that the exporter uses
_sum/EssDischargePoweras its source, which only covers one direction of power flow._sum/EssChargePowerdoes not exist on this system (empty API response).To Reproduce
Query the relevant FENECON REST API channels while the battery is discharging:
EssActivePowercorrectly reports 941 W whileEssDischargePowerreports 0.Expected behavior
fenecon_battery_powershould be a signed metric: positive values for discharge, negative values for charge — consistent with how OpenEMS documents_sum/EssActivePower.Suggestion
Use
_sum/EssActivePoweras the source instead of_sum/EssDischargePower. It is signed, reliably implemented, and explicitly documented by OpenEMS as the authoritative AC-side ESS power value.Workaround
Scraping
_sum/EssActivePowerdirectly viaprometheuscommunity/json-exporteras a separate job yields correct signed values.Environment
webdevops/fenecon-exporter:latest_sum/EssActivePower,_sum/EssDischargePower