Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 102471

Icon template on a custom entity card

$
0
0

@Vinz87 wrote:

I use https://github.com/thomasloven/lovelace-slider-entity-row to control the position of a group of covers.

I would like to template the icon to something like this:

entities:
  - entity: input_number.cover_position_ingresso
    icon_template: >-
      {% if is_state('input_number.cover_position_ingresso', 0) %}
        mdi:window-closed
      {% else %}
        mdi:window-open
      {% endif %}
    name: Serrande
    type: 'custom:slider-entity-row'
title: null
type: entities

or perhaps using attributes too. With this code I get the error “Expected a value of type {entity,name,icon} | entity-id for entities.0.icon_template but received "{% if is_state('input_number.cover_position_ingresso', 0) %}\n mdi:window-closed\n{% else %}\n mdi:window-open\n{% endif %}".”

What should I change?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 102471

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>