Ok I had a stab at it anyway, and I found a way to do it
It’s not perfect, but maybe someone can help make it better.
For my resolution it’s very close to Mattias’ work, just a few pixels different, but maybe for other resolutions it won’t work as well
EDIT: I changed some things, and it look pretty much perfect now
EDIT2: Ok, so let’s make a template, and show how to add a lights group
EDIT3: An important addendum, if you want to replace the title of a swipe-card, your browser will go bananas… to make it work put the custom:mod-card (which is around the custom:swipe-card) in a grid card with columns: 1
See the example at the bottom of this post
Add the following to button_card_templates.yaml:
#################################################
# #
# TITLE_BUTTON #
# #
#################################################
title_button:
styles:
card:
- background: none
- padding: 0px 0px 0px 0px
name:
- justify-self: left
- font-size: 2.4vw
- font-family: SF Text
- font-weight: 500
- line-height: 0
- color: rgba(255, 255, 255, 0.8)
- letter-spacing: 0.5px
- padding: 1vw 0px 2vw 0px
Then, as the image shows, you need to add a vertical image within the grids, within ui-lovelace.yaml
The first item in the vertical stack is going to be a custom:button-card with the template we added
In the custom button card you can define you tap_action, for me it’s to toggle a group of lights
- type: vertical-stack
view_layout:
grid-area: Woonkamer
cards:
- type: custom:button-card
name: Woonkamer
show_icon: false
show_state: false
tap_action:
action: call-service
service: light.toggle
service_data:
entity_id: light.living_kitchen
template: title_button
- type: grid
columns: 2
cards:
- type: custom:button-card
entity: light.livingroom_switches
name: Lampen
hold_action: !include popup/livingroom_lights.yaml
template:
- base
- icon_shade
- type: custom:button-card
entity: light.livingroom_dimmers
name: Dimmers
hold_action: !include popup/livingroom_dimmers.yaml
template:
- base
- icon_livinroom
- type: custom:button-card
entity: sensor.lumi_lumi_weather_temperature
name: Temperatuur
tap_action: !include popup/temperature.yaml
hold_action:
action: none
custom_fields:
graph:
card:
entities:
- sensor.lumi_lumi_weather_temperature
template:
- temperature
- icon_temp
variables:
popup_name: Woonkamer
- type: custom:button-card
entity: cover.curtains
name: Gordijnen
hold_action: !include popup/curtains.yaml
template:
- curtains
- icon_curtains_combined
→ Example to add a clickable title to a swipe-card
- type: vertical-stack
view_layout:
grid-area: Overig
cards:
- type: custom:button-card
name: Overig
show_icon: false
show_state: false
tap_action:
action: call-service
service: light.toggle
service_data:
entity_id: light.lights_other
template: title_button
- type: grid
columns: 1
cards:
- type: custom:mod-card
style:
swipe-card:
$: |
.swiper-container {
padding: 0px 0px 20px 0px !important;
}
card:
type: custom:swipe-card
start_card: 1
parameters:
roundLengths: true
effect: coverflow
speed: 650
spaceBetween: 20
threshold: 7
coverflowEffect:
rotate: 80
depth: 300
cards:
- type: grid
columns: 2
cards:
- type: custom:button-card
entity: light.kitchen
name: Keuken
hold_action: !include popup/dimmer.yaml
template:
- dimmer
- icon_spot