custom-cards / button-card

❇️ Lovelace button-card for home assistant
MIT License
1.93k stars 233 forks source link

Vacuum cleaner button not working with custom button #677

Closed dansity closed 1 year ago

dansity commented 1 year ago

Checklist

Describe the bug The following button starts the vacuum cleaner:

show_name: true
show_icon: true
type: button
tap_action:
  action: call-service
  service: vacuum.start
  target:
    device_id: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  data: {}
entity: vacuum.valetudo_oilymealymandrill

Essentially the same button but with button-card returns error:

type: custom:button-card
tap_action:
  action: call-service
  service: vacuum.start
  target:
    device_id: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  data: {}
entity: vacuum.valetudo_oilymealymandrill

Error: must contain at least one entity_id, device_id, area_id

Seems like the part device_id is not getting passed.

Version of the card Version: 3.5.0

To Reproduce This is the configuration I used: As stated above, create a button card for vacuum cleaner then change it to custom:button-card

Desktop (please complete the following information): Any browser

Mariusthvdb commented 1 year ago

button-card uses a different action syntax, check the docs. this is a user error, not a bug

dansity commented 1 year ago

Would you care to elaborate? This is from the Readme example:

  - type: 'custom:button-card'
      color_type: card
      color: rgb(223, 255, 97)
      icon: mdi:volume-plus
      tap_action:
        action: call-service
        service: media_player.volume_up
        service_data:
          entity_id: media_player.living_room_speaker
Mariusthvdb commented 1 year ago

precisely. now check the syntax in your opening post

RomRider commented 1 year ago

target works now in the latest beta and future 4.0.0 release.