Load consumption data to production environment

Hi all

I have stored all my consumption data (buy from grid, feed to grid, consumption) for this year in influx.

I’d like to load this data into a production (test) OpenEMS so for example the prediction api has sufficient data.

Looking through the code and doc, can’t seem to find much.

Is this possible? How to proceed?

Thanks a lot

I’ve loaded data to influx in
_sum/ProductionActivePower, which seems to work until I restarted.

[ctrlApiWebsocket0] Unhandled Notification: {"jsonrpc":"2.0","method":"logMessage","params":{"level":"error","msg":"{\"error\":{\"message\":\"NG02100\"},\"metadata\":{\"browser\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36\"}}"}}
28/10/2023, 22:01:22
WARN
io.openems.common.websocket.OnRequestHandler
[ctrlApiWebsocket0] JSON-RPC Error "Energy values are not available" for Request {"method":"edgeRpc","params":{"edgeId":"0","payload":{"method":"queryHistoricTimeseriesEnergy","p...
28/10/2023, 22:01:22
WARN
io.openems.shared.influxdb.proxy.InfluxQlProxy
Got negative Energy value [-2153] for [0] _sum/ConsumptionActiveEnergy,_sum/GridBuyActiveEnergy,_sum/GridSellActiveEnergy,_sum/ProductionActiveEnergy,charger0/ActualEnergy,charger1/ActualEnergy
28/10/2023, 22:01:22
WARN
io.openems.shared.influxdb.proxy.InfluxQlProxy
Got negative Energy value [-4019] for [0] _sum/ConsumptionActiveEnergy,_sum/GridBuyActiveEnergy,_sum/GridSellActiveEnergy,_sum/ProductionActiveEnergy,charger0/ActualEnergy,charger1/ActualEnergy
28/10/2023, 22:01:22
WARN
io.openems.shared.influxdb.proxy.InfluxQlProxy
Got negative Energy value [-322] for [0] _sum/ConsumptionActiveEnergy,_sum/EssDcChargeEnergy,_sum/EssDcDischargeEnergy,_sum/GridBuyActiveEnergy,_sum/GridSellActiveEnergy,ctrlEssTimeOfUseTariff0/ChargedTime
28/10/2023, 22:01:22
WARN
io.openems.shared.influxdb.proxy.InfluxQlProxy
Got negative Energy value [-6172] for [0] _sum/ConsumptionActiveEnergy,_sum/GridBuyActiveEnergy,_sum/GridSellActiveEnergy,_sum/ProductionActiveEnergy,charger0/ActualEnergy,charger1/ActualEnergy
28/10/2023, 22:01:22
WARN
io.openems.shared.influxdb.proxy.InfluxQlProxy
Got negative Energy value [-19294] for [0] _sum/ConsumptionActiveEnergy,_sum/EssDcChargeEnergy,_sum/EssDcDischargeEnergy,_sum/GridBuyActiveEnergy,_sum/GridSellActiveEnergy,ctrlEssTimeOfUseTariff0/ChargedTime
28/10/2023, 22:01:22
WARN
io.openems.shared.influxdb.proxy.InfluxQlProxy
Got negative Energy value [-322] for [0] _sum/ConsumptionActiveEnergy,_sum/GridBuyActiveEnergy,_sum/GridSellActiveEnergy,_sum/ProductionActiveEnergy,charger0/ActualEnergy,charger1/ActualEnergy
28/10/2023, 22:01:22
WARN
io.openems.shared.influxdb.proxy.InfluxQlProxy
Got negative Energy value [-21741] for [0] _sum/ConsumptionActiveEnergy,_sum/EssDcChargeEnergy,_sum/EssDcDischargeEnergy,_sum/GridBuyActiveEnergy,_sum/GridSellActiveEnergy,ctrlEssTimeOfUseTariff0/ChargedTime
28/10/2023, 22:01:22
WARN
io.openems.shared.influxdb.proxy.InfluxQlProxy
Got negative Energy value [-19294] for [0] _sum/ConsumptionActiveEnergy,_sum/GridBuyActiveEnergy,_sum/GridSellActiveEnergy,_sum/ProductionActiveEnergy,charger0/ActualEnergy,charger1/ActualEnergy
28/10/2023, 22:01:22
WARN
io.openems.shared.influxdb.proxy.InfluxQlProxy
Got negative Energy value [-3655] for [0] _sum/ConsumptionActiveEnergy,_sum/EssDcChargeEnergy,_sum/EssDcDischargeEnergy,_sum/GridBuyActiveEnergy,_sum/GridSellActiveEnergy,ctrlEssTimeOfUseTariff0/ChargedTime
28/10/2023, 22:01:22
WARN
io.openems.shared.influxdb.proxy.InfluxQlProxy
Got negative Energy value [-43230] for [0] _sum/ConsumptionActiveEnergy,_sum/GridBuyActiveEnergy,_sum/GridSellActiveEnergy,_sum/ProductionActiveEnergy,charger0/ActualEnergy,charger1/ActualEnergy
28/10/2023, 22:01:22
WARN
io.openems.shared.influxdb.proxy.InfluxQlProxy
Got negative Energy value [-43230] for [0] _sum/ConsumptionActiveEnergy,_sum/EssDcChargeEnergy,_sum/EssDcDischargeEnergy,_sum/GridBuyActiveEnergy,_sum/GridSellActiveEnergy,ctrlEssTimeOfUseTariff0/ChargedTime
28/10/2023, 22:01:22
WARN
io.openems.common.websocket.OnRequestHandler
[ctrlApiWebsocket0] JSON-RPC Error "Energy values are not available" for Request {"method":"edgeRpc","params":{"edgeId":"0","payload":{"method":"queryHistoricTimeseriesEnergy","p...
28/10/2023, 22:01:22
WARN
io.openems.shared.influxdb.proxy.InfluxQlProxy
Got negative Energy value [-6172] for [0] _sum/ConsumptionActiveEnergy,_sum/EssDcChargeEnergy,_sum/EssDcDischargeEnergy,_sum/GridBuyActiveEnergy,_sum/GridSellActiveEnergy,_sum/ProductionActiveEnergy
28/10/2023, 22:01:22
WARN
io.openems.shared.influxdb.proxy.InfluxQlProxy
Got negative Energy value [-322] for [0] _sum/ConsumptionActiveEnergy,_sum/EssDcChargeEnergy,_sum/EssDcDischargeEnergy,_sum/GridBuyActiveEnergy,_sum/GridSellActiveEnergy,_sum/ProductionActiveEnergy
28/10/2023, 22:01:22
WARN
io.openems.shared.influxdb.proxy.InfluxQlProxy
Got negative Energy value [-19294] for [0] _sum/ConsumptionActiveEnergy,_sum/EssDcChargeEnergy,_sum/EssDcDischargeEnergy,_sum/GridBuyActiveEnergy,_sum/GridSellActiveEnergy,_sum/ProductionActiveEnergy
28/10/2023, 22:01:22
WARN
io.openems.shared.influxdb.proxy.InfluxQlProxy
Got negative Energy value [-21741] for [0] _sum/ConsumptionActiveEnergy,_sum/EssDcChargeEnergy,_sum/EssDcDischargeEnergy,_sum/GridBuyActiveEnergy,_sum/GridSellActiveEnergy,_sum/ProductionActiveEnergy
28/10/2023, 22:01:22
WARN
io.openems.shared.influxdb.proxy.InfluxQlProxy
Got negative Energy value [-3655] for [0] _sum/ConsumptionActiveEnergy,_sum/EssDcChargeEnergy,_sum/EssDcDischargeEnergy,_sum/GridBuyActiveEnergy,_sum/GridSellActiveEnergy,_sum/ProductionActiveEnergy
28/10/2023, 22:01:22
WARN
io.openems.shared.influxdb.proxy.InfluxQlProxy
Got negative Energy value [-43230] for [0] _sum/ConsumptionActiveEnergy,_sum/EssDcChargeEnergy,_sum/EssDcDischargeEnergy,_sum/GridBuyActiveEnergy,_sum/GridSellActiveEnergy,_sum/ProductionActiveEnergy
28/10/2023, 22:01:22
WARN
io.openems.edge.controller.api.websocket.OnNotification
[ctrlApiWebsocket0] Unhandled Notification: {"jsonrpc":"2.0","method":"logMessage","params":{"level":"error","msg":"{\"error\":{\"message\":\"NG02100\"},\"metadata\":{\"browser\":\"Mozilla/5.0

Data is loaded properly in influx

Any idea?

It already tells you the Problems… Energy Values can mot be negative.

Hey there,

That’s odd - the data I loaded was only for charger0 en charger1 and they are not negative.
I guess there is an other component automatically injecting negative data - probably the ess. I’ll check it

I keep getting

Nov 07 16:52:33 ubuntu java[5212]: 2023-11-07T16:52:33,983 [et Api-4] WARN  [d.influxdb.proxy.InfluxQlProxy] Got negative Energy value [-701] for [0] _sum/ProductionActiveEnergy,_sum/ProductionDcActiveEnergy,charger0/ActualEnergy,charger1/ActualEnergy

However, when querying influx, no such values can be found. What am I missing?

from(bucket: "OpenEMS_2")
  |> range(start: -30d)
  |> filter(fn: (r) =>
      r["_measurement"] == "data" and
      (
          r["_field"] == "_sum/ProductionActiveEnergy" or
          r["_field"] == "_sum/ProductionDcActiveEnergy" or
          r["_field"] == "charger0/ActualEnergy" or
          r["_field"] == "charger1/ActualEnergy"
      )
  )
  |> filter(fn: (r) => r["_value"] < 0 )

Hi,

first: it depends on this setting, wheter OpenEMS uses Flux or InfluxQL:

(we internally switched back to InfluxQL because it proved to be faster on Influx 1.8)

However, when querying influx, no such values can be found. What am I missing?

The query for Energy data does a last minus first calculation, see:

That means you will not find those values directly in InfluxDB, but OpenEMS expects the values for Energy channels (like _sum/ProductionActiveEnergy) to be steadily rising.

Could that be the issue?

Regards,
Stefan