My statement was a bit hasty, actually.
It depends:
– a template for a “default” value of some variable cannot be resolved BEFORE using this variable;
– it may be resolved WHEN using this variable: if an option supports templates - then the template is resolved, otherwise - no.
Consider this decluttering-template:
decl_test_var_template_2:
default:
- VALUE: >-
{{ states('sun.sun') }}
card:
type: vertical-stack
cards:
- type: markdown
content: '[[VALUE]]'
- type: entities
title: '[[VALUE]]'
entities:
- zone.home
where the variable is used for the “content
” option (does support jinjia) and for the “title
” option (does not support jinjia).
type: vertical-stack
cards:
- type: custom:decluttering-card
template: decl_test_var_template_2
- type: custom:decluttering-card
template: decl_test_var_template_2
variables:
- VALUE: xxx
- type: custom:decluttering-card
template: decl_test_var_template_2
variables:
- VALUE: >-
{{ states('device_tracker.iiyama') }}
Check this long read also.