diff --git a/docs/configuration/cameras/README.md b/docs/configuration/cameras/README.md index a3e1707e..4fb4df4d 100644 --- a/docs/configuration/cameras/README.md +++ b/docs/configuration/cameras/README.md @@ -180,12 +180,12 @@ cameras: # [...] ``` -| Option | Default | Description | -| ------------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `type` | `auto` | The default media type to show for this camera. One of `auto`, `events`, `recordings`, `reviews` or `folder`. See [Media Types](#media-types) for description of each. | -| `events_type` | `all` | If `type` is `events`, what subtype of events to show. One of `clips`, `snapshots` or `all` (default). | -| `reviewed` | `unreviewed` | Whether to filter the media based on review status. One of `unreviewed` (default, shows only unreviewed media), `reviewed` (shorts only reviewed media) or `all` (show regardless of whether reviewed or unreviewed). Only relevant when `type` is `reviews` or `auto`. | -| `folders` | | An optional list of folder IDs to use when `type` is `folder`. If not specified, and `type` is `folder`, will default to showing the default (first) configured folder. See [Folder Configuration](../folders.md). | +| Option | Default | Description | +| ------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `type` | `auto` | The default media type to show for this camera. One of `auto`, `events`, `recordings`, `reviews` or `folder`. See [Media Types](#media-types) for description of each. | +| `events_type` | `all` | If `type` is `events`, what subtype of events to show. One of `clips`, `snapshots` or `all` (default). | +| `reviewed` | `unreviewed` | Whether to filter the media based on review status. One of `unreviewed` (default, shows only unreviewed media), `reviewed` (shorts only reviewed media) or `all` (show regardless of whether reviewed or unreviewed). Only relevant when `type` is `reviews` or `auto`. | +| `folders` | | An optional list of folder IDs to use when `type` is `folder`. If not specified, and `type` is `folder`, will default to showing the default (first) configured folder. See [Folder Configuration](../folders.md) and the [worked example](../../examples.md?id=show-a-folder-as-a-cameras-default-media). | ### Media Types diff --git a/docs/configuration/folders.md b/docs/configuration/folders.md index 40177ea7..182678fe 100644 --- a/docs/configuration/folders.md +++ b/docs/configuration/folders.md @@ -12,13 +12,13 @@ folders: # [...] ``` -| Option | Default | Description | -| ------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | | An optional folder `id` which can be used by [camera `media` configuration](./cameras/README.md#media) or [`folder` actions](./actions/custom/README.md?id=folder) to show a particular folder's contents. | -| `ha` | | Options for `ha` folder types. See [`ha`](#ha). | -| `icon` | | An optional folder icon. | -| `title` | | An optional folder title. | -| `type` | `ha` | The type of folder, `ha` for Home Assistant media folders (currently the only supported type of folder). | +| Option | Default | Description | +| ------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | | An optional folder `id` which can be used by [camera `media` configuration](./cameras/README.md#media) (see [worked example](../examples.md?id=show-a-folder-as-a-cameras-default-media)) or [`folder` actions](./actions/custom/README.md?id=folder) to show a particular folder's contents. | +| `ha` | | Options for `ha` folder types. See [`ha`](#ha). | +| `icon` | | An optional folder icon. | +| `title` | | An optional folder title. | +| `type` | `ha` | The type of folder, `ha` for Home Assistant media folders (currently the only supported type of folder). | ## `ha` diff --git a/docs/examples.md b/docs/examples.md index 70bf914e..5ea866f9 100644 --- a/docs/examples.md +++ b/docs/examples.md @@ -601,6 +601,68 @@ folders: regexp: 'Person.*' ``` +### Show a folder as a camera's default media + +By default a camera shows its own events / recordings. Setting [`media.type: +folder`](./configuration/cameras/README.md?id=media) instead makes a configured +folder the camera's default media, so its contents drive the timeline and +gallery. This is useful when the camera's interesting media (e.g. detection +clips) only lives in a Home Assistant media folder rather than being exposed as +native events. + +The camera references the folder by its `id`. Parsing a `startdate` from each +item lets the timeline place the media in time. + +```yaml +type: custom:advanced-camera-card +cameras: + - camera_entity: camera.reolink_doorbell + media: + type: folder + folders: + - reolink-detections +folders: + - id: reolink-detections + type: ha + ha: + # Open HA -> Media, navigate into the desired folder and copy its URL here. + url: https://my-ha-instance.local/media-browser/browser/app%2Cmedia-source%3A%2F%2Freolink/playlist%2Cmedia-source%3A%2F%2Freolink%2FCAM%7C01J8XAATNH77WE5D654K07KY1F%7C0 + path: + # Match every item in the folder and parse its start time. + - parsers: + - type: startdate +``` + +### Show only matching items as a camera's default media + +The card can only point at folders the Home Assistant Media browser actually +exposes. If your integration surfaces a single flat list of recordings rather +than a dedicated folder per event type, you can add a [`title` +matcher](./configuration/folders.md?id=matchers) to keep only the items you care +about (in this example clips whose title mentions `Person` or `Vehicle`). + +```yaml +type: custom:advanced-camera-card +cameras: + - camera_entity: camera.reolink_doorbell + media: + type: folder + folders: + - reolink-detections +folders: + - id: reolink-detections + type: ha + ha: + url: https://my-ha-instance.local/media-browser/browser/app%2Cmedia-source%3A%2F%2Freolink/playlist%2Cmedia-source%3A%2F%2Freolink%2FCAM%7C01J8XAATNH77WE5D654K07KY1F%7C0 + path: + - matchers: + # Keep only clips whose title mentions a person or vehicle detection. + - type: title + regexp: Person|Vehicle + parsers: + - type: startdate +``` + ## `go2rtc` This example will use a custom `go2rtc` server, automatically proxying the video