fredrik_persson_

Sensor Batterier Drop-down

Nov 6th, 2023
364
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 2.95 KB | None | 0 0
  1. type: custom:state-switch
  2. view_layout:
  3.   grid-area: "cond1"
  4. entity: input_boolean.sensors_dropdown2
  5. default: "off"
  6. states:
  7.   "on":
  8.     type: custom:button-card
  9.     view_layout:
  10.       grid-area: r1a
  11.     entity: input_boolean.sensors_dropdown2
  12.     name: Sensor batteries
  13.     show_name: true
  14.     show_icon: false
  15.     show_label: false
  16.     show_state: false
  17.     tap_action:
  18.       action: none
  19.     state:
  20.       - value: "on"
  21.         styles:
  22.           card:
  23.             - animation: swipe .5s ease-out
  24.     styles:
  25.       grid:
  26.         - grid-template-areas: '"n" "entities"'
  27.         - grid-template-columns: 1fr
  28.         - grid-template-rows: min-content 1fr
  29.         - column-gap: 8px
  30.       card:
  31.         - height: 100%
  32.         - border-radius: var(--border-radius)
  33.         - box-shadow: var(--box-shadow)
  34.         - padding: 2rem 1rem
  35.         #- background: none
  36.         - overflow: visible
  37.       name:
  38.         - text-align: left
  39.         - font-size: var(--fs-500)
  40.         - font-family: Montserrat
  41.         - font-weight: 500
  42.         - justify-self: center
  43.         - align-self: start
  44.         - color: var(--contrast-100)
  45.       custom_fields:
  46.         entities:
  47.           - align-self: center
  48.           - margin: 0rem
  49.           - text-align: left
  50.           - background: none
  51.     custom_fields:
  52.       entities:
  53.         card:
  54.           type: custom:auto-entities
  55.           card:
  56.             type: entities
  57.             state_color: true
  58.             card_mod:
  59.               style: |
  60.                ha-card {
  61.                   color: green !important;
  62.                 }
  63.           filter:
  64.             include:
  65.               - group: sensor.battery_sensors
  66.                 options:
  67.                   card_mod:
  68.                     style:
  69.                       hui-generic-entity-row:
  70.                         $: |
  71.                          state-badge {
  72.                             display: none;
  73.                           }
  74.                           .info {
  75.                             margin-left: 0px !important;
  76.                           }
  77.                           .text-content {
  78.                             color: var(--contrast-66);
  79.                             font-family: montserrat;
  80.                             font-size: var(--fs-400);
  81.                             font-weight: 500;
  82.                           }
  83.                           .text-content.value {
  84.                             {% if states(config.entity) | float(0) <= 10 %}
  85.                               color: var(--color-red);
  86.                             {% endif %}
  87.                           }
  88.  
  89.             exclude: []
  90.           show_empty: true
  91.           sort:
  92.             method: state
  93.             reverse: true
  94.             ignore_case: false
  95.             ip: false
  96.             numeric: true
  97.  
  98.     extra_styles: |
  99.      @keyframes swipe {
  100.         0% {top: -280px;}
  101.         100% {top: 0px;}
  102.       }
  103.       #card {
  104.         transform-origin: center bottom;
  105.       }
Advertisement
Add Comment
Please, Sign In to add comment