button-card icon indicating copy to clipboard operation
button-card copied to clipboard

Required ket not provided @ data ['media_content_type']

Open TGMivo opened this issue 1 year ago • 1 comments

This standard button is working, play radio browser

show_name: true
show_icon: true
type: button
tap_action:
  action: call-service
  service: media_player.play_media
  data:
    media_content_id: media-source://radio_browser/bbabb958-aa77-4d52-80c6-d86c9268721f
    media_content_type: audio/mpeg
  target:
    entity_id: media_player.living_room
name: BE

I want it with an custom icon :)

show_name: true
show_icon: true
type: custom:button-card
show_entity_picture: true
entity_picture: /local/radio/NPO_Radio_1.svg.png
tap_action:
  action: call-service
  service: media_player.play_media
  data:
    media_content_id: media-source://radio_browser/96126f56-0601-11e8-ae97-52543be04c81
    media_content_type: audio/mpeg
  target:
    entity_id: media_player.living_room

But i get an error (dutch) "Kan service media_player niet aanroepen. Required ket not provided @ data ['media_content_type']

How do i get it working?

TGMivo avatar Oct 16 '22 16:10 TGMivo

This is not the right format for button-card. It needs to be the old service format: https://github.com/custom-cards/button-card#action

tap_action:
  action: call-service
  service: media_player.play_media
  service_data:
    media_content_id: media-source://radio_browser/96126f56-0601-11e8-ae97-52543be04c81
    media_content_type: audio/mpeg
    entity_id: media_player.living_room

RomRider avatar Dec 08 '22 10:12 RomRider