feat: Add 'call' support to improve 2-way audio experience (#2486)

Draws significant inspiration (and direct styling) from
https://github.com/dermotduffy/advanced-camera-card/pull/2447 . Thank
you @Maudfer !

BREAKING CHANGE:

The microphone condition previously bundled two unrelated signals —
whether a two-way-audio session was connected and whether the microphone
was muted. Connection state is now its own dedicated call condition, and
microphone is reserved purely for mute state. Configs are upgraded
automatically (the card rewrites affected conditions under overrides,
elements, and automations). If you maintain config by hand, convert as
follows:

If you only used connected:

# Before
```yaml
condition: microphone
connected: true
```

# After
```yaml
condition: call
call: true
```
If you used both connected and muted — they must be split into two
conditions, since they no longer live together:

# Before
```yaml
condition: microphone
connected: true
muted: false
```

# After
```yaml
condition: and
conditions:
  - condition: call
    call: true
  - condition: microphone
    muted: false
```
This commit is contained in:
Dermot Duffy
2026-06-30 17:45:13 -07:00
committed by dermotduffy
parent bb061a1a55
commit abcba884e5
116 changed files with 3871 additions and 845 deletions
@@ -12,6 +12,34 @@ 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_end`
End the [two-way audio](../../../usage/2-way-audio.md) call in progress. Has no effect if no call is active.
```yaml
action: custom:advanced-camera-card-action
advanced_camera_card_action: call_end
```
## `call_start`
Start a [two-way audio](../../../usage/2-way-audio.md) call.
```yaml
action: custom:advanced-camera-card-action
advanced_camera_card_action: call_start
# [...]
```
| Parameter | Description |
| ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `action` | Must be `custom:advanced-camera-card-action`. |
| `advanced_camera_card_action` | Must be `call_start`. |
| `camera` | An optional [camera ID](../../cameras/README.md?id=cameras) to make the call from. If omitted, the selected camera is used. |
| `stream` | An optional [camera ID](../../cameras/README.md?id=cameras) of a 2-way-audio [dependency](../../cameras/README.md?id=dependencies) of `camera`. If omitted, the first eligible stream is used. |
The call starts only if a 2-way-audio-capable stream can be resolved and the browser grants microphone access; otherwise a notification explains why. While the call is in progress an on-screen overlay is shown and (by default) disruptive actions are locked -- see [`live.controls.call`](../../live.md?id=call).
## `camera_select`
Select a given camera.
@@ -683,6 +711,19 @@ advanced_camera_card_action: unmute
```yaml
elements:
- type: custom:advanced-camera-card-menu-icon
icon: mdi:phone
title: Start a two-way audio call
tap_action:
action: custom:advanced-camera-card-action
advanced_camera_card_action: call_start
camera: camera.front_door
- type: custom:advanced-camera-card-menu-icon
icon: mdi:phone-hangup
title: End a two-way audio call
tap_action:
action: custom:advanced-camera-card-action
advanced_camera_card_action: call_end
- type: custom:advanced-camera-card-menu-icon
icon: mdi:alpha-a-circle
title: Select Front Door