d_sellers1

"Summary" Card

Mar 14th, 2026 (edited)
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 2.24 KB | Source Code | 0 0
  1. type: custom:layout-card
  2. layout_type: custom:grid-layout
  3. layout_options:
  4.   width: 100
  5. layout:
  6.   grid-template-columns: 40% 60%
  7.   grid-template-rows: auto
  8. cards:
  9.   - type: custom:mushroom-template-card
  10.     entity: light.living_room_lights
  11.     primary: >-
  12.       {%- set count_of_lights_on = states.light
  13.         | selectattr('entity_id', 'in', area_entities('Living Room'))
  14.         | rejectattr('entity_id', 'in', integration_entities('group'))
  15.         | selectattr('state' , 'eq' , 'on')
  16.         | sort(attribute='name')
  17.         | map(attribute = 'entity_id')
  18.         | list | count
  19.        -%}
  20.        {%- set count_of_lights = states.light
  21.         | selectattr('entity_id', 'in', area_entities('Living Room'))
  22.         | rejectattr('entity_id', 'in', integration_entities('group'))
  23.         | selectattr('state' , 'in' , ['on','off'])
  24.         | sort(attribute='name')
  25.         | map(attribute = 'entity_id')
  26.         | list | count
  27.        -%}
  28.       {% if (count_of_lights_on == 0) %}All off
  29.       {% elif (count_of_lights == count_of_lights_on) %}All On
  30.       {% elif (count_of_lights_on != count_of_lights) %}{{count_of_lights_on}} of {{count_of_lights}} lights on
  31.       {% endif %}
  32.     icon: mdi:power
  33.     icon_color: "{% if is_state(entity, 'on') %} amber {% else %} disabled {% endif %}"
  34.     icon_tap_action:
  35.       action: toggle
  36.     icon_hold_action:
  37.       action: more-info
  38.     card_mod:
  39.       style: |
  40.        ha-card {
  41.           border: none;
  42.           background: none;
  43.           height: 75px !important;
  44.         }
  45.   - type: custom:auto-entities
  46.     card:
  47.       type: custom:layout-card
  48.       layout_type: custom:grid-layout
  49.       layout_options:
  50.         width: 100
  51.       layout:
  52.         grid-template-columns: 200px 200px 200px
  53.         grid-template-rows: auto
  54.     card_param: cards
  55.     filter:
  56.       include:
  57.         - options:
  58.             type: custom:mushroom-entity-card
  59.             entity_id: this.entity_id
  60.             layout: horizontal
  61.             secondary_info: none
  62.             tap_action:
  63.               action: toggle
  64.             hold_action:
  65.               action: more-info
  66.           domain: light
  67.           area: Living Room
  68.       exclude:
  69.         - state: unavailable
  70.         - integration: group
  71.  
Advertisement
Add Comment
Please, Sign In to add comment