[PR #516] [MERGED] Dayahead fixes and improvements for 15-minute intervals #4965

Closed
opened 2026-03-21 01:08:42 +01:00 by sascha_hemi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/OpenEPaperLink/OpenEPaperLink/pull/516
Author: @benv666
Created: 10/20/2025
Status: Merged
Merged: 10/20/2025
Merged by: @nlimper

Base: masterHead: master


📝 Commits (1)

  • 91953b8 Feat: dayahead fixes and improvements

📊 Changes

2 files changed (+594 additions, -44 deletions)

View changed files

📝 ESP32_AP-Flasher/src/contentmanager.cpp (+571 -44)
📝 ESP32_AP-Flasher/wwwroot/content_cards.json (+23 -0)

📄 Description

Summary

This PR contains several fixes and improvements to support the new 15-minute data interval for the dayahead electricty feed.

Details

The observed problem was simple:

  • the new data format had so many samples that it would clutter the X-axis labels
  • this amount of samples would also lead to the bar-width becoming invisble on certain displays/times when displaying all data - especially when new data became available

The fix is less trivial, since it requires making a choice:

  • Do we filter (average) data? If so, how?
  • Or do we display less data, and so what DO we show?

To keep our options open, this PR introduces a few new settings:

Display Interval

  • native - will not do any averaging of data, but this can lead to bars becoming too small to display. When this happens the new code first tries to display all future data. (truncating at the end if necessary). In case it fits and there is spare room (but not enough room to make the bars larger), it will start showing more historic data when available.
  • 30 minutes - will average incoming data to 30 minute intervals. Due to this resulting in less data this will lead to bigger bars, with the caveat that the user is looking at averaged prices. This can be confusing at times. The "current price" indictator always shows the actual price, not averaged. However, this only makes sense if your update interval is set to 30 minutes or less.
  • 1 hour - will average incoming data to 60 minute intervals. This can display 2 days of data like the pre-15 minute intervals, at the cost of being even less accurate.

Cheap Block hours
This is a new feature, which when enabled will display two grey blocks in the x-axis labels indicating thew lowest future consecutive block of X hours. This feature is useful to determine when it's a good time to run an appliance such as a dishwasher, or charge your car.
Set to 0 to disable, the default setting is 3 hours per block.

Update Interval
Previously the update interval was fixed to 3600 seconds. However, with the new intervals it makes sense for people to update every 15 minutes. But since this means a 4-fold increase, this won't be for everyone.
The setting defaults to 15 minutes, but users that want less frequent updates (possibly combined with other display intervals) they can enter a different amount here.

Other changes:

  • X-Axis labels are now placed dynamically to adjust based on the displayed data
  • "Current"-indicator restyled, the old line on top of the bar is not nice with smaller bars
  • Bar sizes and spacing are more dynamic to allow smaller bars with more data displayed.

Testing

This shows two 2.9" displays with on the top left the "30-min" setting active, the bottom left using the "1 hour" interval, and the 4.2" using the native interval.
image

While it works for me (tm), I can only test with the hardware I have available.

Feedback welcome.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/OpenEPaperLink/OpenEPaperLink/pull/516 **Author:** [@benv666](https://github.com/benv666) **Created:** 10/20/2025 **Status:** ✅ Merged **Merged:** 10/20/2025 **Merged by:** [@nlimper](https://github.com/nlimper) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (1) - [`91953b8`](https://github.com/OpenEPaperLink/OpenEPaperLink/commit/91953b8f94b9400d5be9f1b25fe6ea464d2e3d6d) Feat: dayahead fixes and improvements ### 📊 Changes **2 files changed** (+594 additions, -44 deletions) <details> <summary>View changed files</summary> 📝 `ESP32_AP-Flasher/src/contentmanager.cpp` (+571 -44) 📝 `ESP32_AP-Flasher/wwwroot/content_cards.json` (+23 -0) </details> ### 📄 Description ### Summary This PR contains several fixes and improvements to support the new 15-minute data interval for the dayahead electricty feed. ### Details The observed problem was simple: * the new data format had so many samples that it would clutter the X-axis labels * this amount of samples would also lead to the bar-width becoming invisble on certain displays/times when displaying all data - especially when new data became available The fix is less trivial, since it requires making a choice: * Do we filter (average) data? If so, how? * Or do we display less data, and so what DO we show? To keep our options open, this PR introduces a few new settings: **Display Interval** * `native` - will not do any averaging of data, but this *can* lead to bars becoming too small to display. When this happens the new code first tries to display all *future* data. (truncating at the end if necessary). In case it fits and there is spare room (but not enough room to make the bars larger), it will start showing more historic data when available. * `30 minutes` - will average incoming data to 30 minute intervals. Due to this resulting in less data this will lead to bigger bars, with the caveat that the user is looking at averaged prices. This can be confusing at times. The "current price" indictator always shows the *actual* price, not averaged. However, this only makes sense if your update interval is set to 30 minutes or less. * `1 hour` - will average incoming data to 60 minute intervals. This can display 2 days of data like the pre-15 minute intervals, at the cost of being even less accurate. **Cheap Block hours** This is a new feature, which when enabled will display two grey blocks in the x-axis labels indicating thew lowest future consecutive block of X hours. This feature is useful to determine when it's a good time to run an appliance such as a dishwasher, or charge your car. Set to `0` to disable, the default setting is `3` hours per block. **Update Interval** Previously the update interval was fixed to 3600 seconds. However, with the new intervals it makes sense for people to update every 15 minutes. But since this means a 4-fold increase, this won't be for everyone. The setting defaults to `15` minutes, but users that want less frequent updates (possibly combined with other display intervals) they can enter a different amount here. Other changes: * X-Axis labels are now placed dynamically to adjust based on the displayed data * "Current"-indicator restyled, the old line on top of the bar is not nice with smaller bars * Bar sizes and spacing are more dynamic to allow smaller bars with more data displayed. ### Testing This shows two 2.9" displays with on the top left the "30-min" setting active, the bottom left using the "1 hour" interval, and the 4.2" using the native interval. <img width="1679" height="742" alt="image" src="https://github.com/user-attachments/assets/d04d26df-ebcc-4317-bf4f-71fde0ac6982" /> While it works for me (tm), I can only test with the hardware I have available. Feedback welcome. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
sascha_hemi added the pull-request label 2026-03-21 01:08:42 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/OpenEPaperLink#4965