Hopefully you can help me.
I am doing a new dashboard using the grid-layout, but I have some differences between what I see on my browser (PC) and on my iOS App.
I donāt understand why I have that big space between the first and the second card.
Here you can find my code:
title: Home
views:
- title: Home
path: home
icon: 'mdi:home-roof'
panel: false
type: custom:grid-layout
layout:
grid-template-columns: 40% 40% 20%
grid-template-rows: 100%
grid-template-areas: |
"overview . ."
"navbar scene ."
"test . ."
mediaquery:
"(max-width: 700px)":
grid-template-columns: 100%
grid-template-areas: |
"overview"
"navbar"
"scene"
"test"
"(max-width: 1700px)":
grid-template-columns: 50% 50%
grid-template-areas: |
"overview ."
"navbar scene"
"test ."
badges: []
cards:
### OVERVIEW
- type: vertical-stack
view_layout:
grid-area: overview
cards:
- type: markdown
content: |
# Home
style:
.: |
ha-card {
--ha-card-background: none !important;
box-shadow: none !important;
height: 20px;
}
ha-markdown:
$: |
h1 {
font-size: 20px;
font-weight: bold;
font-family: Helvetica;
letter-spacing: '-0.01em';
}
- type: markdown
content: |
# La temperatura in casa ĆØ {{ states('sensor.daikin_sala_inside_temperature') | round(1) }}Ā°, mentre fuori ci sono {{states('sensor.openweathermap_temperature') | round(1) }}Ā°.
{% if is_state('binary_sensor.stato_asciugatrice', 'on') %}# Asciugatrice accesa. {% else %} {% endif %}
{% if is_state('group.sensori_porta', 'on') %}# Il lucernaio e lo scurone sono aperti. {% elif is_state('binary_sensor.lucernaio_studio_contact', 'on') %}# Il lucernaio in studio ĆØ aperto. {% elif is_state('binary_sensor.scurone_sala_contact', 'on') %}# Lo scurone in sala ĆØ aperto. {% else %} {% endif %}
style:
.: |
ha-card {
--ha-card-background: none !important;
box-shadow: none !important;
height: min(25vw, 100px);
}
ha-markdown:
$: |
h1 {
font-size: 15px;
font-weight: bold;
font-family: Helvetica;
letter-spacing: '-0.01em';
}
### NAVBAR
- type: vertical-stack
view_layout:
grid-area: navbar
cards:
- type: horizontal-stack
cards:
- type: 'custom:button-card'
icon: 'mdi:home-roof' # Change this to the icon you want to display
show_icon: true
show_name: false # Change to "true" if you need to show the Button name
styles:
card:
- width: 60px
- height: 60px
- margin: 10px
- border-radius: 15px
- box-shadow: |
[[[ return states['sun.sun'].state == 'below_horizon'
? 'inset -3px -3px 5px rgba(50, 50, 50, .5), inset 3px 3px 5px rgba(0, 0, 0, .3)'
: 'inset -3px -3px 5px rgba(255, 255, 255, .65), inset 3px 3px 5px rgba(0, 0, 0, .035)';
]]]
- background-color: var(--primary-background-color)
icon:
- color: var(--paper-item-icon-active-color)
state:
- value: 'on'
styles:
card:
- box-shadow: |
[[[ return states['sun.sun'].state == 'below_horizon'
? 'inset -3px -3px 5px rgba(50, 50, 50, .5), inset 3px 3px 5px rgba(0, 0, 0, .3)'
: 'inset -3px -3px 5px rgba(255, 255, 255, .65), inset 3px 3px 5px rgba(0, 0, 0, .035)';
]]]
icon:
- color: var(--paper-item-icon-active-color)
tap_action:
action: toggle
haptic: light
- type: 'custom:button-card'
icon: 'mdi:floor-plan' # Change this to the icon you want to display
show_icon: true
show_name: false # Change to "true" if you need to show the Button name
styles:
card:
- width: 60px
- height: 60px
- margin: 10px
- border-radius: 15px
- box-shadow: |
[[[ return states['sun.sun'].state == 'below_horizon'
? '-5px -5px 10px rgba(50, 50, 50, .2), 6px 6px 10px rgba(0, 0, 0, .08)'
: '-5px -5px 8px rgba(255, 255, 255, .5), 5px 5px 8px rgba(0, 0, 0, .03)';
]]]
- background-color: var(--primary-background-color)
icon:
- color: var(--primary-text-color)
state:
- value: 'on'
styles:
card:
- box-shadow: |
[[[ return states['sun.sun'].state == 'below_horizon'
? 'inset -3px -3px 5px rgba(50, 50, 50, .5), inset 3px 3px 5px rgba(0, 0, 0, .3)'
: 'inset -3px -3px 5px rgba(255, 255, 255, .65), inset 3px 3px 5px rgba(0, 0, 0, .035)';
]]]
icon:
- color: var(--paper-item-icon-active-color)
tap_action:
action: navigate
navigation_path: /ndr-ui/rooms
haptic: light
- type: 'custom:button-card'
icon: 'mdi:youtube-tv' # Change this to the icon you want to display
show_icon: true
show_name: false # Change to "true" if you need to show the Button name
styles:
card:
- width: 60px
- height: 60px
- margin: 10px
- border-radius: 15px
- box-shadow: |
[[[ return states['sun.sun'].state == 'below_horizon'
? '-5px -5px 10px rgba(50, 50, 50, .2), 6px 6px 10px rgba(0, 0, 0, .08)'
: '-5px -5px 8px rgba(255, 255, 255, .5), 5px 5px 8px rgba(0, 0, 0, .03)';
]]]
- background-color: var(--primary-background-color)
icon:
- color: var(--primary-text-color)
state:
- value: 'on'
styles:
card:
- box-shadow: |
[[[ return states['sun.sun'].state == 'below_horizon'
? 'inset -3px -3px 5px rgba(50, 50, 50, .5), inset 3px 3px 5px rgba(0, 0, 0, .3)'
: 'inset -3px -3px 5px rgba(255, 255, 255, .65), inset 3px 3px 5px rgba(0, 0, 0, .035)';
]]]
icon:
- color: var(--paper-item-icon-active-color)
tap_action:
action: navigate
navigation_path: /ndr-ui/media
haptic: light
- type: 'custom:button-card'
icon: 'mdi:server' # Change this to the icon you want to display
show_icon: true
show_name: false # Change to "true" if you need to show the Button name
styles:
card:
- width: 60px
- height: 60px
- margin: 10px
- border-radius: 15px
- box-shadow: |
[[[ return states['sun.sun'].state == 'below_horizon'
? '-5px -5px 10px rgba(50, 50, 50, .2), 6px 6px 10px rgba(0, 0, 0, .08)'
: '-5px -5px 8px rgba(255, 255, 255, .5), 5px 5px 8px rgba(0, 0, 0, .03)';
]]]
- background-color: var(--primary-background-color)
icon:
- color: var(--primary-text-color)
state:
- value: 'on'
styles:
card:
- box-shadow: |
[[[ return states['sun.sun'].state == 'below_horizon'
? 'inset -3px -3px 5px rgba(50, 50, 50, .5), inset 3px 3px 5px rgba(0, 0, 0, .3)'
: 'inset -3px -3px 5px rgba(255, 255, 255, .65), inset 3px 3px 5px rgba(0, 0, 0, .035)';
]]]
icon:
- color: var(--paper-item-icon-active-color)
tap_action:
action: navigate
navigation_path: /ndr-ui/sistema
haptic: light
### SCENE
- type: horizontal-stack
view_layout:
grid-area: scene
cards:
- type: 'custom:button-card'
entity: sensor.pc # Change this to the entity you want to control
icon: 'mdi:microsoft-windows'
name: PC
show_icon: true
show_name: false # Change to "true" if you need to show the Button name
styles:
card:
- width: 60px
- height: 60px
- margin: 10px
- border-radius: 15px
- box-shadow: |
[[[ return states['sun.sun'].state == 'below_horizon'
? '-5px -5px 8px rgba(50, 50, 50, .2), 5px 5px 8px rgba(0, 0, 0, .08)'
: '-4px -4px 8px rgba(255, 255, 255, .5), 5px 5px 8px rgba(0, 0, 0, .03)';
]]]
- background-color: var(--primary-background-color)
icon:
- color: var(--primary-text-color)
state:
- value: 'Online'
styles:
card:
- box-shadow: |
[[[ return states['sun.sun'].state == 'below_horizon'
? 'inset -3px -3px 5px rgba(50, 50, 50, .5), inset 3px 3px 5px rgba(0, 0, 0, .3)'
: 'inset -3px -3px 5px rgba(255, 255, 255, .65), inset 3px 3px 5px rgba(0, 0, 0, .035)';
]]]
icon:
- color: var(--paper-item-icon-active-color)
tap_action:
action: call-service
haptic: light
service: switch.turn_on
service_data:
entity_id: switch.pc_studio
- type: 'custom:button-card'
entity: script.casa_uscita # Change this to the entity you want to control
icon: 'mdi:door-closed-lock'
name: Esco
show_icon: true
show_name: false # Change to "true" if you need to show the Button name
styles:
card:
- width: 60px
- height: 60px
- margin: 10px
- border-radius: 15px
- box-shadow: |
[[[ return states['sun.sun'].state == 'below_horizon'
? '-5px -5px 8px rgba(50, 50, 50, .2), 5px 5px 8px rgba(0, 0, 0, .08)'
: '-4px -4px 8px rgba(255, 255, 255, .5), 5px 5px 8px rgba(0, 0, 0, .03)';
]]]
- background-color: var(--primary-background-color)
icon:
- color: var(--primary-text-color)
state:
- value: 'Online'
styles:
card:
- box-shadow: |
[[[ return states['sun.sun'].state == 'below_horizon'
? 'inset -3px -3px 5px rgba(50, 50, 50, .5), inset 3px 3px 5px rgba(0, 0, 0, .3)'
: 'inset -3px -3px 5px rgba(255, 255, 255, .65), inset 3px 3px 5px rgba(0, 0, 0, .035)';
]]]
icon:
- color: var(--paper-item-icon-active-color)
tap_action:
action: call-service
service: script.uscita_casa
haptic: light
- type: 'custom:button-card'
entity: switch.cancello # Change this to the entity you want to control
icon: 'mdi:gate'
name: Cancello
show_icon: true
show_name: false # Change to "true" if you need to show the Button name
styles:
card:
- width: 60px
- height: 60px
- margin: 10px
- border-radius: 15px
- box-shadow: |
[[[ return states['sun.sun'].state == 'below_horizon'
? '-5px -5px 8px rgba(50, 50, 50, .2), 5px 5px 8px rgba(0, 0, 0, .08)'
: '-4px -4px 8px rgba(255, 255, 255, .5), 5px 5px 8px rgba(0, 0, 0, .03)';
]]]
- background-color: var(--primary-background-color)
icon:
- color: var(--primary-text-color)
state:
- value: 'Online'
styles:
card:
- box-shadow: |
[[[ return states['sun.sun'].state == 'below_horizon'
? 'inset -3px -3px 5px rgba(50, 50, 50, .5), inset 3px 3px 5px rgba(0, 0, 0, .3)'
: 'inset -3px -3px 5px rgba(255, 255, 255, .65), inset 3px 3px 5px rgba(0, 0, 0, .035)';
]]]
icon:
- color: var(--paper-item-icon-active-color)
tap_action:
action: toggle
haptic: light