fablav

Mushroom template card Luci nuovo codice card mod

Nov 6th, 2025
319
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 4.23 KB | Software | 0 0
  1. type: custom:mushroom-template-card
  2. entity: light.luci
  3. primary: ""
  4. secondary: luci
  5. icon: |
  6.  {% if states('sensor.luci_accese')|int >= 0 %}
  7.     {{ 'mdi:numeric-' + states('sensor.luci_accese') + '-circle' }}
  8.   {%- else -%}
  9.     mdi:lightbulb
  10.   {% endif %}
  11. badge_icon: |
  12.  {% if states('sensor.luci_accese')|int >= 1 %}
  13.     mdi:lightbulb-on
  14.   {% else %}
  15.   {% endif %}
  16. tap_action:
  17.   action: fire-dom-event
  18.   browser_mod:
  19.     service: browser_mod.popup
  20.     data:
  21.       dismissable: true
  22.       autoclose: false
  23.       content:
  24.         type: custom:auto-entities
  25.         card:
  26.           type: grid
  27.           title: Luci accese
  28.           columns: 2
  29.           square: false
  30.         card_param: cards
  31.         filter:
  32.           template: >-
  33.             {%- for s in expand(states.light.luci)|selectattr('state','eq','on')
  34.             if s.state == 'on' -%}
  35.               {{
  36.                 {
  37.                   'type': 'custom:button-card',
  38.                   'entity': s.entity_id,
  39.                   'template': 'light_button_accese',
  40.                   'label': s.name,
  41.                   'name': ' '
  42.                
  43.                 }
  44.               }},
  45.             {%- endfor %}
  46.         sort:
  47.           method: state
  48.           numeric: true
  49. vertical: true
  50. features_position: bottom
  51. icon_tap_action:
  52.   action: fire-dom-event
  53.   browser_mod:
  54.     service: browser_mod.popup
  55.     data:
  56.       dismissable: true
  57.       autoclose: false
  58.       content:
  59.         type: custom:auto-entities
  60.         card:
  61.           type: grid
  62.           title: Luci accese
  63.           columns: 2
  64.           square: false
  65.         card_param: cards
  66.         filter:
  67.           template: >-
  68.             {%- for s in expand(states.light.luci)|selectattr('state','eq','on')
  69.             if s.state == 'on' -%}
  70.               {{
  71.                 {
  72.                   'type': 'custom:button-card',
  73.                   'entity': s.entity_id,
  74.                   'template': 'light_button_accese',
  75.                   'label': s.name,
  76.                   'name': ' '
  77.                
  78.                 }
  79.               }},
  80.             {%- endfor %}
  81.         sort:
  82.           method: state
  83.           numeric: true
  84. card_mod:
  85.   style:
  86.     ha-tile-icon$: |
  87.      .container {
  88.         width: 36px !important;
  89.         height: 36px !important;
  90.         {% if states('sensor.luci_accese')|int >= 1 %}
  91.         animation: ping 2s infinite;
  92.         {%- else -%}
  93.           box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.36) !important;
  94.           background: inherit !important;
  95.         {% endif %}
  96.         }
  97.       @keyframes ping {
  98.           0% { box-shadow: 0 0 1px 1px rgba(var(--red-rgb), 0.7); }
  99.           100% { box-shadow: 0 0 5px 10px transparent; }
  100.       }
  101.     ha-tile-badge$: |
  102.      .badge {
  103.         --tile-badge-background-color: yellow;
  104.       }
  105.     .: |
  106.      ha-card:active {
  107.         transform: translateY(1.5px);
  108.         transition: 0s;
  109.       }
  110.       ha-card {
  111.         transform: scale(1.3);
  112.         border: none;
  113.         box-shadow: none;
  114.         padding-left: 0px;
  115.         background: rgba(0,0,0,0);
  116.       }
  117.       ha-tile-icon {
  118.         --mdc-icon-size: 24px;
  119.         {% if states('sensor.luci_accese')|int >= 1 %}
  120.         --tile-color: red;
  121.         --tile-icon-opacity: 0.5;
  122.         {%- else -%}
  123.         --tile-color: var(--disabled-color);
  124.         {% endif %}
  125.       }
  126.       ha-tile-badge {
  127.         #--tile-badge-icon-size: 100px;
  128.         --tile-badge-icon-color: red;
  129.         animation: wobbling 0.7s linear infinite alternate;
  130.       }
  131.       @keyframes wobbling {
  132.       0% {transform: rotate(-20deg);}
  133.       100% {transform: rotate(20deg);}
  134.       }
  135.       ha-state-icon {
  136.         {% if states('sensor.luci_accese')|int >= 1 %}
  137.           animation: alarm 3s ease infinite;
  138.           color: yellow;
  139.         {%- else -%}
  140.         {% endif %}
  141.       }
  142.       @keyframes alarm {
  143.         0%, 80%, 100% { transform: translateY(0); }
  144.         10% { transform: translateY(-2px) rotate(-27deg); }
  145.         20% { transform: translateY(-2px) rotate(21deg); }
  146.         30% { transform: translateY(-2px) rotate(-15deg); }
  147.         40% { transform: translateY(-2px) rotate(9deg); }
  148.         50% { transform: translateY(0); }
  149.         60% { transform: translateY(-1.2px) }
  150.       }
  151.  
Tags: ha
Advertisement
Add Comment
Please, Sign In to add comment