Rename status/labels

Hi there, is there anyway to rename these labels?

I want to change ‘Locking’ to ‘On The Latch.’

Thanks

Is this a Tile card or Mushroom?

Hi,

A tile card in a vertical stack

I am not that happy with the status naming of the entity and wondered if i could renaming them some how. IE ‘Locking’ becomes ‘On the latch’.

It’s possible in a Tile card, but I’d recommend looking at Mushroom. It is 100% based off the Tile card and was designed to allow more customization.

Adjusting the Tile card will require card_mod. The Mushroom card allows you to create a template card and you can control aspects of the info as well as the displayed icon. I created a sample card

type: vertical-stack
cards:
  - type: custom:mushroom-template-card
    primary: SwitchBot | ProLock | Matter
    secondary: >-
      {{ 'Unlocked' if is_state('lock.garage_door', 'unlocked') else 'On The
      Latch' }}
    icon: >-
      {{ 'mdi:door-open' if is_state('lock.garage_door', 'unlocked') else
      'mdi:door-closed-lock' }}
    entity: lock.garage_door
    icon_color: '{{ ''green'' if is_state(''lock.garage_door'', ''unlocked'') else ''red'' }}'

Locked

Unlocked

1 Like

Wow thank you, I understand. However Switch Bot has four status. How would I add multiple if statements with corresponding icons. Would normally be a else if, but I am not familiar with the syntax in Home Assistant. Perhaps conditional format?

Locked
Locking
Unlocked
Unlocking

Thank you

You’ll have to adjust a bit, but something like this…

type: vertical-stack
cards:
  - type: custom:mushroom-template-card
    primary: SwitchBot | ProLock | Matter
    secondary: |-
        {% if is_state('lock.garage_door', 'locking')%}
          Locking
        {% elif is_state('lock.garage_door', 'unlocked')%}
         Unlocked
        {% elif is_state('lock.garage_door', 'unlocking')%}
         Unlocking
        {% else %}
         Locked
        {% endif %}
    icon: >-
      {{ 'mdi:door-open' if is_state('lock.garage_door', 'unlocked') else
      'mdi:door-closed-lock' }}
    entity: lock.garage_door
    icon_color: '{{ ''green'' if is_state(''lock.garage_door'', ''unlocked'') else ''red'' }}'

Thank you, with some edits the code worked.

However, the Switch Bot Pro has some odd status, and will read as locking even if the door is open. So I decided to try and add an AND condition. So that if the door was open, and the door marked as locking or locking, to apply a status of ‘unlocked’. For some reason, it doesn’t seem to like my application of AND logic.

Everything else is OK, but I a bit lost as reading various other threads I think this should work.

The status is defaulting to ‘On the Latch’, even when the door is open.

type: vertical-stack
cards:
  - type: custom:mushroom-template-card
    primary: Front Door
    secondary: >-

      {% if ( (is_state('binary_sensor.front_door_contact', 'open')) and
      (is_state('lock.switchbot_pro_lock_matter', 'locking')) ) %} Unlocked

      {% elif ( (is_state('binary_sensor.front_door_contact', 'open')) and
      (is_state('lock.switchbot_pro_lock_matter', 'unlocking')) ) %} Unlocked

      {% elif is_state('lock.switchbot_pro_lock_matter', 'locking')%}
        On the latch
        
      {% elif is_state('lock.switchbot_pro_lock_matter', 'unlocked')%}
       Unlocked
       
      {% elif is_state('lock.switchbot_pro_lock_matter', 'locked')%}
       Locked
       
      {% elif is_state('lock.switchbot_pro_lock_matter', 'unlocking')%}
       Unlocking
       
      {% else %}
       Jammed
      {% endif %}
    icon: >-
      {{ 'mdi:door-closed-lock' if is_state('lock.switchbot_pro_lock_matter',
      'locked') else 'mdi:door-closed-cancel' }}
    entity: lock.switchbot_pro_lock_matter
    icon_color: >-
      {{ 'green' if is_state('lock.switchbot_pro_lock_matter', 'locked') else
      'orange' }}
    hold_action:
      action: toggle

Well I got there, and binary sensors use on and off states. So open wouldn’t pass the condition.

Thank you for your help, I will mark your comment as the solution.

type: vertical-stack
cards:
  - type: custom:mushroom-template-card
    primary: Front Door
    secondary: >-
      {% if ( (is_state('binary_sensor.front_door_contact', 'on')) and
      (is_state('lock.switchbot_pro_lock_matter', 'locking')) ) %}
        Unlocked - Door Open
      {% elif ( (is_state('binary_sensor.front_door_contact', 'on')) and
      (is_state('lock.switchbot_pro_lock_matter', 'unlocking')) ) %}
        Unlocked - Door Open
      {% elif is_state('lock.switchbot_pro_lock_matter', 'locking') %}
        On the latch
      {% elif is_state('lock.switchbot_pro_lock_matter', 'unlocked') %}
        Unlocked
      {% elif is_state('lock.switchbot_pro_lock_matter', 'locked') %}
        Locked
      {% elif is_state('lock.switchbot_pro_lock_matter', 'unlocking') %}
        Unlocking
      {% else %}
        Jammed
      {% endif %}
    icon: >-
      {{ 'mdi:door-closed-lock' if is_state('lock.switchbot_pro_lock_matter',
      'locked') else 'mdi:door-closed-cancel' }}
    entity: lock.switchbot_pro_lock_matter
    icon_color: >-
      {{ 'green' if is_state('lock.switchbot_pro_lock_matter', 'locked') else
      'orange' }}
    hold_action:
      action: toggle
1 Like