I have created a screen with buttons for my smart meross power strips.
The code for this is below:
- type: horizontal-stack
cards:
- type: custom:mod-card
style: |
ha-card {
border: 4px solid white;
background: white;
opacity: 90%;
box-shadow: none;
}
card:
type: custom:vertical-stack-in-card
cards:
- type: horizontal-stack
cards:
- type: vertical-stack
cards:
- type: custom:button-card
template: title
name: Living Room Left 1
variables:
background_color: black
color: dark-grey
icon: mdi:power-plug
- type: horizontal-stack
cards:
- type: custom:button-card
color_type: blank-card
- type: custom:decluttering-card
template: meross_button_template
variables:
- name: Power
- icon: power-standby
- entity: >-
switch.smart_switch_2209056530394554060148e1e9a51b13_outlet
- type: custom:button-card
color_type: blank-card
- type: horizontal-stack
cards:
- type: custom:decluttering-card
template: meross_button_template
variables:
- name: 1
- icon: numeric-1-box
- entity: >-
switch.smart_switch_2209056530394554060148e1e9a51b13_outlet_1
- type: custom:button-card
color_type: blank-card
- type: custom:decluttering-card
template: meross_button_template
variables:
- name: 2
- icon: numeric-2-box
- entity: >-
switch.smart_switch_2209056530394554060148e1e9a51b13_outlet_2
- type: horizontal-stack
cards:
- type: custom:decluttering-card
template: meross_button_template
variables:
- name: 3
- icon: numeric-3-box
- entity: >-
switch.smart_switch_2209056530394554060148e1e9a51b13_outlet_3
- type: custom:button-card
color_type: blank-card
- type: custom:decluttering-card
template: meross_button_template
variables:
- name: Glow
- icon: numeric-4-box
- entity: >-
switch.smart_switch_2209056530394554060148e1e9a51b13_outlet_4
- type: horizontal-stack
cards:
- type: custom:decluttering-card
template: meross_button_template
variables:
- name: 5
- icon: numeric-5-box
- entity: >-
switch.smart_switch_2209056530394554060148e1e9a51b13_outlet_5
- type: custom:button-card
color_type: blank-card
- type: custom:decluttering-card
template: meross_button_template
variables:
- name: 6
- icon: numeric-6-box
- entity: >-
switch.smart_switch_2209056530394554060148e1e9a51b13_outlet_6
- type: horizontal-stack
cards:
- type: custom:button-card
color_type: blank-card
- type: custom:decluttering-card
template: meross_button_template
variables:
- name: USB
- icon: usb-port
- entity: >-
switch.smart_switch_2209056530394554060148e1e9a51b13_outlet_7
- type: custom:button-card
color_type: blank-card
This looks fine but was not what I really wanted to do. As I use horizontal and vertical cards, I have had to have these blank cards in the grid yo make this look ok. However, I really would like to get rid of these to save webpage space and the grid layout currently plus what I would like is below:
I would still want the same style including the white border around the horizontal stack.
All of this may not be possible as I don’t know if it is possible to define a grid with what are basically half width empty button cards. Help would be appreciated.