Commit Graph
100 Commits
Author SHA1 Message Date
Dermot Duffy 5d247d4074 test: Add browser based tests for keyboard focus handling (#2647) 2026-08-02 16:38:17 -07:00
Dermot Duffy 17146c8ca6 fix: Clear the initialized condition state when the card is not usable (#2646)
The `initialized` state (used in conditions/triggers) was written once
and never cleared, so it meant "has this card ever been initialized"
while everything reading it took it as "is this card usable now". Home
Assistant takes a card off the page and puts it back whenever its
dashboard tab is left and returned to, so the card initialized again
while the state claimed it was initialized throughout: `trigger:
initialized` fired once per card rather than once per startup, and
automations were dropped in between.

The card lifecycle is now an explicit state machine (`SessionManager`),
the only writer of `initialized`, which separates a card that is
starting up from one initializing part of itself again while it runs. A
new `ever` parameter (conditions/triggers) selects the old latched
behaviour.

`remote_control` uses that parameter to keep its two camera priorities
correct under repeated starts. With `camera_priority: entity` the card
now re-reads the entity every time it starts, so a camera selected while
the card was away is picked up on return. With `camera_priority: card`
the card writes the entity on its first start only, unchanged, since
repeating that write would overwrite a camera the user had selected.

Closes: #2642


BREAKING CHANGE: `condition: initialized` is now `false` whenever the
card is not usable, and `trigger: initialized` fires each time the card
starts up rather than only the first time. Set `ever: true` on either to
keep the previous behaviour.
2026-08-02 12:52:58 -07:00
Dermot Duffy e590f72783 test: Add a browser based test harness (#2641) 2026-07-31 10:16:58 -07:00
Dermot Duffy 51c0fab1ce fix: Do not activate pan & zoom on a detached element (#2640)
- Closes: #2633
2026-07-30 21:33:37 -07:00
Dermot Duffy f24064689a fix: Restore keyboard focus for key triggers (#2634) (#2639)
- Closes #2634
2026-07-30 20:52:54 -07:00
Dermot Duffy a736f3dfaf fix: Ensure a bare ptz_digital action resets the zoom (#2635)
- Closes: #2632
2026-07-29 23:18:06 -07:00
Dermot Duffy e9e6d9f833 feat: Use the card's own pan & zoom with the webrtc-card live provider (#2630)
- Closes: #2628
2026-07-29 15:46:03 -07:00
Dermot Duffy 70abb39762 fix: Stop the webrtc-card provider recreating its player on every render (#2629)
- Closes: #2625
2026-07-29 13:11:12 -07:00
Dermot Duffy 15b08db3e8 fix: Clear stale media unavailable errors when a camera recovers (#2627)
- Closes: #2576
2026-07-28 21:21:50 -07:00
Dermot Duffy 231e3087b7 fix: Error when a zoomable element is removed during zoom initialization (#2624)
- Closes: #2410
2026-07-26 20:54:07 -07:00
Dermot Duffy ad89aa9538 test: Split test utilities to improve test times (#2622) 2026-07-26 16:29:53 -07:00
Dermot Duffy 8d44fcecf1 fix: Ignore startup triggers from cameras without the trigger capability (#2621)
- Closes: #2103
2026-07-26 15:37:59 -07:00
Dermot Duffy 0f8593f9fa feat: Answer or reject inbound calls from menu (#2620)
- For: #2587
2026-07-26 14:24:14 -07:00
Dermot Duffy ababe133a8 chore: Switch coverage from istanbul to the v8 provider for speed (#2619) 2026-07-26 14:21:27 -07:00
Dermot Duffy 3b8835ee7c feat: Allow disabling the call controls (#2615)
- For: #2587
2026-07-26 11:35:18 -07:00
Dermot Duffy 0c3d46ad3d chore: Upgrade to Vitest 4 and regroup tests for performance (#2618) 2026-07-26 11:28:58 -07:00
Dermot Duffy a0fd464d23 test: Remove unnecessary jsdom environment declarations (#2616) 2026-07-25 22:47:59 -07:00
Dermot Duffy eccf7f3b97 ci: Upload the bundle treemap visualization browser-viewable (#2617) 2026-07-25 22:47:06 -07:00
Dermot Duffy 37b07f079d chore: Run checks, tests and build as parallel jobs (#2614) 2026-07-25 22:01:53 -07:00
Dermot Duffy c4c6058a70 test: Split the test suite into isolation groups for faster runs (#2613) 2026-07-25 21:47:13 -07:00
Dermot Duffy 8f953547b1 fix: Connect the microphone when an inbound call is *answered* (#2609) (#2612)
- Closes: #2609
2026-07-25 20:56:07 -07:00
Dermot Duffy 2a84f199de fix: Size the expanded dialog and grid columns to their content (#2611)
- Closes #2607
2026-07-25 13:46:31 -07:00
Dermot Duffy 5f2c7f5e4e fix: Prevent the media grid from collapsing when its cells are unchanged (#2608)
- For: #2306
2026-07-24 18:06:35 -07:00
Dermot Duffy 0a763b73a6 docs: Add config example for problematic doorbells (#2604) 2026-07-24 10:55:45 -07:00
Dermot Duffy f419798e8e fix: Exponentially back off initialization-error retries (#2579) (#2605)
- Closes #2579
2026-07-24 10:54:31 -07:00
Dermot Duffy 54f75beb9d fix: Improve media_query retry behavior (#2603) 2026-07-23 22:19:17 -07:00
Dermot Duffy 6817d27c91 fix: Guard the ha provider MJPEG stream URL against a missing access_token (#2602)
- Closes: #2601
2026-07-23 09:42:05 -07:00
Dermot Duffy cd53ebd3c8 fix: Correctly bind MJPEG stream URL in the ha live provider (#2305) (#2600)
- Closes: #2305
2026-07-22 22:00:47 -07:00
Dermot Duffy 448fa2d9f1 feat: Surface the provider's error cause in the media_unavailable notification (#2599)
- Closes: #2592
2026-07-22 20:45:49 -07:00
Dermot Duffy 5a549c0326 fix: Prevent microphone auto-disconnect during calls and restore the removed microphone connected condition (#2597)
- Closes: #2590
2026-07-22 16:12:31 -07:00
Dermot Duffy 8c36637092 fix: Only report a live error from the visible ha-camera-stream player (#2596)
- Closes: #2583
2026-07-22 13:45:46 -07:00
Dermot Duffy 7d66c5f005 chore: Replace ts-prune with knip (#2595)
- Closes: #2593
2026-07-22 13:26:34 -07:00
Dermot Duffy 2ca4aa95e5 chore: Replace deprecated 'node' module resolution with 'bundler' and tighten compiler options (#2594) 2026-07-22 12:12:00 -07:00
Dermot Duffy 87ecbc7e45 feat: Trigger automations on call answered, rejected and hung up (#2591) 2026-07-22 11:11:57 -07:00
Dermot Duffy f28b16a4b5 feat: Compress related editor fields into grid rows (#2589) 2026-07-21 22:31:13 -07:00
Dermot Duffy e29c0826cf feat: Add a simple mode to the visual card editor (#2588) 2026-07-21 19:13:29 -07:00
Dermot Duffy b6e1de5999 feat: Modernize the visual card editor. (#2586) 2026-07-20 20:44:16 -07:00
Dermot Duffy e204ec183f fix: Correct status bar alignment in Safari (#2581)
- Closes  #2578
2026-07-15 14:28:47 -07:00
Dermot Duffy c02c692f68 feat: Add experimental rewrite of go2rtc live provider (MSE/WebRTC/MP4/MJPEG) (#2580)
- Closes #2556
- Closes #2450

**Key intended features:**
 - go2rtc compatible
- 100% test coverage to significantly improve ability to test, maintain
and work around browser weirdnesses (e.g. Safari).
 - Written from the ground up in the style of the rest of the project.

**To use:**
 - Change `live_provider` from `go2rtc` to `go2rtc-experimental`.
2026-07-14 14:22:41 -07:00
Dermot Duffy 5662e48c22 test: Add regression test for media info stability (#2571)
- Relates to: #2563
2026-07-08 11:24:18 -07:00
Dermot Duffy fb1bbc739e feat: Automatically recover from frozen live streams (#2569)
- Closes: #2099
2026-07-07 21:37:24 -07:00
Dermot Duffy 9f956fe89f fix: Match state trigger/condition semantics to HA (#2565)
* Closes #2530
2026-07-04 10:23:51 -07:00
Dermot Duffy 3494706225 fix: Use auto_unmute as input to stream selection for HA (#2562)
- Closes #2479
2026-07-03 08:19:11 -07:00
Dermot Duffy 6a6d65d5c5 fix: Highlight folder icon for correct folder / media (#2560)
- Closes: #2128 
 - Closes: #2129
2026-07-02 10:26:30 -07:00
dermotduffy 3bb5ccd14f chore: Add missing close keyword: close #2529 (#2427) 2026-06-30 21:40:44 -07:00
dermotduffy 8ebb88cde9 chore: Add missing close keyword: close #2438 (#2468) 2026-06-30 21:40:44 -07:00
dermotduffy 3a78a8d3e9 chore: Add missing close keyword: close #2525 (#2553) 2026-06-30 21:40:43 -07:00
Dermot Duffy 937ba647a7 fix: Fix audio for cameras with mixed WebRTC/HLS capabilities (#2557)
- Closes #2479
2026-06-30 17:45:13 -07:00
Dermot Duffy 5c97e55a56 fix: Honor configured home preset / merge presets. (#2553)
- Closes:
https://github.com/dermotduffy/advanced-camera-card/issues/2525
2026-06-30 17:45:13 -07:00
Dermot Duffy d833edb65b perf: lazy-load js-yaml (~107KB) as needed (#2551)
- Closes: #2532
2026-06-30 17:45:13 -07:00
Dermot Duffy 3fe5e4004a fix: prevent infinite re-render loop from issue retry callbacks (#2550) 2026-06-30 17:45:13 -07:00
Dermot Duffy c3d3dd3934 chore: Update ha-nunjucks to 1.6.2 (#2549)
- Replaces:
https://github.com/dermotduffy/advanced-camera-card/pull/2515
2026-06-30 17:45:13 -07:00
Dermot Duffy ea251ca988 perf(bundle): lazy-load the nunjucks template engine (#2535)
Closes #2531.

## Summary

The full `nunjucks` templating engine (~226KB) plus `ha-nunjucks`
(~46KB) — roughly **272KB, ~13% of the eager entry chunk** — was
statically imported and downloaded by every card on initial load, even
though templates only apply when a config value contains a `{{ … }}` /
`{% … %}` delimiter. Most cards use no templates and never need the
engine.

This defers the engine behind a dynamic `import('ha-nunjucks/dist')` so
it ships in a separate, on-demand chunk instead of the eager
`card-*.js`.

## Approach

The render path (`TemplateRenderer.renderRecursively`) is **kept
synchronous** — it is called from many synchronous hot paths
(condition/trigger evaluators, picture-elements rendering, actions,
folder matchers), and making it async would be a large, high-risk
refactor of the evaluation core.

Instead:

- **New `src/card-controller/templates/engine.ts`** — a module-level
singleton lazy loader (`loadTemplateEngine()` / `getTemplateEngine()`)
shared across all `TemplateRenderer` instances, plus a
`containsTemplate()` delimiter helper.
- **Delimiter gating** — strings without a delimiter never touch the
engine (the overwhelming majority of renders).
- **Pre-warm at config time** — because every template string originates
in the config, a new mandatory `TEMPLATE_ENGINE` initialization aspect
loads the engine before first render whenever the config contains a
delimiter. This **guarantees no raw `{{ … }}` flash**: content/condition
rendering is blocked until the engine is present for template-using
cards. Cards without templates never load it.

## Result

- nunjucks + ha-nunjucks move out of the eager chunk into a separate
chunk fetched only when a card actually uses templates.
- No change to the synchronous public render API; condition/trigger
evaluation core untouched.

## Tests

- New `engine.ts` loader coverage (concurrent load, cached reuse,
not-loaded fallback).
- The 11 existing test files that render real (delimiter-bearing)
templates declare their dependency explicitly via
`beforeAll(loadTemplateEngine)` — no global/implicit setup hook.
- Full suite green (4764 tests), lint and ts-prune clean, per-file 100%
coverage maintained for the affected directories.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_016ykWemdkZrgywvC71pHc6c

---
_Generated by [Claude
Code](https://claude.ai/code/session_016ykWemdkZrgywvC71pHc6c)_
2026-06-30 17:45:13 -07:00
Dermot Duffy 7dc29865b8 chore: Enforce consistent type imports via @typescript-eslint/consistent-type-imports (#2545) 2026-06-30 17:45:13 -07:00
Dermot Duffy a87e5b8eeb chore: Enforce interfaces for object types (#2544) 2026-06-30 17:45:13 -07:00
Dermot Duffy c8e7fdd808 chore: Add typechecking and pruning to CI (#2543) 2026-06-30 17:45:13 -07:00
Dermot Duffy a96dc2e863 chore: Enforce import order via @ianvs/prettier-plugin-sort-imports (#2542) 2026-06-30 17:45:13 -07:00
Dermot Duffy 95f35bd326 refactor: Accept unknown in errorToConsole to drop as Error casts (#2541) 2026-06-30 17:45:13 -07:00
Dermot Duffy fcef48e75a test: Silence superfluous console output during test runs (#2540) 2026-06-30 17:45:13 -07:00
Dermot Duffy 921d45e577 chore: Enforce a few house rules via eslint (#2539) 2026-06-30 17:45:13 -07:00
Dermot Duffy 5572ec728e refactor: Centralize template render type assertion (#2538) 2026-06-30 17:45:13 -07:00
Dermot Duffy a31816c168 feat: Add event-based automation triggers (#2537) 2026-06-30 17:45:13 -07:00
Dermot DuffyandClaude Opus 4.8 b701366762 feat: Align automations with Home Assistant triggers and conditions (#2527)
Split automations into HA-style `triggers`, ongoing `conditions`, and
`actions`, with compatibility migrations for existing Advanced Camera
Card configs.

## Summary

At a glance (details below):

- **Added** `triggers:` -- a required, HA-shaped block: stock `state` /
`numeric_state` / `template` plus card-specific triggers (`camera`,
`view`, `fullscreen`, ...).
- **Added** the HA-native `if` / `then` / `else` action.
- **Removed** `actions_not` (replaced by `if` / `then` / `else`).
- **Removed** the ambient `advanced_camera_card` template namespace (use
`acc` instead).
- **Changed** the trigger template surface to a top-level `trigger.*`
variable (as in HA); the nested `acc.trigger.*` paths are removed.
- **Changed** `conditions:` to ongoing gates only -- they no longer wake
an automation, and change-only forms (`config`, valueless `camera` /
`view` / `state`) become triggers, not conditions.
- **Changed** action templates to render per step, so a later action
sees state an earlier one changed.
- **Compatibility:** HA-shaped YAML is accepted (singular keys,
single-or-list, `and` / `or` / `not` shorthand, `entity` / `entity_id`).
- **Migration:** existing configs upgrade automatically; anything that
cannot be converted faithfully is recorded under `__UPGRADE_FAILURE__`
for manual fixup.

## Breaking Changes

### 1. Automations now require triggers

Before this PR, `automations[].conditions` served two roles:

- They decided whether the automation should run.
- They also acted as the thing that woke the automation up.

After this PR:

- `triggers` wake the automation.
- `conditions` only gate it at the instant a trigger fires.

Most existing automations are migrated automatically from `conditions:`
to `triggers:`.

### 2. `actions_not` is retired

Legacy `actions_not` is replaced by an HA-style `if` action with `then`
/ `else`.

Faithful conversions are automatic. Cases that cannot be faithfully
converted are recorded under `__UPGRADE_FAILURE__.automations` and must
be migrated manually.

### 3. Template surface aligned with Home Assistant

Two related template changes, both auto-migrated:

- **Top-level `trigger.*`.** Automation actions now receive a top-level
`trigger` template variable, like Home Assistant. Legacy nested paths
such as `acc.trigger.state.to` and
`advanced_camera_card.trigger.camera.to` are migrated automatically when
they appear inside template strings.
- **The ambient `advanced_camera_card` template namespace is removed.**
The long-form ambient namespace (`advanced_camera_card.camera`,
`advanced_camera_card.view`, `advanced_camera_card.config`) is retired
in favour of its shorter `acc` alias -- supported since v7.1.0, and the
only spelling the new trigger surface uses. Existing templates are
migrated automatically by rewriting the `advanced_camera_card.` prefix
to `acc.`.

### 4. Trigger-only condition forms are no longer valid conditions

Some legacy "conditions" were really change detectors. These are now
triggers only:

- `condition: config`
- valueless `camera`
- valueless `view`
- valueless `state` / picture-elements state condition with neither
`state` nor `state_not`

These are automatically promoted in automations and stripped from
overrides/elements where they would no longer be meaningful as ongoing
conditions.

### 5. Template truthiness now follows Home Assistant behavior

Template conditions and template triggers intentionally use different
truthiness rules, matching HA:

- A template condition passes only when the rendered value is `true`
(case-insensitive), matching HA's `condition.py`.
- A template trigger uses HA's broader `result_as_boolean` coercion: a
non-zero number, or `1` / `true` / `yes` / `on` / `enable`
(case-insensitive), counts as true.

### 6. Action templates render when each action executes

Action templates are now rendered per action step, not once for the
whole sequence. This means a later action can see card-local state
changed by an earlier action in the same sequence.

The `trigger` context is fixed for the automation run. HA entity state
updates still depend on the frontend receiving updated HASS state over
the websocket.

## Automatic Migrations

### Automation `conditions:` to `triggers:`

Simple legacy automation:

```yaml
# Before
automations:
  - conditions:
      - condition: fullscreen
        fullscreen: true
    actions:
      - action: custom:advanced-camera-card-action
        advanced_camera_card_action: substream_on
```

```yaml
# After, automatic
automations:
  - triggers:
      - trigger: fullscreen
        fullscreen: true
    actions:
      - action: custom:advanced-camera-card-action
        advanced_camera_card_action: substream_on
```

State conditions become HA-style state triggers:

```yaml
# Before
automations:
  - conditions:
      - condition: state
        entity_id: binary_sensor.front_door
        state: 'on'
    actions:
      - action: custom:advanced-camera-card-action
        advanced_camera_card_action: live
```

```yaml
# After, automatic
automations:
  - triggers:
      - trigger: state
        entity_id: binary_sensor.front_door
        to: 'on'
    actions:
      - action: custom:advanced-camera-card-action
        advanced_camera_card_action: live
```

Multiple conditions become both triggers and ongoing conditions:

```yaml
# Before
automations:
  - conditions:
      - condition: camera
        cameras: [front_door]
      - condition: fullscreen
        fullscreen: true
    actions:
      - action: custom:advanced-camera-card-action
        advanced_camera_card_action: substream_on
```

```yaml
# After, automatic
automations:
  - triggers:
      - trigger: camera
        cameras: [front_door]
      - trigger: fullscreen
        fullscreen: true
    conditions:
      - condition: camera
        cameras: [front_door]
      - condition: fullscreen
        fullscreen: true
    actions:
      - action: custom:advanced-camera-card-action
        advanced_camera_card_action: substream_on
```

The flattened trigger list is an implicit OR. The retained `conditions:`
list is an implicit AND checked when any trigger fires.

### Trigger-only legacy conditions

Legacy `config` conditions become `config` triggers:

```yaml
# Before
automations:
  - conditions:
      - condition: config
        paths: [menu.style]
    actions:
      - action: custom:advanced-camera-card-action
        advanced_camera_card_action: status_bar
```

```yaml
# After, automatic
automations:
  - triggers:
      - trigger: config
        paths: [menu.style]
    actions:
      - action: custom:advanced-camera-card-action
        advanced_camera_card_action: status_bar
```

Trigger-only leaves are removed from retained `conditions:` blocks
because they no longer describe an ongoing state.

### `actions_not` to `if` / `then` / `else`

```yaml
# Before
automations:
  - conditions:
      - condition: state
        entity_id: input_boolean.camera_alerts
        state: 'on'
    actions:
      - action: custom:advanced-camera-card-action
        advanced_camera_card_action: live
    actions_not:
      - action: none
```

```yaml
# After, automatic
automations:
  - triggers:
      - trigger: state
        entity_id: input_boolean.camera_alerts
    actions:
      - if:
          - condition: state
            entity_id: input_boolean.camera_alerts
            state: 'on'
        then:
          - action: custom:advanced-camera-card-action
            advanced_camera_card_action: live
        else:
          - action: none
```

If the legacy automation had no conditions, or only trigger-only
conditions, `actions_not` is dropped because the old `else` branch could
not be reproduced as an ongoing predicate.

### Trigger template paths

```yaml
# Before
message: 'Door is {{ acc.trigger.state.to }} from {{ acc.trigger.state.from }}'
```

```yaml
# After, automatic
message: 'Door is {{ trigger.to_state.state }} from {{ trigger.from_state.state }}'
```

Path rewrites performed automatically:

| Old path                   | New path                   |
| -------------------------- | -------------------------- |
| `acc.trigger.state.entity` | `trigger.entity_id`        |
| `acc.trigger.state.from`   | `trigger.from_state.state` |
| `acc.trigger.state.to`     | `trigger.to_state.state`   |
| `acc.trigger.camera.from`  | `trigger.from_acc.camera`  |
| `acc.trigger.camera.to`    | `trigger.to_acc.camera`    |
| `acc.trigger.view.from`    | `trigger.from_acc.view`    |
| `acc.trigger.view.to`      | `trigger.to_acc.view`      |
| `acc.trigger.config.from`  | `trigger.from_acc.config`  |
| `acc.trigger.config.to`    | `trigger.to_acc.config`    |

The same rewrites are applied for the older
`advanced_camera_card.trigger.*` namespace.

### Ambient template namespace

Any remaining long-form ambient `advanced_camera_card.*` references
(outside the trigger surface) are rewritten to the `acc.*` alias:

```yaml
# Before
title: 'Now viewing {{ advanced_camera_card.camera }}'
```

```yaml
# After, automatic
title: 'Now viewing {{ acc.camera }}'
```

## Manual Migration Cases

### `__UPGRADE_FAILURE__.automations`

If a legacy automation cannot be converted faithfully, the original
automation is recorded under:

```yaml
__UPGRADE_FAILURE__:
  automations:
    - ...
```

These entries require manual migration.

The main known case is legacy `actions_not` with a condition whose
trigger can only fire on a rising edge, such as:

- `condition: template`
- `condition: screen`
- `condition: numeric_state` without an entity-backed state to watch

Those conditions can start the `then` branch, but cannot reliably start
the `else` branch when they stop matching.

### Unsupported HA conditions and triggers

This PR aligns the card with HA where supported, but it is not a full HA
automation engine.

Unsupported HA condition families include:

- `time`
- `zone`
- `sun`
- `location`
- `device`
- `condition: trigger`

Unsupported HA trigger platforms include:

- `event`
- `time`
- `time_pattern`
- `sun`
- `zone`
- `calendar`
- `webhook`
- `tag`
- `device`
- `mqtt`

The card-specific camera `triggers:` feature (which auto-selects and
wakes the card on camera events such as motion) is a separate feature
from automation `triggers:`, despite the shared word.

### Trigger IDs and variables

HA keys such as `id`, `alias`, and `variables` are accepted so pasted HA
YAML validates, but they are ignored by the card. There is no
`trigger.id` support in this PR.

## New Compatibility Features

This PR also makes card config more forgiving for HA-style YAML:

- `trigger`, `condition`, and `action` singular keys are accepted and
normalized to `triggers`, `conditions`, and `actions`.
- Single trigger, condition, and action objects are accepted where lists
are expected.
- `if`, `then`, and `else` accept a single item or a list.
- Composite condition shorthand is accepted:
  - `{ and: [...] }`
  - `{ or: [...] }`
  - `{ not: [...] }`
  - `{ condition: [...] }` as an implicit AND
- State conditions resolve expected state values that name another
entity, matching HA/Lovelace behavior.
- Both `entity` and `entity_id` are accepted on state and numeric
conditions and triggers (a superset of HA's two dialects), so there is
no forced rename.
- `state_not` remains supported as a card/Lovelace-friendly extension.

## Trigger Payloads

Automation action templates receive a top-level `trigger` object.

For stock `state` and `numeric_state` triggers:

```yaml
trigger.platform
trigger.entity_id
trigger.entity
trigger.from_state
trigger.to_state
```

For template triggers:

```yaml
trigger.platform
```

For card-specific triggers:

```yaml
trigger.platform # "acc"
trigger.type
trigger.from_acc
trigger.to_acc
```

The card does not currently expose HA's `id`, `idx`, `for`, `attribute`,
`above`, `below`, or `alias` trigger fields.

BREAKING CHANGE: Automations now follow Home Assistant's `triggers:` /
`conditions:` / `actions:` model. Automations require a `triggers:`
block and `conditions:` no longer wake an automation; `actions_not` is
removed in favour of an `if` / `then` / `else` action; the nested
`acc.trigger.*` template paths and the ambient `advanced_camera_card`
template namespace are removed (use the top-level `trigger.*` surface
and the `acc` alias); trigger-only condition forms (`config`, valueless
`camera` / `view` / `state`) are no longer valid conditions; and
template-condition vs template-trigger truthiness now follow HA.
Existing configs are upgraded automatically where a faithful conversion
exists; anything that cannot be converted is recorded under
`__UPGRADE_FAILURE__` for manual migration.

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 17:45:13 -07:00
Dermot Duffy 209c873c58 docs: Add worked examples for showing a folder as a camera's media (#2521)
Related: #2498
2026-06-30 17:45:13 -07:00
Dermot Duffy 12ae3b216c refactor: Restructure condition evaluation into per-type evaluator classes (#2518) 2026-06-30 17:45:13 -07:00
Dermot Duffy 37df382aa2 fix: Fix leaky Frigate subscriptions/unsubscriptions (#2513) 2026-06-30 17:45:13 -07:00
Dermot Duffy 0a36358394 feat: Trigger cameras on HA bus events (#2512) 2026-06-30 17:45:13 -07:00
Dermot Duffy 406176eebc feat: Add 'doorbell' configuration profile (#2511) 2026-06-30 17:45:13 -07:00
Dermot Duffy ef9c9c8d5c fix: Avoid potential call-manager race condition (#2508) 2026-06-30 17:45:13 -07:00
Dermot Duffy 773cee95a5 feat: Add automatic doorbell detection (#2507) 2026-06-30 17:45:13 -07:00
Dermot Duffy 4b72fcd629 feat: Support HA event entities as triggers (#2506) 2026-06-30 17:45:13 -07:00
Dermot Duffy f1fad59a89 chore: Small fixes to clean docs link checker results (#2505) 2026-06-30 17:45:13 -07:00
Dermot Duffy f397596ed1 feat: Explicit answer/reject for inbound calls (#2504) 2026-06-30 17:45:13 -07:00
Dermot Duffy b9f09b7c4e chore: Expand default Claude permissions slightly (#2503) 2026-06-30 17:45:13 -07:00
Dermot Duffy 88fde79721 feat: Add easy access to card from JS console for user debugging (#2502) 2026-06-30 17:45:13 -07:00
Dermot Duffy f18e4cd4b8 refactor: Unify substream actions into substream_{on,off} (#2497)
## Summary

- Collapse `live_substream_{on,off,select}` into a unified
`substream_{on,off}` pair, symmetric with `call_{start,end}`.
- Rename the `camera` field on the former `live_substream_select` to
`stream` (it always was a stream ID).
- Add optional `camera` field to both new actions for targeting a
non-selected base camera.
- YAML configs are migrated automatically; URL bookmarks must be updated
by hand.

## Migration

### Cycling between camera and substream (toggle button)

Before:
```yaml
tap_action:
  action: custom:advanced-camera-card-action
  advanced_camera_card_action: live_substream_on
```

After:
```yaml
tap_action:
  action: custom:advanced-camera-card-action
  advanced_camera_card_action: substream_on
```

### Selecting a specific substream

Before:
```yaml
tap_action:
  action: custom:advanced-camera-card-action
  advanced_camera_card_action: live_substream_select
  camera: camera.front_door_hd
```

After:
```yaml
tap_action:
  action: custom:advanced-camera-card-action
  advanced_camera_card_action: substream_on
  stream: camera.front_door_hd
```

### Turning the substream off

Before:
```yaml
tap_action:
  action: custom:advanced-camera-card-action
  advanced_camera_card_action: live_substream_off
```

After:
```yaml
tap_action:
  action: custom:advanced-camera-card-action
  advanced_camera_card_action: substream_off
```

### URL querystrings (manual update required)

| Before | After |
| --- | --- |
|
`?advanced-camera-card-action.live_substream_select=camera.front_door_hd`
| `?advanced-camera-card-action.substream_on=camera.front_door_hd` |
2026-06-30 17:45:13 -07:00
Dermot Duffy 15e335a647 feat: Add support for inbound "calls" from triggers (#2500) 2026-06-30 17:45:13 -07:00
Dermot Duffy f4c686c298 chore: Allow parallel rollup instances (#2499) 2026-06-30 17:45:13 -07:00
Dermot Duffy 04059920bb chore: Don't use rollup serving by default (#2495) 2026-06-30 17:45:13 -07:00
Dermot Duffy 48761f0478 refactor: Use toggleAttribute natively where possible (#2494) 2026-06-30 17:45:13 -07:00
Dermot Duffy 2acec49b29 refactor: Clone context when a view is cloned (#2493) 2026-06-30 17:45:13 -07:00
Dermot Duffy 3f0d2ef14d chore: Add worktree deployment support (#2491) 2026-06-30 17:45:13 -07:00
Dermot Duffy f21a46297a fix: Improve visual styling for transmitting/triggering (#2490) 2026-06-30 17:45:13 -07:00
Dermot Duffy 090138a01e fix: Lock the grid when the UI is locked (#2489) 2026-06-30 17:45:13 -07:00
Dermot Duffy 881ba51e9f feat: Escape ends calls (#2488) 2026-06-30 17:45:13 -07:00
Dermot Duffy 9b750953ae fix: Lock thumbnails and timeline when UX is locked for calls (#2487) 2026-06-30 17:45:13 -07:00
Dermot Duffy abcba884e5 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
```
2026-06-30 17:45:13 -07:00
Dermot Duffy be7e7d79dc feat: Add UI optional UI locking when microphone is hot (#2484) 2026-06-30 17:45:12 -07:00
Dermot Duffy 9a763db1f3 fix: Avoid go2rtc renegotiation on camera selection change (#2483) 2026-06-30 17:45:12 -07:00
Dermot Duffy a68b665f03 feat: Add live.microphone.auto_mute / auto_unmute (#2482) 2026-06-30 17:45:12 -07:00
Dermot Duffy 9eb503deff feat: Add casting capability to user_agent condition (#2480) 2026-06-30 17:45:12 -07:00
Dermot Duffy 261a7e1a92 feat: Auto-resolve Frigate client_id from camera entity (#2475)
Credit goes to @Eduardo-Jaramillo for the inspiration and contribution
of https://github.com/dermotduffy/advanced-camera-card/pull/2474 .
2026-06-30 17:45:12 -07:00
Dermot Duffy 9d088d7bcb fix: Add support for synchronously reseting go2rtc sessions (#2478)
This is part 1 of
https://docs.google.com/document/d/1zbHYWqulEUaNLeX0fK3rfIiLugMlCQo_SFg3hcgiRRw/edit?tab=t.0
.

There is a significant chance this will improve issues people have been
experiencing with poorly designed doorbells that can only open a single
stream at a time.
2026-06-30 17:45:12 -07:00
Dermot Duffy 31d0c9322f fix: Always respect the returned MIME type (#2473)
- Closes #2449
2026-06-30 17:45:12 -07:00
Dermot Duffy 591f466b92 fix: Render sub-labels for Frigate reviews (#2468)
- Closes: #2438
2026-06-30 17:45:12 -07:00
Dermot Duffy 056a038e81 fix: Improve folder icon rendering (#2467) 2026-06-30 17:45:12 -07:00
Dermot Duffy d8ad347dfa fix: Preload should reliably preload initial load (#2466) 2026-06-30 17:45:12 -07:00
Dermot Duffy bc366626f1 refactor: Refactor media loading manager for improved robustness (#2464) 2026-06-30 17:45:12 -07:00
Dermot Duffy 47bcce93d3 feat: Add hardened error handling and retries (#2451)
- Closes #1830
 - Closes #2099
2026-06-30 17:45:12 -07:00
Dermot Duffy 4bc787e2b7 chore: Compress AI instructions (#2434) 2026-06-30 17:45:12 -07:00