FileNotFoundException in Summary

Hi,

I´ve just installed Christian´s summary device which displays a nice set of summary data in live UI.
I connected it to my influx V2 but the debugger comes up with an error:

2022-04-12T08:32:02,359 [re.Cycle] ERROR [enems.edge.summary.SummaryImpl] [summary0] java.lang.RuntimeException: java.io.FileNotFoundException: http://192.168.3.20:8086/api/v2/query?org=klinki

The historic view works fine with my influx so I don´t know what I am doing wrong here with the summary module.
Any suggestions?

regards
klinki

Problem was the missing influx bucket “tageswerte”.
The error is gone but I did not get how data insert is done.

regards
klinki

After a bit of research I´was able to adapt the summary module to my own environment.
I´ve created a php skript which aggregates the data (production, consumption, etc.) for each day in the bucket “tageswerte”. Than the module takes data via flux out of the actual ems-bucket and the tageswerte-bucket.

I am very happy with that.
summary
Thanks again Christian for his work.

Hopefully the module will find it´s way to the official repo.

Regards
klinki

Hi klinki,
you are welcome. I’m using Tasks in InfluxDB for the “Tageswerte” for downsizing daily Values to one value per day

But be in mind, the module is written by me because of a strange behaviour of my goodwe ess. Sometimes there are communication errors and then very high consumption and/or production power (>200kW). The execution time of the script could be too long for a great database.
Normally you can use the EnergyValues from Openems, e.g. ConsumptionActiveEnergy. This value is constantly rising and with simple difference calculation the consumption for a specific timerange can be calculated.

Best regards
Christian

this could be interesting

Good morning Christian,

It´s the same problem with my SolarEdge inverter: it switches a factor value if production is low, e.g. at sunrise. Then OpenEMS can produce a high power rate at this time. Stefan already told me that it´s not that easy for EMS to handle this.
In my opinion the only reliable method is to look on the kWh-counters. That´s what my script does: it takes the first and last counter value for one day and puts in “tageswerte”. Power(W) is not a good unit for aggregation though. It switches permanetly. So I leave this work to the energy meter and it´s kWh counter.
I am new to influxdb2 and also not familiar with the tasks-feature. I´ll keep it in mind :wink:

Regards
klinki

I’ve created my own task to update Tageswerte each day. I’m not sure if it´s the best flux-style. But the dry-run worked.

option task = {
    name: "Update Tageswerte",
    cron: "59 23 * * *",
}

// Produktion #############################################################
dProdMin = from(bucket: "ems")
    |> range(start: today())
    |> filter(fn: (r) => r._measurement == "data" and r._field == "_sum/ProductionActiveEnergy")
    |> map(
        fn: (r) => ({
            _time: r._time,
            _start: r._start,
            _stop: r._stop,
            _value: r._value,
        }),
    //|> first()
    )
    |> first()

dProdMax = from(bucket: "ems")
    |> range(start: today())
    |> filter(fn: (r) => r._measurement == "data" and r._field == "_sum/ProductionActiveEnergy")
    |> map(
        fn: (r) => ({
            _time: r._time,
            _start: r._start,
            _stop: r._stop,
            _value: r._value,
        }),
    )
    |> last()
dProd = join(tables: {dProdMin, dProdMax}, on: ["_start"])
    |> map(
        fn: (r) => ({
            _time: today(),
            _measurement: "data",
            _field: "dailyProd",
            _value: r._value_dProdMax - r._value_dProdMin,
        }),
    )
    |> to(bucket: "tageswerte")

// Verbrauch #############################################################
dConMin = from(bucket: "ems")
    |> range(start: today())
    |> filter(fn: (r) => r._measurement == "data" and r._field == "_sum/ConsumptionActiveEnergy")
    |> map(
        fn: (r) => ({
            _time: r._time,
            _start: r._start,
            _stop: r._stop,
            _value: r._value,
        }),
    //|> first()
    )
    |> first()

dConMax = from(bucket: "ems")
    |> range(start: today())
    |> filter(fn: (r) => r._measurement == "data" and r._field == "_sum/ConsumptionActiveEnergy")
    |> map(
        fn: (r) => ({
            _time: r._time,
            _start: r._start,
            _stop: r._stop,
            _value: r._value,
        }),
    )
    |> last()
dCon = join(tables: {dConMin, dConMax}, on: ["_start"])
    |> map(
        fn: (r) => ({
            _time: today(),
            _measurement: "data",
            _field: "dailyCon",
            _value: r._value_dConMax - r._value_dConMin,
        }),
    )
    |> to(bucket: "tageswerte")

// Verkauf #############################################################
dSellMin = from(bucket: "ems")
    |> range(start: today())
    |> filter(fn: (r) => r._measurement == "data" and r._field == "_sum/GridSellActiveEnergy")
    |> map(
        fn: (r) => ({
            _time: r._time,
            _start: r._start,
            _stop: r._stop,
            _value: r._value,
        }),
    //|> first()
    )
    |> first()

dSellMax = from(bucket: "ems")
    |> range(start: today())
    |> filter(fn: (r) => r._measurement == "data" and r._field == "_sum/GridSellActiveEnergy")
    |> map(
        fn: (r) => ({
            _time: r._time,
            _start: r._start,
            _stop: r._stop,
            _value: r._value,
        }),
    )
    |> last()
dSell = join(tables: {dSellMin, dSellMax}, on: ["_start"])
    |> map(
        fn: (r) => ({
            _time: today(),
            _measurement: "data",
            _field: "dailySell",
            _value: r._value_dSellMax - r._value_dSellMin,
        }),
    )
    |> to(bucket: "tageswerte")

// Einkauf #############################################################
dBuyMin = from(bucket: "ems")
    |> range(start: today())
    |> filter(fn: (r) => r._measurement == "data" and r._field == "_sum/GridBuyActiveEnergy")
    |> map(
        fn: (r) => ({
            _time: r._time,
            _start: r._start,
            _stop: r._stop,
            _value: r._value,
        }),
    //|> first()
    )
    |> first()

dBuyMax = from(bucket: "ems")
    |> range(start: today())
    |> filter(fn: (r) => r._measurement == "data" and r._field == "_sum/GridBuyActiveEnergy")
    |> map(
        fn: (r) => ({
            _time: r._time,
            _start: r._start,
            _stop: r._stop,
            _value: r._value,
        }),
    )
    |> last()
dBuy = join(tables: {dBuyMin, dBuyMax}, on: ["_start"])
    |> map(
        fn: (r) => ({
            _time: today(),
            _measurement: "data",
            _field: "dailyBuy",
            _value: r._value_dBuyMax - r._value_dBuyMin,
        }),
    )
    //|>yield()
    |> to(bucket: "tageswerte")