Add initial keyboard shortcut support.
This commit is contained in:
@@ -26,7 +26,7 @@ cameras_global:
|
||||
| `engine` | `auto` | The camera engine to use. If `auto` the card will attempt to choose the correct engine from the specified options. See [Engine](engine.md). |
|
||||
| `frigate` | | Options for Frigate cameras. See [Frigate camera engine configuration](engine.md?id=frigate). |
|
||||
| `icon` | Autodetected from `camera_entity` if that is specified. | The icon to use for this camera in the camera menu and in the next & previous controls when using the `icon` style. |
|
||||
| `id` | `camera_entity`, `webrtc_card.entity` or `frigate.camera_name` if set (in that preference order). | An optional identifier to use throughout the card configuration to refer unambiguously to this camera. This `id` may be used in [conditions](../conditions.md), dependencies or custom [actions](../actions.md) to refer to a given camera unambiguously. |
|
||||
| `id` | `camera_entity`, `webrtc_card.entity` or `frigate.camera_name` if set (in that preference order). | An optional identifier to use throughout the card configuration to refer unambiguously to this camera. This `id` may be used in [conditions](../conditions.md), dependencies or custom [actions](../actions/README.md) to refer to a given camera unambiguously. |
|
||||
| `live_provider` | `auto` | The choice of live stream provider. See [Live Provider](live-provider.md).|
|
||||
| `title` | Autodetected from `camera_entity` if that is specified. | A friendly name for this camera to use in the card. |
|
||||
| `triggers` | | Define what should cause this camera to update/trigger. See below. |
|
||||
@@ -176,6 +176,66 @@ See [media layout examples](../../examples.md?id=media-layout).
|
||||

