Mini-media-player - shortcut buttons - start automation?

I have an automation for playing a radio browser feed.

alias: onkyo_play_nostalgie
description: ""
trigger: []
condition: []
action:
  - service: media_player.play_media
    target:
      entity_id: media_player.stereo
    data:
      media_content_id: media-source://radio_browser/451491bd-624e-41e8-ab4c-71816f10611e
      media_content_type: audio/mpeg
    metadata:
      title: Nostalgie Vlaanderen
      thumbnail: >-
        https://nl.nostalgie.be/icons/icon-144x144.png?v=afcbc45fada5babe32741403f76fa06c
      media_class: music
      children_media_class: null
      navigateIds:
        - {}
        - media_content_type: app
          media_content_id: media-source://radio_browser
        - media_content_type: music
          media_content_id: media-source://radio_browser/country/BE
mode: single

Trying to get a button in my mini-media-player, so that on pressing the button, the automation starts but getting errors

Here’s my code in the mini-media-player, anyone knows a solution

type: custom:mini-media-player
volume_stateless: true
entity: media_player.stereo_2
toggle_power: true
hide:
  play_pause: true
group: false
source: full
artwork: full-cover
volume_step: '5'
max_volume: '75'
min_volume: '20'
shortcuts:
  columns: 2
  buttons:
    - type: action
      action: call-service
      id: automation.onkyo_play_nostalgie

I’m getting this error on buttonpress

Can’t call service media_player/play_media. URL is relative, but does not start with a /

type: service

… action won’t work :slight_smile:

shortcuts:
  buttons:
  - type: service
    id: automation.trigger
    target:
      entity_id: automation.onkyo_play_nostalgie

thx for the reply, tried your solution but again getting an error when i’m pressing the shortcut

Can’t call service automation/trigger. must contain at least one of entity_id, device_id, area_id.

when testing the automation, it works, but when triggering it from the shortcut i get the error

Try changing it to

data:
  entity_id:

Instead of target

1 Like

Thx Brad, works perfectly