Hi all,
I would like to make a conditional in the picture element, not based on state, but based on other data, like the source of a TV.
is it possible ?
Hi all,
I would like to make a conditional in the picture element, not based on state, but based on other data, like the source of a TV.
is it possible ?
I don’t think this is directly possible.
However you could just simply create a Template Sensor and set the value_template
to the attribute of your TV (for example).
good idea,
i will see if I can do what I need with that
Should be pretty straight-forward, something like
value_template: "{{ state_attr('entity.id','attribute') }}"
You can then use the state:
field in the conditional card
it’s working fine.
I used this.
value_template: >
{% if is_state("media_player.living_tv", "off") -%}
off
{%- else -%}
{{ state_attr("media_player.living_tv", "source") }}
{%- endif %}
Another question:
do you know if with template sensor we can change icon color ?