|
||||
|
||||
|
||||
## `ptz`
|
||||
|
||||
Configure the PTZ actions taken for a camera (not to be confused with configuration of the PTZ _controls_, see [Live PTZ Controls](../live.md?id=ptz) or [Media Viewer PTZ Controls](../media-viewer.md?id=ptz)). Manually configured actions override any auto-detected actions.
|
||||
|
||||
```yaml
|
||||
cameras:
|
||||
- camera_entity: camera.office
|
||||
ptz:
|
||||
[...]
|
||||
```
|
||||
|
||||
### Movement types
|
||||
|
||||
Generally PTZ cameras/integrations may support two kinds of PTZ actions:
|
||||
|
||||
* `relative`: Single relative steps, e.g. "Pan to the left one step".
|
||||
* `continuous`: Separate start and stop, e.g. "Start panning to the left", following by a later command "Stop panning".
|
||||
|
||||
The card supports both, and with the help of the
|
||||
`r2c_delay_between_calls_seconds` and `c2r_delay_between_calls_seconds` can
|
||||
translate between them where necessary. See the [ONVIF
|
||||
specification](https://www.onvif.org/specs/srv/ptz/ONVIF-PTZ-Service-Spec.pdf)
|
||||
for more details on the distinction between `relative` and `continuous`.
|
||||
|
||||
The card UI (e.g. PTZ controls) will always try to call the `continuous` variety
|
||||
to allow for precise/smooth controls, and if unavailable will translate multiple
|
||||
`relative` steps with optional delays between each step. Manually configured
|
||||
[actions](../actions/README.md) may be configured to call either variety.
|
||||
|
||||
?> Frigate auto-detected PTZ actions will always be `continuous` as this is what
|
||||
the integration currently offers.
|
||||
|
||||
### Parameters
|
||||
|
||||
| Option | Default | Description |
|
||||
| - | - | - |
|
||||
| `actions_left`, `actions_right`, `actions_up`, `actions_down`, `actions_zoom_in`, `actions_zoom_out`, `actions_home` | Set by camera [engine](./engine.md) of the selected camera | The [call-service](../actions/stock/README.md?id=call-service) action that will be called for each PTZ action for relative movements. |
|
||||
| `actions_left_start`, `actions_left_stop`, `actions_right_start`, `actions_right_stop`,`actions_up_start`, `actions_up_stop`,`actions_down_start`, `actions_down_stop`,`actions_zoom_in_start`, `actions_zoom_in_stop`,`actions_zoom_out_start`, `actions_zoom_out_stop` | Set by camera [engine](./engine.md) of the selected camera | The [call-service](../actions/stock/README.md?id=call-service) action that will be called for each PTZ action for continous movements. Both a `_start` and `_stop` variety must be provided for an action to be usable. |
|
||||
| `c2r_delay_between_calls_seconds` | `0.2` | When the camera is configured with continuous actions only (e.g. `left_start` and `left_stop`, but not `left`), if something requests a relative action (e.g. a manually configured [action](../actions/README.md)), then `start` will be called, followed by a delay of this number of seconds and finally `stop` will be called. Cameras / integrations that are slower to respond to continuous steps may need to increase this value to avoid the continuous motion being too small. Cameras / integrations that are rapid to respond may need to decrease this value to avoid the "relative step" being too large. |
|
||||
| `data_left`, `data_right`, `data_up`, `data_down`, `data_zoom_in`, `data_zoom_out`, `data_home` | | Shorthand for relative actions that call the service defined by the `service` parameter, with the data provided in this argument. Internally, this is just translated into the longer-form `actions_[action]`. If both `actions_X` and `data_X` are specified, `actions_X` takes priority. This is compatible with [AlexxIT's WebRTC Card PTZ configuration](https://github.com/AlexxIT/WebRTC/wiki/PTZ-Config-Examples). |
|
||||
| `data_left_start`, `data_left_stop`, `data_right_start`, `data_right_stop`, `data_up_start`, `data_up_stop`, `data_down_start`, `data_down_stop`, `data_zoom_in_start`, `data_zoom_in_stop`, `data_zoom_out_start`, `data_zoom_out_stop` | | Shorthand for continuous actions that call the service defined by the `service` parameter, with the data provided in this argument. Internally, this is just translated into the longer-form `actions_[action]_start` and `actions_[action]_stop`. If both `actions_X_*` and `data_X_*` are specified, `actions_X_*` takes priority. This is compatible with [AlexxIT's WebRTC Card PTZ configuration](https://github.com/AlexxIT/WebRTC/wiki/PTZ-Config-Examples). Both a `_start` and `_stop` variety must be provided for an action to be usable. |
|
||||
| `presets` | | PTZ preset actions. See below. |
|
||||
| `r2c_delay_between_calls_seconds` | `0.5` | When the camera is configured with relative actions only (e.g. `left` but not `left_start` and `left_stop`), if something requests a continuous action (e.g. the card PTZ controls have a button held down), then a delay of this number of seconds will be inserted between each call of the relative action. Cameras / integrations that are slower to respond to relative steps may need to increase this value to avoid multiple simultaneous actions being sent. Cameras / integrations that are rapid to respond may need to decrease this value to increase the appearance of one single continuous motion. |
|
||||
| `service` | | An optional Home Assistant service to call when the `data_` parameters are used. |
|
||||
|
||||
### `presets`
|
||||
|
||||
Configures named PTZ presets. If a preset of this name is auto-detected, these configured actions will take precedence.
|
||||
|
||||
```yaml
|
||||
cameras:
|
||||
- camera_entity: camera.office
|
||||
ptz:
|
||||
presets:
|
||||
[preset_name]:
|
||||
[action]:
|
||||
```
|
||||
|
||||
`[action]` is any [call-service](../actions/stock/README.md?id=call-service) action.
|
||||
|
||||
## `triggers`
|
||||
|
||||
The `triggers` block configures what triggers a camera. Triggering can be used
|
||||
@@ -314,6 +374,61 @@ cameras:
|
||||
pan:
|
||||
x: 50
|
||||
y: 50
|
||||
- camera_entity: camera.manual-ptz
|
||||
ptz:
|
||||
c2r_delay_between_calls_seconds: 0.2
|
||||
r2c_delay_between_calls_seconds: 0.5
|
||||
# Relative action (only `left` shown)
|
||||
actions_left:
|
||||
action: call-service
|
||||
service: service.of_your_choice
|
||||
data:
|
||||
device: '048123'
|
||||
cmd: left
|
||||
# Continuous action (only `right` shown)
|
||||
actions_right_start:
|
||||
action: call-service
|
||||
service: service.of_your_choice
|
||||
data:
|
||||
device: '048123'
|
||||
cmd: right
|
||||
phase: start
|
||||
actions_right_stop:
|
||||
action: call-service
|
||||
service: service.of_your_choice
|
||||
data:
|
||||
device: '048123'
|
||||
phase: stop
|
||||
# Equivalent relative short form (only `up` shown)
|
||||
service: service.send_command
|
||||
data_up:
|
||||
device: '048123'
|
||||
cmd: up
|
||||
# Equivalent continuous short form (only `down` shown)
|
||||
service: service.send_command
|
||||
data_up_start:
|
||||
device: '048123'
|
||||
cmd: down
|
||||
phase: start
|
||||
data_up_stop:
|
||||
device: '048123'
|
||||
cmd: down
|
||||
phase: stop
|
||||
presets:
|
||||
# Preset using long form.
|
||||
armchair:
|
||||
action: call-service
|
||||
service: service.of_your_choice
|
||||
data:
|
||||
device: '048123'
|
||||
cmd: preset
|
||||
preset: armchair
|
||||
# Preset using short form.
|
||||
service: service.of_your_choice
|
||||
window:
|
||||
device: '048123'
|
||||
cmd: preset
|
||||
preset: window
|
||||
cameras_global:
|
||||
live_provider: ha
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user