Failed to call service when using Button-card

Hello,
I try to configure a simple remote. Button works and send the command when using standard button, but fails if I use custom Button-card with the error “Failed to call service remote/send_command. Must contain at least one of entity_id, device_id, area_Id”.

Code attached. Any idea where if do it wrong?

card_type: horizontal-stack
cards:
  - type: custom:button-card
    entity: remote.harmony_salon
    aspect_ratio: 4/3
    color_type: icon
    layout: vertical
    show_label: false
    show_name: true
    show_state: false
    styles:
      card:
        - border-radius: 10px
        - border: solid 1px var(--primary-color)
        - box-shadow: none
        - padding: 6px 6px
        - margin: 0px 0px
        - '--paper-card-background-color': rgba(0, 0, 0, 0)
      icon:
        - width: 28px
      name:
        - justify-self: middle
        - align-self: end
        - font-size: 14px
        - padding: 0px 0px
        - color: var(--secondary-text-color)
    tap_action:
      action: call-service
      service: remote.send_command
      target:
        entity_id: remote.harmony_salon
      service_data:
        command: PowerToggle
        device: Samsung Amp
    name: Sound1
  - entity: remote.harmony_salon
    tap_action:
      action: call-service
      service: remote.send_command
      target:
        entity_id: remote.harmony_salon
      service_data:
        command: PowerToggle
        device: Samsung Amp
    name: Soundbar
    type: button
    icon: mdi:soundbar
type: custom:hui-element
title: TV

Thanks

This is the correct HA format for this service:

service: remote.send_command
data:
  device: Samsung Amp
  command: PowerToggle
target:
  entity_id: remote.harmony_salon

Thanks for the reply.

It fails too with the button

type: Custom:button-card

But works with a regular button.

Different error though:
image

I found the solution here 🟣 Rounded - Dashboard guide. Correct syntax is:

tap_action:
      action: call-service
      service: remote.send_command
      service_data:
        entity_id: remote.harmony_salon
        device: Samsung Amp
        command: PowerToggle

In my case neither target nor service_data works (however, sending the service call from the “Developer Tools” work).

Developer Tools > Services (WORKS):

service: homeassistant.update_entity
target:
  entity_id:
    - sensor.drive_to_costco
data: {}

My lovelace (DOES NOT WORK):

1 - option:

cards:
- type: vertical-stack
  cards:
  - type: entities
    entities:
    - type: custom:fold-entity-row
      padding: 0
      head:
        type: custom:paper-buttons-row
        buttons:
        - icon: 'mdi:cart-outline'
          name: Costco
          tap_action:
            action: call-service
            service: homeassistant.update_entity
            target:
              entity_id: sensor.drive_to_costco
      entities:
      - <blah.blah_blah>

2 - option:

cards:
- type: vertical-stack
  cards:
  - type: entities
    entities:
    - type: custom:fold-entity-row
      padding: 0
      head:
        type: custom:paper-buttons-row
        buttons:
        - icon: 'mdi:cart-outline'
          name: Costco
          tap_action:
            action: call-service
            service: homeassistant.update_entity
            service_data:
              entity_id: sensor.drive_to_costco
      entities:
      - <blah.blah_blah>
  • sensor.drive_to_costco - comes from a Google Map Travel Time integration…

What am I doing wrong? Please help.

UPDATE:
I have removed the custom:paper-buttons-row from head of custom:fold-entity-row and it works…

QUESTION: Does anybody know how to make it work in the head of fold row?