Add a button to the default cover entity card

I’d like to add a button on the entity card for my covers in order to start an automation (set the cover to its “sun” position = ~20% opened).

Mockup

What’s the best way to proceed?

2 Likes

I was just looking for the same. This one here comes close: GitHub - jcwillox/lovelace-paper-buttons-row: Adds highly configurable buttons that use actions and per-state styling.

1 Like

:heart: Thanks a lot, exactly what I was looking for!

Here’s my result using extend_paper_buttons_row:

image

Code:

type: entities
entities:
  - entity: cover.shutter_kitchen
    secondary_info: position
    name: Kitchen
    extend_paper_buttons_row:
      extra_styles: |
        paper-button:hover {
          background-color: #242424;
        }
      buttons:
        - tooltip: Open cover to sun position
          icon: mdi:weather-sunset-down
          styles:
            button:
              color: var(--primary-text-color)
              margin-right: 4px
          tap_action:
            action: call-service
            service: script.open_kitchen_shutter_to_sun_position

Hello @otiel

thank you for your code. Works fine for me, too. But have you managed to get the extra symbol greyed out, when the cover is at the sunset position?

Hi @ZungeWegIchFurze

I didn’t look into it, but if you manage to make it work, I’m interested!

Yes, I found out how to make it work. For your example you could try:

      buttons:
        - tooltip: Open cover to sun position
          icon: mdi:weather-sunset-down
          styles:
            button:
              color: var(--primary-text-color)
              margin-right: 4px
          tap_action:
            action: call-service
            service: script.open_kitchen_shutter_to_sun_position
          styles:
            button:
              color: >-
                {% if is_state_attr('cover.shutter_kitchen', 'current_position', 20) %}
                  lightgrey
                {% endif %}

… assuming the position-attribute for your cover is “current_position” … Maybe you have to change this.

1 Like

sorry if i revive this topic, but i couldn’t find anything regarding this problem.
i have installed “Paper Buttons Row” and tried your code, but when i click/tap on the added button/icon the cover detail page opens as popup (and the action is executed):
hass

the 2nd row is 1:1 your code
what am i missing? :neutral_face:

do i need to block the popup?
hopefully somebody still uses this great addition…

best regards
Peter

I’m still using it everyday, no issue. Show us your code.

type: entities
show_header_toggle: false
entities:
  - entity: cover.buro
    extend_paper_buttons_row:
      buttons:
        - entity: light.buero
          icon: mdi:autorenew
          name: false
          styles:
            button:
              margin-right: 8px
  - entity: cover.buro
    secondary_info: position
    name: Kitchen
    extend_paper_buttons_row:
      extra_styles: |
        paper-button:hover {
          background-color: #242424;
        }
      buttons:
        - tooltip: Open cover to sun position
          icon: mdi:weather-sunset-down
          styles:
            button:
              color: var(--primary-text-color)
              margin-right: 4px
          tap_action:
            action: call-service
            service: script.open_kitchen_shutter_to_sun_position

as you can see in my gif in both rows i get the popup.

I’ve missed in first time in your gif, but you get an error shown at the bottom:

Action script.open_kitchen_shutter_to_sun_position night gefunden.

You need to create this script in order to define what should happen when you click on the button. For that, go to Settings > Automations & scenes > Scripts > Create New. Here’s mine for example:

yeah i know. but that’s not the problem.
now that i added the script there’s still a popup when i press the button:
new

Weird. :thinking:

Are you on the latest version of Paper Buttons Row (2.2.0)?

yes, that’s correct!

I have the same issue. It started a couple weeks ago. Any time I click on the new button I created, the More Info dialog pops up.

Are you both on Home Assistant 2025.5? I’m still on 2025.4, maybe that explains it.

yep, i’m on 2025.5

Just updated to HA 2025.5, and I now have the same issue. It seems like a bug in paper-buttons-row. I’ve created an issue.

In the meantime, I’ve configured the following workaround:

  • Disable the tap_action on the entity so that the “more-info” dialog doesn’t open when clicking on a paper-button.
  • Enable the hold_action to still be able to access the “more-info” dialog by holding click on the entity.

Add the following to each of your entities:

  - entity: cover.xxx
    tap_action:
      action: none
    hold_action:
      action: more-info
    ...
1 Like

thank you, this worked, this is my code now:

type: entities
show_header_toggle: false
entities:
  - entity: cover.buro
    tap_action:
      action: none
    hold_action:
      action: more-info
    secondary_info: position
    extend_paper_buttons_row:
      buttons:
        - entity: input_boolean.cover_buro_auto
          tap_action:
            action: toggle
          state_icons:
            "off": mdi:autorenew-off
            "on": mdi:autorenew
          name: false
          styles:
            button:
              margin-right: 4px
              color: var(--primary-text-color)