Button-card: call-service notify.<mobile_device>

Hi everybody,

I just played around with companion App. The service call below works perfectly; however, I then tried to wrap it and some helpers in a custom:button-card so that one can send TTS to any android device directly from lovelace.

What am I missing / doing wrong so that it will work? I am using a similar card for local echo devices; however, there I can use service: media_player.play_media, and here I am trying to determine the service to call via template.

Thank you in advance for your help :slight_smile:

Working service call

service: notify.mobile_app_1
data:
  message: TTS
  title: Halmo there
  data:
    channel: Test
    importance: high

yaml for helpers

input_text:
  helper_ttsandroid:
    name: "Zu Sprechen"
    initial: "Halmo I bims 1 TTS"
    icon: "mdi:bullhorn"

input_select:
  helper_android_devices:
    name: "Android Geräte"
    options:
      - notify.mobile_app_1
      - notify.mobile_app_2
      - notify.mobile_app_3

custom:button-card yaml

type: vertical-stack
cards:
  - type: entities
    entities:
      - entity: input_text.helper_ttsandroid
        name: Text Ausgabe
      - entity: input_select.helper_android_devices
        name: Welcher Player?
    title: Android TTS
    show_header_toggle: false
    state_color: true
  - type: 'custom:button-card'
    entity: input_text.helper_ttstext
    icon: 'mdi:bullhorn'
    name: Sprechen
    aspect_ratio: 4/1
    tap_action:
      action: call-service
      service: |
        [[[
          return states['input_select.helper_android_devices']state;
        ]]]
      service_data:
        message: TTS
        title: |
          [[[
            return states['input_text.helper_ttsandroid']state;
          ]]]
      channel: Android
      importance: high