feat: Explicit answer/reject for inbound calls (#2504)
This commit is contained in:
committed by
dermotduffy
parent
b9f09b7c4e
commit
f397596ed1
@@ -12,9 +12,18 @@ action: custom:advanced-camera-card-action
|
||||
| `action` | Must be `custom:advanced-camera-card-action`. |
|
||||
| `advanced_camera_card_action` | A supported Advanced Camera Card action. One of the below actions. |
|
||||
|
||||
## `call_answer`
|
||||
|
||||
Answer an inbound [two-way audio](../../../usage/2-way-audio.md) call that is currently ringing -- the same effect as pressing the green answer button on the in-call overlay. Has no effect if there is no inbound call or it has already been answered. To reject a ringing call instead, use [`call_end`](#call_end).
|
||||
|
||||
```yaml
|
||||
action: custom:advanced-camera-card-action
|
||||
advanced_camera_card_action: call_answer
|
||||
```
|
||||
|
||||
## `call_end`
|
||||
|
||||
End the [two-way audio](../../../usage/2-way-audio.md) call in progress. Has no effect if no call is active.
|
||||
End the [two-way audio](../../../usage/2-way-audio.md) call in progress or rejects a ringing inbound call. Has no effect if no call is active.
|
||||
|
||||
```yaml
|
||||
action: custom:advanced-camera-card-action
|
||||
|
||||
+31
-31
@@ -7,23 +7,23 @@ live:
|
||||
# [...]
|
||||
```
|
||||
|
||||
| Option | Default | Description |
|
||||
| ------------------------ | ---------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `actions` | | [Actions](actions/README.md) to use for the `live` view. |
|
||||
| `auto_mute` | `[unselected, hidden, microphone, call]` | A list of conditions in which live camera feeds are muted. `unselected` will automatically mute when a camera is unselected in the carousel or grid. `hidden` will automatically mute when the camera becomes hidden (e.g. browser tab change). `microphone` will automatically mute after the microphone is muted as long as the camera stays selected (see the `live.microphone.mute_after_microphone_mute_seconds` to control how long after). `call` will automatically mute the inbound audio when a [two-way audio](../usage/2-way-audio.md) call ends. Use an empty list (`[]`) to never automatically mute. Note that if `auto_play` is enabled, the stream may mute itself automatically in order to honor the `auto_play` setting, as some browsers will not auto play media that is unmuted -- that is to say, where necessary, the `auto_play` parameter will take priority over the `auto_mute` parameter. |
|
||||
| `auto_pause` | `[]` | A list of conditions in which live camera feeds are automatically paused. `unselected` will automatically pause when a camera is unselected in the carousel or grid. `hidden` will automatically pause when the browser/tab becomes hidden. Use an empty list (`[]`) to never automatically pause. **Caution**: Some live providers (e.g. `jsmpeg`) may not offer human-accessible means to resume play if it is paused, unless the `auto_play` option is used. |
|
||||
| `auto_play` | `[selected, visible]` | A list of conditions in which live camera feeds are automatically played. `selected` will automatically play when a camera is selected in a carousel or grid. `visible` will automatically play when a camera becomes visible (e.g. browser tab change, or visible in a grid but not selected). Use an empty list (`[]`) to never automatically play. Some live providers (e.g. `webrtc-card`, `jsmpeg`) do not support the prevention of automatic play on initial load, but should still respect the value of this parameter on play-after-pause. |
|
||||
| `auto_unmute` | `[microphone, call]` | A list of conditions in which live camera feeds are unmuted. `selected` will automatically unmute when a camera is selected in a carousel or grid. `visible` will automatically unmute when a camera becomes visible (e.g. a browser/tab change, or visible in a grid but not selected). `microphone` will automatically unmute after the microphone is unmuted. `call` will automatically unmute the inbound audio when a [two-way audio](../usage/2-way-audio.md) call starts, so the caller can be heard immediately. Use an empty list (`[]`) to never automatically unmute. Some browsers will not allow automated unmute until the user has interacted with the page in some way -- if the user has not then the browser may pause the media instead. |
|
||||
| `controls` | | Configuration for the `live` view controls. See [`controls`](#controls). |
|
||||
| `display` | | Controls whether to show a single or grid `live` view. See [`display`](#display). |
|
||||
| `draggable` | `true` | Whether or not the live carousel can be dragged left or right, via touch/swipe and mouse dragging. |
|
||||
| `lazy_load` | `true` | Whether or not to lazily load cameras in the camera carousel. Setting this to `false` will cause all cameras to load simultaneously when the `live` carousel is opened (or cause all cameras to load continually if `preload` is also `true`). This will result in a smoother carousel experience at a cost of (potentially) a substantial amount of continually streamed data. |
|
||||
| `lazy_unload` | `[]` | A list of conditions in which live camera feeds are unloaded. `unselected` will unload a camera when it is not visible in the carousel/grid and `hidden` will unload a camera when the browser itself is minimized or the browser tab changes. An empty list (`[]`, the default) will never automatically unload a stream once loaded unless the user navigates away entirely, so that it's always instantly visible on carousel scroll. Once unloaded, subsequently revisiting the camera will cause a reloading delay. Some live providers (e.g. `webrtc-card`) implement their own lazy unloading independently which may occur regardless of the value of this setting. |
|
||||
| `microphone` | | See [`microphone`](#microphone). |
|
||||
| `preload` | `false` | Whether or not to preload the live view. Preloading causes the live view to render in the background regardless of what view is actually shown, so it's instantly available when requested. The currently-selected camera's media is loaded in the background; other cameras follow the `lazy_load` setting (set `lazy_load: false` to preload them all). This consumes additional network/CPU resources continually. |
|
||||
| `show_image_during_load` | `true` | If `true`, during the initial stream load, the `image` live provider will be shown instead of the loading video stream. This still image will auto-refresh and is replaced with the live stream once loaded. |
|
||||
| `transition_effect` | `slide` | Effect to apply as a transition between live cameras. Accepted values: `slide` or `none`. |
|
||||
| `zoomable` | `true` | Whether or not the live carousel can be zoomed and panned, via touch/pinch and mouse scroll wheel with `ctrl` held. |
|
||||
| Option | Default | Description |
|
||||
| ------------------------ | ---------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `actions` | | [Actions](actions/README.md) to use for the `live` view. |
|
||||
| `auto_mute` | `[unselected, hidden, microphone, call]` | A list of conditions in which live camera feeds are muted. `unselected` will automatically mute when a camera is unselected in the carousel or grid. `hidden` will automatically mute when the camera becomes hidden (e.g. browser tab change). `microphone` will automatically mute after the microphone is muted as long as the camera stays selected (see the `live.microphone.mute_after_microphone_mute_seconds` to control how long after). `call` will automatically mute the inbound audio when an answered [two-way audio](../usage/2-way-audio.md) call ends. Use an empty list (`[]`) to never automatically mute. Note that if `auto_play` is enabled, the stream may mute itself automatically in order to honor the `auto_play` setting, as some browsers will not auto play media that is unmuted -- that is to say, where necessary, the `auto_play` parameter will take priority over the `auto_mute` parameter. |
|
||||
| `auto_pause` | `[]` | A list of conditions in which live camera feeds are automatically paused. `unselected` will automatically pause when a camera is unselected in the carousel or grid. `hidden` will automatically pause when the browser/tab becomes hidden. Use an empty list (`[]`) to never automatically pause. **Caution**: Some live providers (e.g. `jsmpeg`) may not offer human-accessible means to resume play if it is paused, unless the `auto_play` option is used. |
|
||||
| `auto_play` | `[selected, visible]` | A list of conditions in which live camera feeds are automatically played. `selected` will automatically play when a camera is selected in a carousel or grid. `visible` will automatically play when a camera becomes visible (e.g. browser tab change, or visible in a grid but not selected). Use an empty list (`[]`) to never automatically play. Some live providers (e.g. `webrtc-card`, `jsmpeg`) do not support the prevention of automatic play on initial load, but should still respect the value of this parameter on play-after-pause. |
|
||||
| `auto_unmute` | `[microphone, call]` | A list of conditions in which live camera feeds are unmuted. `selected` will automatically unmute when a camera is selected in a carousel or grid. `visible` will automatically unmute when a camera becomes visible (e.g. a browser/tab change, or visible in a grid but not selected). `microphone` will automatically unmute after the microphone is unmuted. `call` will automatically unmute the inbound audio when a [two-way audio](../usage/2-way-audio.md) call is answered (outbound calls are answered at start; inbound calls when the user accepts), so the caller can be heard. Use an empty list (`[]`) to never automatically unmute. Some browsers will not allow automated unmute until the user has interacted with the page in some way -- if the user has not then the browser may pause the media instead. |
|
||||
| `controls` | | Configuration for the `live` view controls. See [`controls`](#controls). |
|
||||
| `display` | | Controls whether to show a single or grid `live` view. See [`display`](#display). |
|
||||
| `draggable` | `true` | Whether or not the live carousel can be dragged left or right, via touch/swipe and mouse dragging. |
|
||||
| `lazy_load` | `true` | Whether or not to lazily load cameras in the camera carousel. Setting this to `false` will cause all cameras to load simultaneously when the `live` carousel is opened (or cause all cameras to load continually if `preload` is also `true`). This will result in a smoother carousel experience at a cost of (potentially) a substantial amount of continually streamed data. |
|
||||
| `lazy_unload` | `[]` | A list of conditions in which live camera feeds are unloaded. `unselected` will unload a camera when it is not visible in the carousel/grid and `hidden` will unload a camera when the browser itself is minimized or the browser tab changes. An empty list (`[]`, the default) will never automatically unload a stream once loaded unless the user navigates away entirely, so that it's always instantly visible on carousel scroll. Once unloaded, subsequently revisiting the camera will cause a reloading delay. Some live providers (e.g. `webrtc-card`) implement their own lazy unloading independently which may occur regardless of the value of this setting. |
|
||||
| `microphone` | | See [`microphone`](#microphone). |
|
||||
| `preload` | `false` | Whether or not to preload the live view. Preloading causes the live view to render in the background regardless of what view is actually shown, so it's instantly available when requested. The currently-selected camera's media is loaded in the background; other cameras follow the `lazy_load` setting (set `lazy_load: false` to preload them all). This consumes additional network/CPU resources continually. |
|
||||
| `show_image_during_load` | `true` | If `true`, during the initial stream load, the `image` live provider will be shown instead of the loading video stream. This still image will auto-refresh and is replaced with the live stream once loaded. |
|
||||
| `transition_effect` | `slide` | Effect to apply as a transition between live cameras. Accepted values: `slide` or `none`. |
|
||||
| `zoomable` | `true` | Whether or not the live carousel can be zoomed and panned, via touch/pinch and mouse scroll wheel with `ctrl` held. |
|
||||
|
||||
## `controls`
|
||||
|
||||
@@ -46,7 +46,7 @@ live:
|
||||
|
||||
### `call`
|
||||
|
||||
Configures the on-screen controls shown during a [two-way audio](../usage/2-way-audio.md) call. The overlay appears whenever a call is in progress and offers buttons to mute/unmute the microphone, mute/unmute the inbound audio, and end the call.
|
||||
Configures the on-screen controls shown during a [two-way audio](../usage/2-way-audio.md) call. The overlay appears whenever a call is in progress and offers buttons to answer calls (for inbound), end calls, mute/unmute the microphone and mute/unmute the inbound audio.
|
||||
|
||||
```yaml
|
||||
live:
|
||||
@@ -55,12 +55,12 @@ live:
|
||||
# [...]
|
||||
```
|
||||
|
||||
| Option | Default | Description |
|
||||
| ---------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `button_size` | `40` | The size of the call control buttons in pixels. Must be >= `20`. |
|
||||
| `lock` | `true` | Whether to lock the rest of the card controls/actions while a call is in progress. Prevents an accidental tap, swipe or action mid-call. Set to `false` to allow interactions regardless of call state. |
|
||||
| `ringtone` | | The audible chime played while an inbound call (e.g. one started by [`view.triggers.actions.trigger: call`](./view.md?id=trigger-action-configuration)) is ringing. Stops as soon as the microphone is un-muted (the "answer" gesture) or the call ends. Manual calls never ring. See [`ringtone`](#ringtone). |
|
||||
| `unanswered_timeout_seconds` | `60` | The number of seconds an inbound call may ring unanswered before it is automatically ended. The timer is cancelled the moment the microphone is un-muted. Set to `0` to disable the timeout. |
|
||||
| Option | Default | Description |
|
||||
| ---------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `button_size` | `40` | The size of the call control buttons in pixels. Must be >= `20`. |
|
||||
| `lock` | `true` | Whether to lock the rest of the card controls/actions while a call is in progress. Prevents an accidental tap, swipe or action mid-call. Set to `false` to allow interactions regardless of call state. |
|
||||
| `ringtone` | | The audible chime played while an inbound call (e.g. one started by [`view.triggers.actions.trigger: call`](./view.md?id=trigger-action-configuration)) is ringing. Stops as soon as the call is answered or ended. Manual calls never ring. See [`ringtone`](#ringtone). |
|
||||
| `unanswered_timeout_seconds` | `60` | The number of seconds an inbound call may ring unanswered before it is automatically ended. The timer is cancelled the moment the call is answered. Set to `0` to disable the timeout. |
|
||||
|
||||
> [!NOTE] Browser autoplay restrictions may prevent the ringtone from playing
|
||||
> until the page has received a user gesture (e.g. a tap or click). When that
|
||||
@@ -221,13 +221,13 @@ live:
|
||||
microphone:
|
||||
```
|
||||
|
||||
| Option | Default | Description |
|
||||
| ------------------------------------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `always_connected` | `false` | Whether or not to keep the microphone stream continually connected while the card is running, or only connect it when first needed (default) -- typically when a [two-way audio](../usage/2-way-audio.md) call is started. In the latter case there'll be a connection reset the first time the microphone connects -- using this option can avoid that reset. |
|
||||
| `auto_mute` | `[call]` | A list of conditions in which the microphone is muted. `unselected` will automatically mute the microphone when a camera is unselected in the carousel or grid. `hidden` will automatically mute the microphone when the card becomes hidden (e.g. browser/tab change). `call` will automatically mute the microphone when a [two-way audio](../usage/2-way-audio.md) call ends. Use an empty list (`[]`) to never automatically mute the microphone via these conditions. |
|
||||
| `auto_unmute` | `[]` | A list of conditions in which the microphone is unmuted. `selected` will automatically unmute the microphone when a camera is selected in the carousel or grid. `visible` will automatically unmute when the card becomes visible. `call` will automatically unmute the microphone when a [two-way audio](../usage/2-way-audio.md) call starts. By default this list is empty, so the microphone stays muted when a call starts (push-to-talk) -- tap the microphone button in the call overlay to talk. The microphone is still connected when the call starts (just left muted), so the browser may prompt for microphone permission at that point. |
|
||||
| `disconnect_seconds` | `90` | The number of seconds after microphone usage to disconnect the microphone from the stream. `0` implies never. Not relevant if `always_connected` is `true`. |
|
||||
| `mute_after_microphone_mute_seconds` | `60` | The number of seconds after the microphone mutes to automatically mute the inbound audio when `live.auto_mute` includes `microphone`. |
|
||||
| Option | Default | Description |
|
||||
| ------------------------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `always_connected` | `false` | Whether or not to keep the microphone stream continually connected while the card is running, or only connect it when first needed (default) -- typically when a [two-way audio](../usage/2-way-audio.md) call is started. In the latter case there'll be a connection reset the first time the microphone connects -- using this option can avoid that reset. |
|
||||
| `auto_mute` | `[call]` | A list of conditions in which the microphone is muted. `unselected` will automatically mute the microphone when a camera is unselected in the carousel or grid. `hidden` will automatically mute the microphone when the card becomes hidden (e.g. browser/tab change). `call` will automatically mute the microphone when an answered [two-way audio](../usage/2-way-audio.md) call ends. Use an empty list (`[]`) to never automatically mute the microphone via these conditions. |
|
||||
| `auto_unmute` | `[]` | A list of conditions in which the microphone is unmuted. `selected` will automatically unmute the microphone when a camera is selected in the carousel or grid. `visible` will automatically unmute when the card becomes visible. `call` will automatically unmute the microphone when a [two-way audio](../usage/2-way-audio.md) call is started (or answered for inbound calls). By default this list is empty, so the microphone stays muted even after answering (push-to-talk) -- tap the microphone button in the call overlay to talk. The microphone is still connected when the call starts (just left muted), so the browser may prompt for microphone permission at that point. |
|
||||
| `disconnect_seconds` | `90` | The number of seconds after microphone usage to disconnect the microphone from the stream. `0` implies never. Not relevant if `always_connected` is `true`. |
|
||||
| `mute_after_microphone_mute_seconds` | `60` | The number of seconds after the microphone mutes to automatically mute the inbound audio when `live.auto_mute` includes `microphone`. |
|
||||
|
||||
See [Using 2-way audio](../usage/2-way-audio.md) for more information about the very particular requirements that must be followed for 2-way audio to work.
|
||||
|
||||
|
||||
+25
-21
@@ -45,15 +45,20 @@ enabled by default and appears in the `live` view whenever the selected camera
|
||||
-- or one of its [dependencies](../configuration/cameras/README.md?id=dependencies)
|
||||
-- supports 2-way audio.
|
||||
|
||||
- Tap the call button to start a call. An on-screen overlay appears with
|
||||
controls to mute/unmute the microphone, mute/unmute the inbound audio, and end
|
||||
the call. When more than one 2-way-audio camera is available the button
|
||||
becomes a submenu with one entry per camera.
|
||||
- When a call starts the inbound audio is unmuted automatically, so the caller
|
||||
can be heard immediately. The microphone stays muted by default
|
||||
(push-to-talk) -- tap the microphone button in the overlay to speak. This is
|
||||
configurable via [`live.microphone.auto_unmute`](../configuration/live.md?id=microphone)
|
||||
and [`live.auto_unmute`](../configuration/live.md).
|
||||
- Tap the call button to start an **outbound** call. An on-screen overlay
|
||||
appears with controls to mute/unmute the microphone, mute/unmute the inbound
|
||||
audio, and end the call. When more than one 2-way-audio camera is available
|
||||
the button becomes a submenu with one entry per camera.
|
||||
- **Inbound** calls (started by a
|
||||
[`view.triggers.actions.trigger: call`](../configuration/view.md?id=trigger-action-configuration)
|
||||
trigger -- e.g. a doorbell) open the overlay in a ringing state with only
|
||||
two buttons: a red **Reject** and a green **Answer**.
|
||||
- When a call is answered (outbound calls are answered by definition) the
|
||||
inbound audio is unmuted automatically, so the caller can be heard. The
|
||||
microphone stays muted by default (push-to-talk) -- tap the microphone button
|
||||
in the overlay to speak. Both behaviors are configurable via
|
||||
[`live.microphone.auto_unmute`](../configuration/live.md?id=microphone) and
|
||||
[`live.auto_unmute`](../configuration/live.md).
|
||||
- The camera will always load _without_ the microphone connected, unless the
|
||||
[`always_connected`](../configuration/live.md?id=microphone) microphone option
|
||||
is set to `true`. On the first call there may be a brief `webrtc` connection
|
||||
@@ -69,8 +74,9 @@ enabled by default and appears in the `live` view whenever the selected camera
|
||||
seconds specified by [`disconnect_seconds`](../configuration/live.md?id=microphone)
|
||||
have elapsed since the call ended.
|
||||
|
||||
Calls can also be started and ended programmatically with the
|
||||
[`call_start`](../configuration/actions/custom/README.md?id=call_start) and
|
||||
Calls can also be controlled programmatically with the
|
||||
[`call_start`](../configuration/actions/custom/README.md?id=call_start),
|
||||
[`call_answer`](../configuration/actions/custom/README.md?id=call_answer), and
|
||||
[`call_end`](../configuration/actions/custom/README.md?id=call_end) actions --
|
||||
for example, from an [automation](../configuration/automations.md) that fires
|
||||
when a doorbell sensor triggers. The [`call` condition](../configuration/conditions.md?id=call)
|
||||
@@ -84,13 +90,13 @@ The diagram below traces a call from start to finish:
|
||||
|
||||
## Talking with a single tap
|
||||
|
||||
By default, two taps are needed to speak: the call button starts the call (so
|
||||
you can hear), then the microphone button in the call overlay unmutes your
|
||||
microphone (so you can be heard). This push-to-talk default keeps the microphone
|
||||
muted until you explicitly choose to speak.
|
||||
By default, two taps are needed to speak: start (or answer) the call so you can
|
||||
hear, then unmute the microphone via the in-call overlay so you can be heard.
|
||||
This push-to-talk default keeps the microphone muted until you explicitly choose
|
||||
to speak.
|
||||
|
||||
To collapse that to a single tap, unmute the microphone automatically when a
|
||||
call starts:
|
||||
call is answered:
|
||||
|
||||
```yaml
|
||||
live:
|
||||
@@ -98,9 +104,7 @@ live:
|
||||
auto_unmute: ['call']
|
||||
```
|
||||
|
||||
The call button then behaves as a toggle -- one tap starts the call and opens
|
||||
the microphone, a second tap ends the call and closes it again. Note this also
|
||||
opens the microphone for calls started by an
|
||||
[automation](../configuration/automations.md); leave
|
||||
For outbound calls the microphone opens the moment the call starts; for inbound
|
||||
calls it opens the moment you press the green answer button. Leave
|
||||
[`auto_unmute`](../configuration/live.md?id=microphone) empty (the default) to
|
||||
always start muted.
|
||||
always start muted regardless.
|
||||
|
||||
Reference in New Issue
Block a user