feat: add problem detection framework for common problems (#2412)
Introduces a ProblemManager that detects and surfaces actionable issues (stale config, legacy frigate-hass-card resources, slow/failed streams) via status bar indicators and notification popups with fix actions.
This commit is contained in:
@@ -156,6 +156,7 @@ elements:
|
||||
| `priority` | `50` | The item priority. Higher priority items are ordered closer to the start of the status bar (i.e. an item with priority `70` will order further to the left than an item with priority `60`). Minimum `0`, maximum `100`. |
|
||||
| `severity` | | An optional severity level, one of `low`, `medium` or `high`. Colors the item accordingly. |
|
||||
| `sufficient` | `false` | Whether or not this item is sufficient to display the status bar if it's otherwise hidden (e.g. with the `popup` [status bar style](../../status-bar.md)). |
|
||||
| `title` | | An optional tooltip shown on hover. |
|
||||
|
||||
## `status-bar-image`
|
||||
|
||||
@@ -178,6 +179,7 @@ elements:
|
||||
| `priority` | `50` | The item priority. Higher priority items are ordered closer to the start of the status bar (i.e. an item with priority `70` will order further to the left than an item with priority `60`). Minimum `0`, maximum `100`. |
|
||||
| `severity` | | An optional severity level, one of `low`, `medium` or `high`. Colors the item accordingly. |
|
||||
| `sufficient` | `false` | Whether or not this item is sufficient to display the status bar if it's otherwise hidden (e.g. with the `popup` [status bar style](../../status-bar.md)). |
|
||||
| `title` | | An optional tooltip shown on hover. |
|
||||
|
||||
## `status-bar-string`
|
||||
|
||||
@@ -200,6 +202,7 @@ elements:
|
||||
| `priority` | `50` | The item priority. Higher priority items are ordered closer to the start of the status bar (i.e. an item with priority `70` will order further to the left than an item with priority `60`). Minimum `0`, maximum `100`. |
|
||||
| `severity` | | An optional severity level, one of `low`, `medium` or `high`. Colors the item accordingly. |
|
||||
| `sufficient` | `false` | Whether or not this item is sufficient to display the status bar if it's otherwise hidden (e.g. with the `popup` [status bar style](../../status-bar.md)). |
|
||||
| `title` | | An optional tooltip shown on hover. |
|
||||
|
||||
## Fully expanded reference
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ status_bar:
|
||||
| --------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `position` | `bottom` | Whether to place the status bar at the `top` or `bottom` of the card. |
|
||||
| `popup_seconds` | `3` | The number of seconds to display the status bar when using the `popup` style. |
|
||||
| `height` | `46` | The height of the status bar in pixels. |
|
||||
| `height` | `40` | The height of the status bar in pixels. |
|
||||
| `items` | | Whether to show or hide built-in status bar items. See [`items`](#items). |
|
||||
| `style` | `popup` | The status bar style to show by default, one of `none`, `hover`, `hover-card`, `overlay`, `outside` or `popup`. See [`style`](#style). |
|
||||
|
||||
@@ -28,14 +28,16 @@ status_bar:
|
||||
|
||||
### Available Items
|
||||
|
||||
| Button name | Description |
|
||||
| ------------ | ------------------------------------------------------------------------------------------- |
|
||||
| `engine` | The icon of the camera engine for the relevant camera. |
|
||||
| `resolution` | The detected media resolution (if any). |
|
||||
| `severity` | The media severity indicator (if any) for review severity (e.g. Frigate alerts/detections). |
|
||||
| `technology` | The detected media technology (if any). |
|
||||
| `title` | The media title. |
|
||||
| `upgrade` | An indicator that appears when a configuration upgrade is available. |
|
||||
| Button name | Description |
|
||||
| ---------------------------- | ------------------------------------------------------------------------------------------- |
|
||||
| `engine` | The icon of the camera engine for the relevant camera. |
|
||||
| `problem_config_upgrade` | An indicator that appears when a configuration upgrade is available. |
|
||||
| `problem_legacy_resource` | An indicator that appears when a legacy `frigate-hass-card` resource is still registered. |
|
||||
| `problem_stream_not_loading` | An indicator that appears when a live stream has not loaded within 10 seconds. |
|
||||
| `resolution` | The detected media resolution (if any). |
|
||||
| `severity` | The media severity indicator (if any) for review severity (e.g. Frigate alerts/detections). |
|
||||
| `technology` | The detected media technology (if any). |
|
||||
| `title` | The media title. |
|
||||
|
||||
### Options for each item
|
||||
|
||||
@@ -68,12 +70,21 @@ This card supports several menu styles.
|
||||
status_bar:
|
||||
position: bottom
|
||||
popup_seconds: 3
|
||||
height: 46
|
||||
height: 40
|
||||
style: popup
|
||||
items:
|
||||
engine:
|
||||
enabled: true
|
||||
priority: 50
|
||||
problem_config_upgrade:
|
||||
enabled: true
|
||||
priority: 50
|
||||
problem_legacy_resource:
|
||||
enabled: true
|
||||
priority: 50
|
||||
problem_stream_not_loading:
|
||||
enabled: true
|
||||
priority: 50
|
||||
resolution:
|
||||
enabled: true
|
||||
priority: 50
|
||||
@@ -86,7 +97,4 @@ status_bar:
|
||||
title:
|
||||
enabled: true
|
||||
priority: 50
|
||||
upgrade:
|
||||
enabled: true
|
||||
priority: 50
|
||||
```
|
||||
|
||||
+34
-11
@@ -2,23 +2,46 @@
|
||||
|
||||
## Highlighted Issues
|
||||
|
||||
### Duplicate versions / Duplicate element registrations / `Custom element not found: advanced-camera-card`
|
||||
### Legacy dashboard resource detected
|
||||
|
||||
If your card appears to not load anymore (but was working previously), you're
|
||||
seeing the version of the card changing between reloads, or seeing log entries
|
||||
like:
|
||||
You still have the old `frigate-hass-card.js` resource registered in your
|
||||
dashboard (and not `advanced-camera-card.js`). Having both registered causes
|
||||
duplicate element registration errors and unpredictable behavior. Symptoms
|
||||
include the card not loading, the version changing between reloads, or log
|
||||
entries like:
|
||||
|
||||
`Failed to execute 'define' on 'CustomElementRegistry': the name "focus-trap" has already been used with this registry window`
|
||||
|
||||
Verify that your dashboard resources contain only a single instance of the card
|
||||
(for HACS users, you should see only `/hacsfiles/advanced-camera-card/`. If you
|
||||
_also_ see `/hacsfiles/frigate-card/`, remove it, clear your caches and reload).
|
||||
To fix:
|
||||
|
||||
Steps:
|
||||
1. Edit your dashboard (click the three-dot menu in the top right) and select
|
||||
**Manage Resources**.
|
||||
1. Remove any entry referring to `frigate-hass-card`. You should only have a
|
||||
single entry for `advanced-camera-card`.
|
||||
1. Optionally, delete the `frigate-hass-card` directory on your filesystem if
|
||||
present (e.g. `$HA_PATH/www/community/frigate-hass-card`), as long as an
|
||||
`advanced-camera-card` directory exists there too.
|
||||
1. Clear your browser cache and reload.
|
||||
|
||||
1. Edit your dashboard -> (Three dots menu) -> `Manage Resources`. Remove any line item that refers to `frigate-hass-card`. You should only have a single row entry for `advanced-camera-card`.
|
||||
1. [Optionally] You can delete the frigate-hass-card directory on your filesystem if present, e.g. `$HA_PATH/www/community/frigate-hass-card`, as long as it has an `advanced-camera-card` directory there too.
|
||||
1. Clear all your caches.
|
||||
If you are an admin user and the card detects both resources are registered, an
|
||||
alert icon will appear in the status bar -- clicking it will display a
|
||||
notification with a button to automatically remove the legacy resource.
|
||||
|
||||
### Configuration upgrade available
|
||||
|
||||
If you see a notification that a configuration upgrade is available, it means
|
||||
your card configuration uses an older format that can be automatically updated.
|
||||
|
||||
To upgrade:
|
||||
|
||||
1. Open your Home Assistant dashboard.
|
||||
1. Click the pencil icon to enter edit mode.
|
||||
1. Click the three-dot menu on your card and choose **Edit**.
|
||||
1. In the card editor, click the **Automatic Upgrade** button at the top.
|
||||
1. Review the changes and save.
|
||||
|
||||
If the automatic upgrade button is not visible, your configuration may already
|
||||
be up to date. Try clearing your browser cache and reloading.
|
||||
|
||||
### Stream does not load
|
||||
|
||||
|
||||
Reference in New Issue
Block a user