Unsure of how to use developer tools to test a service

I’m trying to test the Alexa media player integration using Developer Tools but it’s not clear to me how the YAML is supposed to look. For example, the docs linked below show this sample:
https://github.com/custom-components/alexa_media_player/wiki/Configuration%3A-Notification-Component#use-the-notifyalexa_media--alexa_id-service

message: test
data: 
  type: tts
target: 
  - group.alexa
  - "Guest Room"
  - media_player.kitchen
  - serialNumber

But in developer tools it looks like this for me:

service: notify.alexa_media_office_echo
data:
  message: asdf

And it says unknown error. How am I supposed to know the format/schema to use?

Thanks in advance for any help.

The base notification service created by the Alexa Media Player integration is notify.alexa_media. It can be used as follows:

service: notify.alexa_media
data:
  message: test
  data:
    type: tts
  target:
    - Kitchen Echo

As demonstrated in the sample you posted, the target can be the name of an
Alexa device, an entity id, a serial number, or a entity id of an HA group.

The integration also creates standalone notification services for each Alexa
media player entity, including speaker groups configured within the Alexa app.

Your second example is missing the required data: field.

service: notify.alexa_media_office_echo
data:
  message: asdf
  data:
    type: tts
1 Like

Thank you. So in the future, I just need to put everything under a top-level data and also specify service with it, so it knows what to call? I’m sure I’ll run into this again, and I’d like to make sure I come up with a good rule of thumb to guide me.

I think what threw me off was the combo-box at the top lets you pick the service you want to call, but you still must specify it in service: which seemed wrong/redundant at first:
image

But maybe the right way to think of this is: The combo box represents a starter template that gets filled into the editor, it doesn’t actually affect the service call itself?

Service calls require a service, target, and paired data.

Notify services follow this pattern when using them as a service call. The only difference is that the notification services themselves have a data structure to them. Do not get the 2 confused. The data for the service call is different than the data for the notification service.

service: # <--- the service you plan to call
target: # <- the target entity for the service call
data: # <- the data for the service
  some_key: # <- a key used by the service
  some_other_key: # <- another key used by the service

It just so happens that some_key for notify.alexa_media_office_echo is named data.

1 Like