docs: Add worked examples for showing a folder as a camera's media (#2521)
Related: #2498
This commit is contained in:
committed by
dermotduffy
parent
12ae3b216c
commit
209c873c58
@@ -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
|
||||
|
||||
|
||||
@@ -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`
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user