Hi,
I have this cover template that works fine:
cover:
- platform: template
covers:
cortina_sala:
device_class: curtain
unique_id: cortina_sala
friendly_name: "Cortina Sala"
open_cover:
- service: script.turn_on
target:
entity_id: script.accion_cortina
data:
variables:
option: Abierta
close_cover:
- service: script.turn_on
target:
entity_id: script.accion_cortina
data:
variables:
option: Cerrada
stop_cover:
- service: script.turn_on
target:
entity_id: script.accion_cortina
data:
variables:
option: Pausada
icon_template: >-
{% if is_state('input_select.estado_cortina', 'Abierta') %}
/local/icons/cortinasabiertas.png
{% elif is_state('input_select.estado_cortina', 'Cerrada') %}
/local/icons/cortinascerradas.png
{% else %}
/local/icons/cortinaflecha.png
{% endif %}
But I get the next error and can’t show the custom icons (I used SVG and PNG icons and get the same error):
Logger: homeassistant.components.template.template_entity
Source: components/template/template_entity.py:94
Integration: Template ([documentation](https://www.home-assistant.io/integrations/template), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+template%22))
First occurred: 16:15:35 (1 occurrences)
Last logged: 16:15:35
Error validating template result '/local/icons/cortinaflecha.png' from template 'Template("{% if is_state('input_select.estado_cortina', 'Abierta') %} /local/icons/cortinasabiertas.png {% elif is_state('input_select.estado_cortina', 'Cerrada') %} /local/icons/cortinascerradas.png {% else %} /local/icons/cortinaflecha.png {% endif %}")' for attribute '_icon' in entity cover.cortina_sala validation message 'contains non-whitespace: /local/icons/cortinaflecha.png'
Any ideas, what I doing wrong?