Set height for custom button card not possible

Hey there,
I’m struggeling with changing the height of the custom button card. Here’s my code:

square: false
type: grid
cards:

  • show_name: false
    show_icon: true
    type: button
    tap_action:
    action: navigate
    navigation_path: /lovelace-home/devices
    icon: mdi:robot-vacuum
    icon_height: 30px
  • show_name: false
    show_icon: true
    type: custom:button-card
    tap_action:
    action: call-service
    service: script.wachhund_toggle
    target: {}
    icon: mdi:alarm-light
    color: rgb(255, 0, 0)
    state:
    • value: ‘off’
      icon: mdi:alarm-light-off
      entity: input_boolean.wachhund
      show_state: false
      hold_action:
      action: none
  • show_name: false
    show_icon: true
    type: button
    tap_action:
    action: navigate
    navigation_path: /lovelace-home/funktionen
    icon: mdi:bell-outline
    icon_height: 30px

I can change the overall height of the 1st and 3rd item in the grid but I’m not able to change the height of grid-item-2 which is the custom button card with a service call.

Any idea?

@JimboJones3101 You have to add styles on card to control the height.

Here is an example.

type: custom:button-card
entity: sensor.propane_2
show_state: false
show_name: false
size: 5em
styles:
  card:
   - background: red
   - height: 100px
   - width: 100px
square: false
type: grid
cards:
  - show_name: false
    show_icon: true
    type: button
    tap_action:
      action: navigate
      navigation_path: /lovelace-home/devices
    icon: mdi:robot-vacuum
    icon_height: 30px
  - show_name: false
    show_icon: true
    type: custom:button-card
    tap_action:
      action: call-service
      service: script.wachhund_toggle
      target: {}
    color: rgb(255, 0, 0)
    state:
      - value: 'off'
        icon: mdi:alarm-light-off
        height: 30px
      - value: 'on'
        icon: mdi:alarm-light
        height: 30px
    entity: input_boolean.wachhund
    show_state: false
    hold_action:
      action: none
  - show_name: false
    show_icon: true
    type: button
    tap_action:
      action: navigate
      navigation_path: /lovelace-home/funktionen
    icon: mdi:bell-outline
    icon_height: 30px

This is the preformatted text.

Hey Liquid,
using your

styles:
  card:
   - background: red
   - height: 100px
   - width: 100px

code solved it for me. I was trying to set the icon_height which seemingly doesn’t work. Defining the height works perfectly fine.

Thanks mate

1 Like

Happy to assist and glad you found a resolution!