Advertisement
Guest User

Dishwasher Card

a guest
Feb 20th, 2025
416
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 3.07 KB | Source Code | 0 0
  1. type: custom:button-card
  2. entity: switch.vaatwasser_power
  3. name: Vaatwasser
  4. show_label: true
  5. double_tap_action: toggle
  6. variables:
  7.   progress: |
  8.    [[[
  9.       return states['sensor.vaatwasser_program_progress'].state
  10.     ]]]
  11. icon: mdi:dishwasher
  12. state:
  13.   - value: 'off'
  14.     label: Uitgeschakeld
  15.     icon: mdi:dishwasher-off
  16.     styles:
  17.       card:
  18.         - background: var(--contrast2)
  19.         - filter: opacity(75%)
  20.       grid:
  21.         - grid-template-areas: '"i" "n" "l"'
  22.         - grid-template-columns: 1fr
  23.         - grid-template-rows: 50px min-content 1fr
  24.       name:
  25.         - color: var(--contrast15)
  26.       icon:
  27.         - color: var(--contrast15)
  28.         - animation: none
  29.       label:
  30.         - justify-self: start
  31.         - align-self: start
  32.         - font-size: 14px
  33.         - font-weight: bold
  34.         - padding: 2px 0
  35.       custom_fields:
  36.         status:
  37.           - display: none
  38.         time:
  39.           - display: none
  40.         progress:
  41.           - display: none
  42. styles:
  43.   card:
  44.     - padding: 20px
  45.     - height: 140px
  46.     - background: linear-gradient(115deg, var(--green-tint) 0%, var(--green) 100%)
  47.   grid:
  48.     - grid-template-areas: '"i i" "n n" "status time" "progress progress"'
  49.     - grid-template-columns: 1fr 1fr
  50.     - grid-template-rows: min-content 1fr min-content 12px
  51.   name:
  52.     - justify-self: start
  53.     - align-self: end
  54.     - font-size: 14px
  55.     - font-family: Inter
  56.     - color: var(--contrast20)
  57.   icon:
  58.     - width: 34px
  59.     - color: var(--contrast20)
  60.     - animation:
  61.        - bounce 1.5s ease-in-out infinite, wash 1s ease-in-out infinite
  62.   img_cell:
  63.     - justify-self: start
  64.     - align-self: start
  65.     - width: 34px
  66.     - height: 34px
  67.   custom_fields:
  68.     status:
  69.       - justify-self: start
  70.       - align-self: end
  71.       - padding-bottom: 6px
  72.       - font-family: Inter
  73.       - font-size: 14px
  74.       - font-weight: bold
  75.       - color: var(--contrast20)
  76.     time:
  77.       - justify-self: end
  78.       - align-self: end
  79.       - padding-bottom: 6px
  80.       - font-size: 14px
  81.       - font-family: Inter
  82.       - color: var(--contrast20)
  83.     progress:
  84.       - justify-self: start
  85.       - margin-top: '-4px'
  86.       - width: 100%
  87.       - border-radius: 6px
  88.       - background: var(--contrast2)
  89.       - height: 12px
  90. custom_fields:
  91.   status: |
  92.    [[[
  93.       return states['sensor.vaatwasser_operation_state'].state  ]]]
  94.   progress: >
  95.     [[[ return `<div><div style="background: var(--green); height: 12px; width:
  96.    ${variables.progress}% "></div></div>` ]]]
  97.   time: |
  98.    [[[
  99.       var time = new Date(states['sensor.vaatwasser_remaining_program_time'].state);
  100.       return time.toLocaleTimeString() ]]]
  101. card_mod:
  102.   style: |
  103.    @keyframes bounce {
  104.       0%, 20%, 50%, 80%, 100% {transform: translateY(0); }
  105.       40% { transform: translateY(-1.2px) rotate(5deg); }
  106.       60% { transform: translateY(-1.1px) rotate(-4deg); }
  107.     }
  108.     @keyframes wash {
  109.       50%  { clip-path: polygon(0 0, 0 100%, 35% 100%, 36% 74%, 31% 43%, 61% 40%, 71% 69%, 62% 78%, 36% 73%, 35% 100%, 100% 100%, 100% 0); }
  110.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement