artem-sedykh / mini-climate-card

Minimalistic climate card for Home Assistant Lovelace UI
MIT License
262 stars 19 forks source link

Option to hide indicator value and show only icon #64

Open zarebski-m opened 2 years ago

zarebski-m commented 2 years ago

I would like to create an indicator that displays only icon, without the value. This makes sense for binary sensors. In my case I'd like a window indicator that changes the icon, without state value displayed:

indicators:
  window:
    source:
      entity: binary_sensor.bedroom_windows
    icon:
      template: |
        (value) => value === 'off' 
          ? 'mdi:window-closed' 
          : 'mdi:window-open'
      style: |
        (value) => value === 'off' 
          ? {} 
          : { color: 'blue' }

This works fine but it still displays sensor value next to the icon (on or off). I would like to hide the value completely and have just the icon indicator.

image image

jesseklm commented 3 months ago

Solved with https://github.com/artem-sedykh/mini-climate-card/pull/121.

Yours would look like this:

indicators:
  window:
    source:
      entity: binary_sensor.bedroom_windows
    icon:
      template: |
        (value) => value === 'off' 
          ? 'mdi:window-closed' 
          : 'mdi:window-open'
      style: |
        (value) => value === 'off' 
          ? {} 
          : { color: 'blue' }
    value:
      style: |
        () => ({display: 'none'})