How templates and variables work in Streamline Card
mainA template acts as a blueprint for your cards. It defines a structure but leaves specific parts empty using variables. When you use the template in a dashboard, you provide values for these variables to customize each instance.
Key Concepts:
- Variables: Defined in the template using double brackets, e.g.,
[[variable_name]]. - Default Values: You can define a
defaultsection in your template to provide fallback values if a variable isn't specified during usage. - Template Structure: Every template consists of a Template Name, an optional Default Values list, and a Card Configuration (using the
cardkey for standard cards orelementfor picture-elements).
my_light_template:
default:
- light_icon: mdi:ceiling-light
card:
type: custom:bubble-card
name: "[[room_name]] Light"
icon: "[[light_icon]]"
entity: "[[light_entity]]"