Creating multiple entity-buttons on one card?

The docs make it look like I can have multiple buttons per card, but when I try and add them I get the following error:

YAML Error: YAMLException: duplicated mapping key at line 4, column 1: type: entity-button ^

Am I doing something wrong with my code?

type: entity-button
entity: script.teac_vol_up
icon: 'mdi:volume-plus'
type: entity-button
entity: script.teac_vol_down
icon: 'mdi:volume-plus'

Needs to be a list, i think.

- type: entity-button
  entity: script.teac_vol_up
  icon: 'mdi:volume-plus'
- type: entity-button
  entity: script.teac_vol_down
  icon: 'mdi:volume-plus'

Thanks for your reply. Unfortunately with that, I get the following error:

YAML Error: TypeError: type is undefined

Works for me, showing the buttons.

  - title: Test
    cards:
      - type: entity-button
        entity: script.cover_test1_open
        icon: 'mdi:volume-plus'
      - type: entity-button
        entity: script.cover_test1_close
        icon: 'mdi:volume-plus'

But you have to do more to call a script.

BTW: You’re using LL?

Sorry, I’m not entirely sure what that means. I’ve since modified the code to actually call the script with hold_action and touch_action.

Here is a screenshot of what I’m seeing:
image

LL means Lovelace, and your screenshot shows me that you’re using it.

BUT, i’m not using this clicky… clicky… mode, i’m using my good old editor and edit the ui-lovelace.yaml.

Sorry, maybe someone can help?

Ah I see! My bad.

I’ll try adding it to the config file directly. Thanks again for your help.

Ok, so I’ve been into the config file, this is how it looks:

  - type: entity-button
    name: TV Volume Up
    entity: script.teac_vol_up_5
    icon: 'mdi:volume-plus'
    tap_action:
      action: call-service
      service: script.teac_vol_up
    hold_action:
      action: call-service
      service: script.teac_vol_up_5
  - type: entity-button
    name: TV Volume Down
    entity: script.teac_vol_down_5
    icon: 'mdi:volume-minus'
    tap_action:
      action: call-service
      service: script.teac_vol_down
    hold_action:
      action: call-service
      service: script.teac_vol_down_5

So it is a list… however they still show as two, huge volume buttons, instead of being on the same card:
image

Then you need the Horizontal Stack Card

3 Likes

Solved - exactly what I was after. Thank you for your help!

image