#button card name template

1 messages · Page 1 of 1 (latest)

hollow kettle
#

I want to set the name of this custom button based on the value of the entity. when its empty, it should be "select room" and when it has some values (eg: kitchen, living_room etc) it should be "clean". but i dont get that. it shows the code itself.

- type: custom:button-card
  entity: variable.deebot_kajer_beti_ronbot_queue
  icon: mdi:play-pause
  name: >-
    {%- if is_state('variable.deebot_kajer_beti_ronbot_queue', "") -%}
      Select rooms
    {%- else -%}
      Clean
    {%- endif -%}

what am i doing wrong?

scarlet zealot
#

Use JavaScript templating instead of Jinja2. You can find more details in the custom:button-card documentation