Skip to content

History UI: visualization and export#29846

Merged
andig merged 11 commits into
masterfrom
feat/history_ui
May 15, 2026
Merged

History UI: visualization and export#29846
andig merged 11 commits into
masterfrom
feat/history_ui

Conversation

@naltatis
Copy link
Copy Markdown
Member

@naltatis naltatis commented May 12, 2026

refs #29144
fixes #29286
fixes #29827

Replaces the experimental PowerChart / EnergyChart fix timeframe charts with charts grouped by type.

🍱 data is shown on entity level (before grouped)
📆 proper time range select (see session ui)
🔵 ability to focus on one specific dataset (entity)
💽 csv download expandable data table for raw data debugging
🔢 round api values to Wh precision
🔌 home consumption and ext/aux meters are combined (similar to energy flow in main ui).
🛠️ replaces chart.js with echart (similar to forecast view)

Note: This is still an experimental view with strong focus on checking data correctness. These charts will likely be replaced with more compact higher level data visualizations. Deliberately kept simple for now. 🧪

Todos

Out of scope

  • Year view feels quite sluggish with large test dataset (see video). We'll need to improve sql performance for this later (time format)

Video

history.2.webm

Screenshots

day
day

day view dark mode
dark day 2

month
month

year
year

mobile consumers
mobile consumers

mobile grid
mobile grid

data view
data table muletipüle

data view, forecast diff
data table forecast diff

tooltip
tooltip

@naltatis naltatis added enhancement New feature or request ux User experience/ interface labels May 12, 2026
@naltatis naltatis mentioned this pull request May 12, 2026
6 tasks
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • In History.vue, fetchData captures requestFrom/to/period but still uses this.aggregate and updates rawSeries unconditionally, so if the user changes period/date quickly you can end up applying a stale response; consider deriving aggregate from the captured period and discarding responses that no longer match the current fetchKey.
  • The groupColor/groupExportColor helpers in History/groups.ts call window.getComputedStyle directly, which will throw in non-DOM environments (e.g., SSR or some tests); consider guarding access to window or injecting the colors via CSS variables into the Vue app instead.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In History.vue, `fetchData` captures `requestFrom/to/period` but still uses `this.aggregate` and updates `rawSeries` unconditionally, so if the user changes period/date quickly you can end up applying a stale response; consider deriving `aggregate` from the captured period and discarding responses that no longer match the current `fetchKey`.
- The `groupColor`/`groupExportColor` helpers in History/groups.ts call `window.getComputedStyle` directly, which will throw in non-DOM environments (e.g., SSR or some tests); consider guarding access to `window` or injecting the colors via CSS variables into the Vue app instead.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@andig
Copy link
Copy Markdown
Member

andig commented May 13, 2026

…und dann noch in die Hauptnavi damit?

@naltatis
Copy link
Copy Markdown
Member Author

…und dann noch in die Hauptnavi damit?

langsam, langsam :D
Erst wenn alle Teile sitzen.

@andig
Copy link
Copy Markdown
Member

andig commented May 13, 2026

Negative rounded caps look broken

Screenshot 2026-05-13 at 13 05 14

@andig
Copy link
Copy Markdown
Member

andig commented May 13, 2026

Units are broken- can't have 35kWh in 15min, Y axis needs unit

Screenshot 2026-05-13 at 13 06 28

@andig
Copy link
Copy Markdown
Member

andig commented May 13, 2026

Instead of individual source tables it might make more sense that we provide CSV download rather then inline tables of raw data? Compares to charging sessions these seem less valid.

What I'm missing is an aggregated chart of energy balance (or power), given I don't have an exact idea how it should look. Maybe containing power/energy per group.

@andig
Copy link
Copy Markdown
Member

andig commented May 13, 2026

Tooltips should be beside cursor, not hiding it.

Screenshot 2026-05-13 at 13 11 24

@naltatis
Copy link
Copy Markdown
Member Author

What I'm missing is an aggregated chart of energy balance (or power), given I don't have an exact idea how it should look. Maybe containing power/energy per group.

See my comment in the description. This is only an in between step with focus on individual measurements. I already have concepts and ideas for more integrated views, but we have to ensure that the basics are correct first.

Comment thread core/metrics/db_history.go Outdated
@naltatis
Copy link
Copy Markdown
Member Author

naltatis commented May 14, 2026

  • ensure tooltip is always above bar (similar to forecast chart behavior)
  • added y-axis unit, align tooltip values (day = kW, month/year = kWh)
Bildschirmfoto 2026-05-14 um 21 33 01 Bildschirmfoto 2026-05-14 um 21 32 56 Bildschirmfoto 2026-05-14 um 21 41 25

@naltatis
Copy link
Copy Markdown
Member Author

naltatis commented May 14, 2026

replace html table view with full csv download

download csv

history-energy-2026-03.csv

@naltatis
Copy link
Copy Markdown
Member Author

@sourcery-ai dismiss

@naltatis
Copy link
Copy Markdown
Member Author

🎨 updated device color palette

  • works in light/dark mode
  • reasonable contrast to neighbor colors
  • stays in blue/red-ish color range to avoid conflict with evcc system colors (battery, pv, grid, ...)
  • also applies to existing session chart
Bildschirmfoto 2026-05-14 um 23 07 39 Bildschirmfoto 2026-05-14 um 23 07 20

@naltatis naltatis changed the title History UI: visualization and data tables History UI: visualization and export May 15, 2026
@andig
Copy link
Copy Markdown
Member

andig commented May 15, 2026

updated device color palette

Do the colors match the charging sessions view?

@naltatis
Copy link
Copy Markdown
Member Author

The color palette is shared. We do not have stable color-to-device association yet. But with published names we could achieve this in a later iteration (extend session table).

@naltatis
Copy link
Copy Markdown
Member Author

Entity title resolution works:

  • yaml-configured meters show name
  • db-configured meters use title
  • loadpoints always use title
Bildschirmfoto 2026-05-15 um 17 13 24

Comment thread core/site.go
@andig andig merged commit 431b606 into master May 15, 2026
21 checks passed
@andig andig deleted the feat/history_ui branch May 15, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request ux User experience/ interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

History chart data vs axis scaling broken Problems with new History Feature

2 participants