Echart problem with oh-aggregate-series

Well understood.

Looking forward to 5.2 stable to test this fix.

Thanks a lot.

If you want to give it a try right now, you can try to get the development server of Main UI up and running, it proxies the API requests to your openHAB server, but allows to see the latest version of the UI. For more details, see openhab-webui/bundles/org.openhab.ui/CONTRIBUTING.md at main · openhab/openhab-webui · GitHub.

@florian-h05

Not sure this is another small bug…

oh-aggregate-series smallest timeblock to display is 1h → that’s why I created 2 influx “measurements” = series for testing purposes:

  • measurement 1: Sampling 1 minute
  • measurement 2: Sampling 1 hour

aggregationFunction: diff_last for both series.

I wanted to be sure Sampling 1h is sufficient (it should be) and would lead to exactly the same bars, irrespective whether charttype is “year”, “month”, “week” or “day”.

The good news are that the bars seem to match EXCEPT for the very first timeblock being the first hour of the period to aggregate.

Sampling 1h leads to value 0 in hour 0. (IS THIS A BUG?)

There is definitely data prior to hour 0 to which the aggregationFunction: diff_last can be applied to.

That missing value impacts “week” and “month” on the FIRST DAY displayed.

In type “year” the month of January would also be impacted, however, that missing hour is not visible.

The 0.7 kWh that are missing in hour 0 (upper chart) seem to be the difference on day 1 with 21 vs. 20 kWh (lower chart9).

edit:
The timestamp for hour 0 is exactly at 00:00:00. diff_last should then use value from prev timestamp that would be 23:00:00.

> SELECT * FROM "energy_meter_home_total_1h" WHERE time >= '2026-05-11T23:30:00Z' AND time < '2026-05-12T00:30:00Z'
name: energy_meter_home_total_1h
time                 value
----                 -----
2026-05-12T00:00:00Z 36486.84939

@florian-h05

with markLine we can display e.g. average value of all bars of a series displayed.

Is there a way to display the sum of all bars of a series displayed?
(-> Energy per day, week, month or year)

(Apologies for asking this here, but couldn’t find anything on this matter in the forum)

@florian-h05

did you have a chance to look into this?

Thank you!

No, except for the aggregation one level above the current level (i.e. if you want the sum for all hours of the day, choose a aggregation by day and display weekly/monthly charts).

That data from 23:00:00 isn’t fetched, as the chart starts at 00:00:00.
We need the UI to request the data for the previous time block so it can properly calculate.
I’ll look into this.

Can you give this a PR a try? (You only need Node.js and npm installed.)

I’d be happy to test this, but honestly, I don’t know how to? I’d need some kind of step-by-step instructions…

Not yet installed, but I can manage that…

What openHAB version do you use? I can provide you a JAR.

5.1.4

Where should the JAR then go? Add-ons?

Anything else to be done?

I can only provide a JAR that runs on top of 5.2.0 milestones. Probably best to wait for the 5.2.0 Release or RCs and upgrade to them.

No, for the UI it is a bit more complicated.

Find out the bundle ID of the UI bundle:

> bundle:list -l org.openhab.ui
START LEVEL 100 , List Threshold: 50
 ID │ State  │ Lvl │ Version            │ Location
────┼────────┼─────┼────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
229 │ Active │  80 │ 5.2.0.202606242105 │ mvn:org.openhab.ui.bundles/org.openhab.ui/5.2.0-SNAPSHOT

Save the location - you need it to restore the original bundle.

With the bundle ID:

bundle:update 229 file:///path/to/the/jar/org.openhab.ui-5.2.0-SNAPSHOT.jar

Here is a link to the JAR:
https://www.swisstransfer.com/d/0caac54a-c76f-4fdf-af20-892d10985d2b

Will the fix be part of 5.2.0 release (stable)?

No — we are close to the code freeze and I consider the PR to risky to merge it now. We can merge it after 5.2.0 and if it works fine backport it to 5.2.1.

How would I restore the original bundle from 5.1.4 or 5.2 (in case I upgrade from 5.1.4 to 5.2)?

bundle:update BUNDLE_ID SAVED_LOCATION

Good news - the bug is fixed… Thanks a lot!

One observation: The chart height is much smaller compared to 5.1.4.
Is this caused by changes in 5.2.0? (Sorry, I haven’t spent time analysing changes in 5.2.0 yet)

Will this be part of 5.2.1?

Thanks for reporting back :+1:

I’ll now submit it for review and advise to backport it – so it should become part of it.

@florian-h05 Is this related to 5.2?

I don’t know.