Format for Sending msg.payload to media_player.play_media

New user and first time post, so thanks in advance for any assistance!

With Google TTS going down (again), I've been trying to switch to using the URL method of playing a temperature announcement instead of the TTS method. My flow pulls the current temp from openweathermap.org and calls the play_media service. Testing this with a simple "hello" message works correctly if I manually enter the URL like this:

{
    "media_content_id": "http://translate.google.com/translate_tts?ie=UTF-8&total=1&idx=0&textlen=32&client=tw-ob&q=hello&tl=En-US",
    "media_content_type": "music"
}

But I'm struggling to get it to accept the same URL when passing it as a msg.payload like this:

{
    "media_content_id": "{{payload}}",
    "media_content_type": "music"
}

That same "{{payload}}" syntax works when I pass the message using the tts.google_say, but with the media_content_id it generates the following error:
Call-service API error. Error Message: (-32602, 'Invalid params.', {'error': {'code': -32602, 'message': 'Invalid params.'}, 'id': 454589894, 'jsonrpc': '2.0'})

When I just send the output to a debug node the payload shows the exact same URL string being passed. Is there something special about the media_content_id that prevents it from being passed a string rather than entering the string directly? Is anyone doing something similar to show me how it's done?

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.