Advertisement
Guest User

HaCasa Custom Header Card

a guest
Feb 25th, 2025
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 5.16 KB | None | 0 0
  1. hc_header_card:
  2.   variables:
  3.     person_1_entity:
  4.     person_2_entity:
  5.     person_1_name:
  6.     person_2_name:
  7.   show_name: false
  8.   show_icon: false
  9.   show_label: false
  10.   show_state: false
  11.   styles:
  12.     grid:
  13.       - grid-template-areas: |
  14.          "menu person_1 person_2"
  15.       - grid-template-columns: 1fr min-content min-content
  16.       - column-gap: 8px
  17.     card:
  18.       - height: 100%
  19.       - border-radius: var(--border-radius)
  20.       - box-shadow: var(--border-radius)
  21.       - background: none
  22.       - overflow: visible
  23.       - margin: 0 0 20px 0
  24.       - padding: 0
  25.     custom_fields:
  26.       menu:
  27.         - justify-self: start
  28.       person_1:
  29.         - justify-self: end
  30.       person_2:
  31.         - justify-self: end
  32.   custom_fields:
  33.     menu:
  34.       card:
  35.         type: custom:button-card
  36.         icon: fapro:bars-solid
  37.         styles:
  38.           card:
  39.             - height: 40px
  40.             - width: 40px
  41.             - margin: 0
  42.             - padding: 0
  43.             - border-radius: 50%
  44.             - justify-self: end
  45.           img_cell:
  46.             - height: 100%
  47.           icon:
  48.             - width: 35%
  49.         tap_action:
  50.           action: navigate
  51.           navigation_path: /config/dashboard
  52.     person_1:
  53.       card:
  54.         type: custom:button-card
  55.         entity: "[[[ return variables.person_1_entity ]]]"
  56.         show_entity_picture: true
  57.         show_name: false
  58.         show_icon: false
  59.         show_label: false
  60.         show_state: false
  61.         styles:
  62.           card:
  63.             - height: 40px
  64.             - width: 40px
  65.             - margin: 0
  66.             - padding: 0
  67.             - border-radius: 50%
  68.             - justify-self: end
  69.             - position: relative
  70.             - overflow: visible
  71.           img_cell:
  72.             - height: 100%
  73.             - width: 100%
  74.             - border-radius: 50%
  75.             - overflow: hidden
  76.           entity_picture:
  77.             - height: 100%
  78.             - width: 100%
  79.             - object-fit: cover
  80.             - border-radius: 50%
  81.         custom_fields:
  82.           status:
  83.             card:
  84.               type: "custom:button-card"
  85.               icon: "[[[ return states[variables.person_1_entity].state === 'home' ? 'fapro:house-solid' : 'fapro:plane-solid' ]]]"
  86.               show_name: false
  87.               show_state: false
  88.               show_label: false
  89.               styles:
  90.                 card:
  91.                   - background-color: "[[[ return states[variables.person_1_entity].state === 'home' ? 'var(--color-green)' : 'var(--color-orange)' ]]]"
  92.                   - color: white
  93.                   - border-radius: 50%
  94.                   - height: 18px  # Slightly bigger badge
  95.                   - width: 18px
  96.                   - position: absolute
  97.                   - top: -45px  # Proper top-right floating position
  98.                   - right: -5px
  99.                   - display: flex
  100.                   - align-items: center
  101.                   - justify-content: center
  102.                   - box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.2)
  103.                 icon:
  104.                   - color: white  # Icon in white
  105.                   - width: 60%  # Smaller icon size
  106.                   - height: 60%
  107.     person_2:
  108.       card:
  109.         type: custom:button-card
  110.         entity: "[[[ return variables.person_2_entity ]]]"
  111.         show_entity_picture: true
  112.         show_name: false
  113.         show_icon: false
  114.         show_label: false
  115.         show_state: false
  116.         styles:
  117.           card:
  118.             - height: 40px
  119.             - width: 40px
  120.             - margin: 0
  121.             - padding: 0
  122.             - border-radius: 50%
  123.             - justify-self: end
  124.             - position: relative
  125.             - overflow: visible
  126.           img_cell:
  127.             - height: 100%
  128.             - width: 100%
  129.             - border-radius: 50%
  130.             - overflow: hidden
  131.           entity_picture:
  132.             - height: 100%
  133.             - width: 100%
  134.             - object-fit: cover
  135.             - border-radius: 50%
  136.         custom_fields:
  137.           status:
  138.             card:
  139.               type: "custom:button-card"
  140.               icon: "[[[ return states[variables.person_2_entity].state === 'home' ? 'fapro:house-solid' : 'fapro:plane-solid' ]]]"
  141.               show_name: false
  142.               show_state: false
  143.               show_label: false
  144.               styles:
  145.                 card:
  146.                   - background-color: "[[[ return states[variables.person_2_entity].state === 'home' ? 'var(--color-green)' : 'var(--color-orange)' ]]]"
  147.                   - color: white
  148.                   - border-radius: 50%
  149.                   - height: 18px  # Slightly bigger badge
  150.                   - width: 18px
  151.                   - position: absolute
  152.                   - top: -45px  # Proper top-right floating position
  153.                   - right: -5px
  154.                   - display: flex
  155.                   - align-items: center
  156.                   - justify-content: center
  157.                   - box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.2)
  158.                 icon:
  159.                   - color: white  # Icon in white
  160.                   - width: 60%  # Smaller icon size
  161.                   - height: 60%
  162.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement