Files
advanced-camera-card/docs/configuration/templates.md
T

3.6 KiB

Templates

Templates may be used in a certain places to allow template values (if present) to be dynamically replaced. This allows a variety of Home Assistant data, and Advanced Camera Card data, to be accessible. Templates may be used in:

Stock Templates

The Advanced Camera Card uses ha-nunjucks to process templates. Consult its documentation for the wide variety of different template values supported.

See an example that accesses Home Assistant state.

Custom Templates

Custom template values must be proceeded by advanced_camera_card (or acc for short).

Template Replaced with
camera The currently selected camera.
view The current view.

See an example that accesses Advanced Camera Card state.

Media Matching

If templates are used for Folder Media Matching an additional media variable is available with these properties:

Media template values must be proceeded by advanced_camera_card.media (or acc.media for short).

Template Replaced with
title The media title being matched.
is_folder Whether the media item is a folder that may be expanded (vs a single media item).

Triggers

If the action is called by an Advanced Camera Card Automation, additional data is available representing the current and prior state of whatever triggered the action.

Trigger template values must be proceeded by advanced_camera_card.trigger (or acc.trigger for short).

Template Replaced with
camera.to For camera conditions, the currently selected camera.
camera.from For camera conditions, the previously selected camera.
view.to For view conditions, the currently selected view.
view.from For view conditions, the previously selected view.
state.entity For state conditions, the entity state that triggered the condition.
state.to For state conditions, the current state of the entity.
state.from For state conditions, the previous state of the entity.

!> If an action is triggered with multiple state conditions, only data from the last listed state condition is available.

!> If you use an or condition, only the trigger data for the first matching trigger will be included.

Please request if you need data from additional conditions.

See an example that accesses trigger state.