I really like the compact layout of the multiple-entity-row custom control, but it doesn’t allow you to define different double-click and hold actions. Also, the styling is not as flexible as button-card.
I have therefore re-implemented the design using a few custom controls, namely vertical-stack-in-card, layout-card’s flexible grid control, and of course button-card. I thought I’d share the code in case it was useful to others
While I have put my entitles on actual buttons, because that makes sense for my use case, you can style it as a flat card by adding the “border-width: 0” and “background: transparent” styles to card styles for the entity buttons as well as to the row buttons.
The stack-in-card custom control should work just as well as the vertical-stack-in-card control if you prefer to use that.
(The reason for using vertical-stack-in-card at all is that layout-card won’t display the title on a grid.)
type: custom:vertical-stack-in-card
title: Lights
cards:
- type: custom:layout-card
layout_type: grid
columns: 4
square: false
title: Lights
entities:
- entity: light.downstairs_lights
type: custom:button-card
name: Groups
show_name: true
show_icon: true
show_state: false
show_last_changed: false
show_label: false
color: auto
styles:
card:
- height: 100%
- background: transparent
- border-width: 0
grid:
- grid-template-areas: '"i n"'
- grid-template-columns: 2fr 3fr
name:
- justify-self: start
- type: custom:button-card
entity: light.downstairs_lights
name: Ground
show_name: true
show_icon: true
show_state: false
show_last_changed: false
show_label: false
color: auto
styles:
name:
- font-size: 66%
double_tap_action:
action: more-info
hold_action:
action: more-info
tap_action:
action: call-service
service: light.toggle
service_data:
entity_id: light.downstairs_lights
- type: custom:button-card
entity: light.all_lights
name: All
show_name: true
show_icon: true
show_state: false
show_last_changed: false
show_label: false
color: auto
styles:
name:
- font-size: 66%
double_tap_action:
action: more-info
hold_action:
action: more-info
tap_action:
action: call-service
service: light.toggle
service_data:
entity_id: light.all_lights
- type: custom:button-card
entity: script.1584181003341
name: Reset
show_name: true
show_icon: true
show_state: false
show_last_changed: false
show_label: false
color: auto
styles:
name:
- font-size: 66%
double_tap_action:
action: more-info
hold_action:
action: more-info
tap_action:
action: call-service
service: script.1584181003341
- entity: light.kitchen_lights
type: custom:button-card
name: Kitchen
show_name: true
show_icon: true
show_state: false
show_last_changed: false
show_label: false
color: auto
styles:
card:
- height: 100%
- background: transparent
- border-width: 0
grid:
- grid-template-areas: '"i n"'
- grid-template-columns: 2fr 3fr
name:
- justify-self: start
double_tap_action:
action: more-info
hold_action:
action: more-info
tap_action:
action: call-service
service: light.toggle
service_data:
entity_id: light.downstairs_lights
- type: custom:button-card
entity: light.kitchen
show_name: true
show_icon: true
show_state: false
show_last_changed: false
show_label: false
color: auto
name: Main
styles:
name:
- font-size: 66%
double_tap_action:
action: more-info
hold_action:
action: more-info
tap_action:
action: call-service
service: light.toggle
service_data:
entity_id: light.kitchen
- type: custom:button-card
entity: light.kitchen_lights
show_name: true
show_icon: true
show_state: false
show_last_changed: false
show_label: false
color: auto
name: Kitchen
styles:
name:
- font-size: 66%
double_tap_action:
action: more-info
hold_action:
action: more-info
tap_action:
action: call-service
service: light.toggle
service_data:
entity_id: light.kitchen_lights
- type: custom:button-card
entity: light.conservatory
show_name: true
show_icon: true
show_state: false
show_last_changed: false
show_label: false
color: auto
name: Cons.
styles:
name:
- font-size: 66%
double_tap_action:
action: more-info
hold_action:
action: more-info
tap_action:
action: call-service
service: light.toggle
service_data:
entity_id: light.conservatory
- entity: light.hall_lights
type: custom:button-card
name: Hall
show_name: true
show_icon: true
show_state: false
show_last_changed: false
show_label: false
color: auto
styles:
card:
- height: 100%
- background: transparent
- border-width: 0
grid:
- grid-template-areas: '"i n"'
- grid-template-columns: 2fr 3fr
name:
- justify-self: start
double_tap_action:
action: more-info
hold_action:
action: more-info
tap_action:
action: call-service
service: light.toggle
service_data:
entity_id: light.hall_lights
- type: custom:button-card
entity: light.hall
show_name: true
show_icon: true
show_state: false
show_last_changed: false
show_label: false
color: auto
name: Door
styles:
name:
- font-size: 66%
double_tap_action:
action: more-info
hold_action:
action: more-info
tap_action:
action: call-service
service: light.toggle
service_data:
entity_id: light.hall
- type: custom:button-card
entity: light.hall_lights
show_name: true
show_icon: true
show_state: false
show_last_changed: false
show_label: false
color: auto
name: Hall
styles:
name:
- font-size: 66%
double_tap_action:
action: more-info
hold_action:
action: more-info
tap_action:
action: call-service
service: light.toggle
service_data:
entity_id: light.hall_lights
- type: custom:button-card
entity: light.landing
show_name: true
show_icon: true
show_state: false
show_last_changed: false
show_label: false
color: auto
name: Landing
styles:
name:
- font-size: 66%
double_tap_action:
action: more-info
hold_action:
action: more-info
tap_action:
action: call-service
service: light.toggle
service_data:
entity_id: light.landing
layout:
grid-template-columns: 40% 20% 20% 20%
place-items: stretch stretch