Advertisement
fablav

Card data ora e meteo

Oct 28th, 2024
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 2.84 KB | Software | 0 0
  1. type: custom:layout-card
  2. layout_type: custom:grid-layout
  3. layout:
  4.   grid-template-columns: 33% 33% 33%
  5.   grid-template-rows: 70px
  6.   grid-template-areas: |
  7.    "data ora meteo"
  8. cards:
  9.   - type: custom:button-card
  10.     name: |
  11.      [[[
  12.         return states['sensor.giorno'].state + ", "
  13.       ]]]
  14.     label: |
  15.      [[[
  16.         return states['sensor.mese'].state
  17.       ]]]
  18.     show_label: true
  19.     styles:
  20.       card:
  21.         - height: 60px
  22.         - background: none
  23.         - border: none
  24.         - overflow: visible
  25.         - padding-left: 8px
  26.       name:
  27.         - justify-self: start
  28.         - font-size: 20px
  29.         - font-weight: 300
  30.       label:
  31.         - justify-self: start
  32.         - font-size: 18px
  33.         - font-weight: 500
  34.     view_layout:
  35.       grid-area: data
  36.   - type: custom:button-card
  37.     name: |
  38.      [[[
  39.         return states['sensor.time'].state
  40.       ]]]
  41.     tap_action:
  42.       action: perform-action
  43.       perform_action: |
  44.        [[[
  45.           this.dispatchEvent(new Event('hass-toggle-menu', { bubbles: true, composed: true}));
  46.           return none;
  47.         ]]]
  48.     styles:
  49.       card:
  50.         - height: 60px
  51.         - background: none
  52.         - border: none
  53.         - overflow: visible
  54.       name:
  55.         - justify-self: center
  56.         - font-size: 30px
  57.         - font-weight: 500
  58.     view_layout:
  59.       grid-area: ora
  60.   - square: false
  61.     type: grid
  62.     columns: 1
  63.     cards:
  64.       - type: custom:button-card
  65.         name: >
  66.          [[[ return Math.round(states['sensor.temperatura_media'].state*10)/10
  67.           + '<span style="font-size:0.7em"> °C</span>']]]
  68.         label: >
  69.          [[[ return states['sensor.meteo_orario'].attributes.temperature +
  70.           '<span style="font-size:0.6em"> °C</span>']]]
  71.         show_label: true
  72.         custom_fields:
  73.           icon: |
  74.            [[[
  75.               var weather = states['sensor.meteo_orario'].state;
  76.               return '<img src="/local/ic/weather_icons/animated/' + weather + '.svg" width="50" height="50">'
  77.             ]]]
  78.         styles:
  79.           grid:
  80.             - grid-template-areas: "\"icon n\" \"icon l\""
  81.           card:
  82.             - height: 60px
  83.             - overflow: visible
  84.             - background: none
  85.             - border: none
  86.             - padding-right: 8px
  87.             - margin-top: "-8px"
  88.           name:
  89.             - justify-self: end
  90.             - font-size: 14px
  91.           label:
  92.             - justfy-self: end
  93.             - font-size: 26px
  94.             - font-weight: 500
  95.           custom_fields:
  96.             icon:
  97.               - justify-self: end
  98.               - align-self: end
  99.               - paddig-right: 10px
  100.               - margin-bottom: "-10px"
  101.         tap_action:
  102.           action: navigate
  103.           navigation_path: "#previsioni"
  104.     view_layout:
  105.       grid-area: meteo
Tags: ha
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement