Skip to content

Icon Double State Chip

Description

example-image

This chip displays can display an icon and value of two entities.

Variables

Variable Default Required Notes
ulm_chip_icon_double_state_icon This is the icon to show. See icons to read more about the used unicode emojis.
ulm_chip_icon_double_state_entity_1 This is the entity to display in first position
ulm_chip_icon_double_state_entity_2 This is the entity to display in second position
ulm_chip_navigate_path The path to your view

Usage

- type: 'custom:button-card'
  template: chip_icon_double_state
  variables:
    ulm_chip_icon_double_state_icon: '💻'
    ulm_chip_icon_double_state_entity_1: sensor.nas_disk_used
    ulm_chip_icon_double_state_entity_2: sensor.nas_cpu_load
    ulm_chip_navigate_path: /lovelace-minimalist-ui/0
Template Code
chip_icon_double_state.yaml
---
### Chip Icon Double State ###
chip_icon_double_state:
  template: "chips"
  tap_action:
    action: "navigate"
    navigation_path: "[[[ return variables.ulm_chip_navigate_path; ]]]"
  triggers_update:
    - "[[[ return variables.ulm_chip_icon_double_state_entity_1 ]]]"
    - "[[[ return variables.ulm_chip_icon_double_state_entity_2 ]]]"
  label: |
    [[[
      var icon = "❔";
      if (variables.ulm_chip_icon_double_state_icon){
        var icon = variables.ulm_chip_icon_double_state_icon;
      }
      var state1 = "";
      if (states[variables.ulm_chip_icon_double_state_entity_1].state){
        var state1 = helpers.localize(states[variables.ulm_chip_icon_double_state_entity_1])
      }
      var state2 = "";
      if (states[variables.ulm_chip_icon_double_state_entity_2].state){
        var state2 = helpers.localize(states[variables.ulm_chip_icon_double_state_entity_2])
      }
      return icon + " " + state1 + " • " + state2;
    ]]]