Home Assistant requests in a task, progress bar, Plex page, bitmap cache

- net/ha_api: the HTTP requests run in a FreeRTOS task on core 0; loop()
  only hands over copies through queues. The web UI's test button polls.
  No more 3-4 s loop() stalls once a minute; timeout raised to 5 s.
- Progress bar page element (page format 4, v3 pages are converted)
- Plex user setting (settings v6): {plex_user} in entity ids
- Plex page (examples): watchers, play/pause icon, title, progress
- Bitmaps cached in RAM: a LittleFS read took ~100 ms on every render
  and web preview; long JSON lists sent in 2 KB pieces
- Backup includes the refresh settings and the Plex user

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mangavalkandClaude Opus 5.5 committed 2026-10-16 16:17:23 +02:00
1 parent 090c2bf8ae
commit 490cefc360
42 files changed
+1074 -175

No files matched your search

+20 -2
View File
@@ -37,8 +37,10 @@ its attributes, as a number (multiplier, decimals, auto unit, without minus sign
duration, a time from a timestamp, or with own texts per state (see the
[web UI](web-ui.md#pages)).
**Home Assistant values** on the shown page are read every minute (one entity per loop,
at most about 3 s). An unknown or unreachable value shows `--`. The display only changes
**Home Assistant values** on the shown page are read every minute, one entity at a time,
by a task of their own (on the ESP32's other core), so a slow or unreachable Home
Assistant never holds up the display or the web UI. An unknown or unreachable value shows
`--`. The display only changes
when the shown text changes, so round values with the decimals setting.
## Rules
@@ -47,3 +49,19 @@ The [schedule](web-ui.md#schedule) can bring a page to the front from a Home Ass
state, e.g. the 3D printer page while `sensor.mainsailos_current_print_state` is
`printing`. Each rule is read at its own interval; when Home Assistant can't be reached it
is read once a minute at most, so the display keeps running.
## Plex and Tautulli
The **Plex** page (in [examples/home-pages.json](../examples/home-pages.json)) uses Home
Assistant's Plex and Tautulli integrations, no extra firmware:
- `sensor.mangavalkserver` (Plex): how many are watching.
- `sensor.{plex_user}_state` (Tautulli, per user): `playing`, `paused`, ... chooses the icon
(bitmaps `plex playing`, `plex paused`, `plex buffering`).
- `sensor.{plex_user}_full_title` and `sensor.{plex_user}_progress` (Tautulli, per user):
the title and the progress bar. Home Assistant creates these disabled: enable them on
the Tautulli user's device in Home Assistant.
`{plex_user}` is the Plex user set in the web UI (Home Assistant tab), written the way Home
Assistant puts it in entity ids (`MangaValk` -> `mangavalk`). A rule (Schedule tab) adds
the page to the rotation while `sensor.mangavalkserver` is above 0.
+1
View File
@@ -20,3 +20,4 @@ the others are the example pages in [examples/home-pages.json](../examples/home-
| **Datum**: weekday and date | ![Datum](../Pictures/pages/datum.png) |
| **Aftellen**: countdown to Christmas | ![Aftellen](../Pictures/pages/aftellen.png) |
| **Stopwatch** | ![Stopwatch](../Pictures/pages/stopwatch.png) |
| **Plex**: how many watch, play/pause, title (scrolls) and progress of the Plex user ([Tautulli](home-assistant.md#plex-and-tautulli)) | ![Plex](../Pictures/pages/plex.png) |
+5 -3
View File
@@ -36,9 +36,11 @@ arrow keys. Built-in pages can be copied, not changed. See the [pictures of the
| Countdown | To a date and time: smart (`12 dagen`, `5 uur`, `34 min`, `0:45`), days, `12d 04:05`, with seconds; a text when it has passed |
| Stopwatch | `4:05`, `0:04`, `0:04:05`; started in the [Stopwatch](#stopwatch) tab or Home Assistant |
| Image | A bitmap at a position, fixed or chosen by a Home Assistant state (`weer ` + `cloudy` = the bitmap `weer cloudy`) |
| Progress bar | Filled from the left by a Home Assistant number: value x multiplier / "full at" (a percentage: full at 100). Width, height, with or without a frame |
Every element has a position, alignment, font and overlay (on top, box that clears the
dots behind it, inverted). Texts can scroll in a window at a chosen speed and can contain
dots behind it, inverted). Entity ids can contain `{plex_user}`, replaced by the Plex user
of the Home Assistant tab (e.g. `sensor.{plex_user}_state`). Texts can scroll in a window at a chosen speed and can contain
the degree sign. Fonts: Small (3x5), Normal (5x7), Large (5x7 doubled), Full height (19 dot
digits), and your own: upload a TTF/OTF, choose the height in dots, the browser converts
it.
@@ -98,8 +100,8 @@ switches either off); test patterns; the status LED.
MQTT: on/off, broker, port, user, password (changing these restarts the ESP32; an empty
broker uses `secrets.h`). The URL and long-lived access token for the values on dynamic
pages and the rules (REST API, plain http; empty URL: `http://<broker>:8123`). See
[Home Assistant](home-assistant.md).
pages and the rules (REST API, plain http; empty URL: `http://<broker>:8123`). The Plex
user for `{plex_user}` in entity ids. See [Home Assistant](home-assistant.md).
![Home Assistant](../Pictures/web-ui/home-assistant.png)