Advertisement
fablav

Giorno meteo card

Apr 16th, 2024
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 3.55 KB | Software | 0 0
  1. type: custom:mod-card
  2. card_mod:
  3.   style: |
  4.    ha-card {
  5.       background: var(--sidebar);
  6.       border-radius: 9px !important;
  7.     }
  8. card:
  9.   type: custom:button-card
  10.   entity: sensor.meteo_icon_orario
  11.   show_icon: false
  12.   show_name: false
  13.   show_label: true
  14.   tap_action:
  15.     action: none
  16.   label: |
  17.    [[[ return entity.attributes.desc ]]]
  18.   styles:
  19.     grid:
  20.       - grid-template-areas: >-
  21.           "giorno giorno ora ora" "data data ora ora" "icon icon temp temp" "icon icon feellike feellike" "l l l l" "wind wind
  22.          rain rain"
  23.       - grid-template-columns: 1fr 1fr 1fr 1fr
  24.       - grid-template-rows: min-content min-content min-content min-content max-content max-content
  25.     card:
  26.      #- width: 300px
  27.       - padding: 25px
  28.       - padding-top: 0px
  29.       - margin-top: -1px
  30.       - margin-left: -1px
  31.       - margin-right: 1px
  32.  
  33.       - border: solid 10px var(--sidebar)
  34.       - background: none
  35.     label:
  36.       - justify-self: center
  37.       - font-size: 18px
  38.       - font-weight: 600
  39.       - margin-bottom: 10px
  40.       - margin-top: "-20px"
  41.       - text-transform: capitalize
  42.       - color: white
  43.     custom_fields:
  44.       giorno:
  45.         - justify-self: start
  46.         - margin-top: 15px
  47.         - font-size: 18px
  48.         - font-weight: 500
  49.         - color: white
  50.       data:
  51.         - justify-self: start
  52.         - margin-top: px
  53.         - margin-bottom: -30px
  54.         - font-size: 24px
  55.         - font-weight: 500
  56.         - color: white
  57.       ora:
  58.         - justify-self: end
  59.         - margin-top: 0px
  60.         - margin-bottom: -20px
  61.         - font-size: 40px
  62.         - font-weight: 500
  63.         - justify-self: end
  64.         - color: white
  65.       icon:
  66.         - justify-self: end
  67.         - align-self: end
  68.         - color: white
  69.       temp:
  70.         - justify-self: start
  71.         - align-self: end
  72.         - font-size: 36px
  73.         - font-weight: 400
  74.         - color: white
  75.       feellike:
  76.         - justify-self: start
  77.         - align-self: start
  78.         - font-size: 12px
  79.         - font-weight: 400
  80.         - color: white
  81.       wind:
  82.         - justify-self: start
  83.         - font-size: 24px
  84.         - font-weight: 400
  85.         - line-height: 20px
  86.         - margin-left: -15px
  87.         - color: white
  88.       rain:
  89.         - justify-self: start
  90.         - font-size: 24px
  91.         - font-weight: 400
  92.         - line-height: 20px
  93.         - padding-left: 30px
  94.         - color: white
  95.   custom_fields:
  96.     giorno: |
  97.      [[[
  98.         return states['sensor.giorno'].state + ", "
  99.       ]]]
  100.     data: |
  101.      [[[
  102.         return states['sensor.mese'].state
  103.       ]]]
  104.     ora: |
  105.      [[[
  106.         return states['sensor.time'].state
  107.       ]]]
  108.     icon: |
  109.      [[[
  110.         return '<img src="' + entity.state + '" width="140" height="140" />'
  111.       ]]]
  112.     temp: |
  113.      [[[
  114.         return entity.attributes.temp + '<span style="font-size: 0.5em">°C</span>'
  115.       ]]]
  116.     feellike: |
  117.      [[[
  118.         return "Percepita:  " + entity.attributes.percepita + '<span style="font-size: 0.8em">°C</span>'
  119.       ]]]
  120.     wind: |
  121.      [[[
  122.         return  entity.attributes.wind_speed + '<span style="font-size: 0.5em"> m/s</span>' + '<br>' + '<span style="font-size: 0.5em">' + entity.attributes.wind_desc + " (" + entity.attributes.wind_dir +")" + '</span>'
  123.       ]]]
  124.     rain: |
  125.      [[[
  126.         return entity.attributes.precipitation + '<span style="font-size: 0.5em"> mm</span>' +'<br>' + '<span style="font-size: 0.5em">' + "Probabilità  " + entity.attributes.precipitation_percent + ' %</span>'
  127.       ]]]
Tags: ha
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement