Open commentsonly opened 8 months ago
When an x
variable is defined in
{% set x = ... %}
...
it is only accessible within THIS template, i.e. this will not work:
type: custom:state-switch
entity: template
template: >-
{% set x = ... -%}
{{ ... }}
states:
value_xyz:
... the `x` variable is not accessible here.
You need to create a FR with a detailed description of a desired functionality.
Perhaps the functionality could most easily be described as template within the states: section. Better said the entries with the variables: section should allow for templating. I tried a lot but without any luck .. but perhaps something's possible.
As I already said:
when using
is there a chance to access these further down within the
section? Would allow me to save around 99% of the complete YAML code. Perhaps I'm not skilled enough with YAML or this isn't possible .. unsure about that.