fix: Give media that is still loading a grace period before rebuilding (#2739)

- Related: #2718
This commit is contained in:
Dermot Duffy
2026-08-30 15:40:24 -07:00
committed by GitHub
parent 04c2da6379
commit bb6794ac49
11 changed files with 320 additions and 41 deletions
+4 -4
View File
@@ -50,10 +50,10 @@ view:
# [...]
```
| Option | Default | Description |
| ------------------ | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `interaction_mode` | `all` | Whether scheduled retries should happen when the card is being interacted with. If `all`, retries will always happen regardless. If `inactive` retries will only happen if the card has _not_ had human interaction recently (as defined by `view.interaction_seconds`). If `active` retries will only happen if the card _has_ had human interaction recently. User-initiated retries are always allowed. |
| `retry_seconds` | `auto` | Controls automatic retry attempts when an issue is detected (e.g. media not loading, query error). When `auto`, the card uses an exponential backoff schedule starting at ~30 seconds and capped at 10 minutes, with jitter to avoid multiple cards retrying in lockstep. A positive number sets a fixed retry interval in seconds. `0` disables automatic retries entirely. User-initiated retries (e.g. clicking a notification) always run regardless. |
| Option | Default | Description |
| ------------------ | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `interaction_mode` | `all` | Whether scheduled retries should happen when the card is being interacted with. If `all`, retries will always happen regardless. If `inactive` retries will only happen if the card has _not_ had human interaction recently (as defined by `view.interaction_seconds`). If `active` retries will only happen if the card _has_ had human interaction recently. User-initiated retries are always allowed. |
| `retry_seconds` | `auto` | Controls automatic retry attempts when an issue is detected (e.g. media not loading, query error). When `auto`, the card uses an exponential backoff schedule starting at ~5 seconds and capped at 10 minutes, with jitter to avoid multiple cards retrying in lockstep. A positive number sets a fixed retry interval in seconds. `0` disables automatic retries entirely. User-initiated retries (e.g. clicking a notification) always run regardless. This value controls how often a retry is attempted rather than whether a given problem is _ready_ to be retried: media that has failed is retried on this schedule, whereas media that is merely still loading is left alone for a grace period first, since restarting it would discard a load that is still in progress (see [media unavailable](../troubleshooting.md?id=media-unavailable)). |
## `keyboard_shortcuts`
+9 -1
View File
@@ -85,12 +85,20 @@ appears in the status bar. The card retries automatically with a back-off (and
the notification offers a manual retry button). A live stream additionally
reconnects on its own once its camera becomes available again.
A retry rebuilds the media from scratch, discarding the prior attempt. Media
that is merely loading slowly has not failed -- it is still loading -- so
restarting it would throw away the very attempt that may be about to succeed. A
camera reported as **Media not loading** is therefore left running for at least
30 seconds after that message appears before the card rebuilds it, unlike media
that has _actually_ failed, which is rebuilt as soon as the schedule allows. The
manual retry button rebuilds immediately regardless.
Reported reasons why media may be unavailable:
| Reason | Meaning |
| ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Camera entity unavailable** | The camera's `camera_entity` reported `unavailable` in Home Assistant, e.g. the camera or its integration (such as Frigate) restarted, or the camera lost power or network. A short grace period is allowed before this is reported, and the card recovers automatically once the entity returns. Set [`always_error_if_entity_unavailable`](./configuration/cameras/README.md?id=cameras) to report it immediately instead. |
| **Media not loading** | The media did not finish loading within the expected time: a slow or failed initial load. Applies to live streams, the viewer, and image views. |
| **Media not loading** | The media did not finish loading within the expected time: a slow or failed initial load. Applies to live streams, the viewer, and image views. Nothing has necessarily failed yet, so the card keeps waiting on the existing load attempt already underway rather than restarting it immediately. |
| **Playback error** | The live provider reported an error while trying to play the stream. |
| **Stream stalled** | The stream loaded and was playing, but stopped delivering new frames with no error raised (a silent freeze). The card notices the lack of progress and reconnects. |