Advertisement
fablav

Card lavatrice

Mar 25th, 2024 (edited)
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 3.66 KB | Software | 0 0
  1. type: custom:stack-in-card
  2. mode: horizontal
  3. cards:
  4.   - type: custom:stack-in-card
  5.     cards:
  6.       - type: custom:mushroom-template-card
  7.         entity: binary_sensor.lavatrice_run
  8.         primary: |
  9.          {% if is_state (config.entity, 'on') %}
  10.           {{ states('sensor.lavatrice_active_power') | round(0) }} W
  11.           {% else %}
  12.             Lavatrice
  13.           {% endif %}
  14.         secondary: |
  15.          {% if is_state (config.entity, 'on') %}
  16.           {{states('sensor.lavatrice_fase_programma')}}
  17.           {% else %}
  18.             Spenta
  19.           {% endif %}
  20.         icon: mdi:washing-machine
  21.         badge_icon: |
  22.          {% if is_state (config.entity, 'on') %}
  23.             mdi:tshirt-crew
  24.           {% endif %}
  25.         badge_color: red
  26.         tap_action:
  27.           action: none
  28.         hold_action:
  29.           action: none
  30.         icon_color: '{{ ''orange'' if is_state(entity, ''on'') else ''disabled'' }}'
  31.         fill_container: true
  32.         layout: horizontal
  33.         multiline_secondary: false
  34.         card_mod:
  35.           style: |
  36.            ha-card {
  37.               background: none !important;
  38.               border: none;
  39.               box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.36) !important;
  40.               height: 66px !important;
  41.               --card-primary-color: black; --card-secondary-color: black;
  42.             }
  43.             ha-state-icon {
  44.               animation: {{ 'shake 400ms ease-in-out infinite' if is_state('binary_sensor.lavatrice_run', 'on') }};
  45.               transform-origin: 50% 58%;
  46.               clip-path: polygon(0 0, 0 100%, 35% 100%, 34% 68%, 60% 41%, 71% 56%,
  47.              65% 74%, 47% 79%, 32% 69%, 35% 100%, 100% 100%, 100% 0);
  48.             } @keyframes shake {
  49.               0%, 100% { transform: translate(0, 0) rotate(0); }
  50.               20%  { transform: translate(0.4px, -0.4px) rotate(-4deg); }
  51.               40%  { transform: translate(-0.4px, 0.4px) rotate(4deg); }
  52.               60%  { transform: translate(0.4px, 0.4px) rotate(-4deg); }
  53.               80%  { transform: translate(-0.4px, -0.4px) rotate(4deg); }
  54.             }
  55.       - type: custom:mushroom-template-card
  56.         icon: mdi:washing-machine
  57.         entity: binary_sensor.lavatrice_run
  58.         icon_color: '{{ ''blue'' if is_state(entity, ''on'') else ''disabled'' }}'
  59.         tap_action:
  60.           action: navigate
  61.           navigation_path: /bubble-d/lavatrice
  62.         card_mod:
  63.           style:
  64.             mushroom-shape-icon$: |
  65.              .shape {
  66.                 background: none !important;
  67.                 box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.36) !important;
  68.               }
  69.             .: |
  70.              ha-card {
  71.                 background: none !important;
  72.                 box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.36) !important;
  73.                 border: none;
  74.                
  75.                 height: 66px !important;
  76.                 top: -74px;
  77.               }
  78.               ha-state-icon {
  79.                 {{ 'animation:spin 1s linear infinite;' if is_state('binary_sensor.lavatrice_run', 'on') }};
  80.                 transform-origin: 50% 58%;
  81.                 clip-path: circle(21.7% at 50% 58%);
  82.               }
  83.     card_mod:
  84.       style: |
  85.        ha-card {
  86.           background-image: url( '/local/ic/lavatrice.png' );
  87.           background-blend-mode: overlay;
  88.           background-position: top;
  89.           background-repeat: no-repeat;
  90.           background-size: 105%;
  91.           background-color: rgba(var(--rgb-card-background-color),0.3);
  92.           position: relative;
  93.           height: 66px !important;
  94.           border: none;
  95.           box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.36) !important;
  96.         }
  97.  
Tags: ha
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement