Announcements to MA speakers

I have snapcast players connected via music assistant, and I’m trying to play announcements using Node-RED.

It seems I have to route through a TTS service, so I’m looking for the ‘best’ way to do this (I have Nabu Casa if that is the ideal way).

But also, I’m trying to test with just an mp3 file initially, and I’m getting an error:

"HomeAssistantError: 'NoneType' object has no attribute 'display_name'"

My node currently looks like this:

Action: music_assistant.play_announcement
Targets media_player.livingroom
Data: {"url": "https://path/to/my.mp3", "use_pre_announce": false, "announce_volume": 75}

I tried other values too for the use_pre_announce etc…

Play announcement is for pre recorded sound files not tts. You would need to use a tts action depending on your tts service. tts.speak is what I use for piper or google tts.

Sure, but as you’ll see in the data I’m sending it, I’m trying to get this working with an mp3 first - when that’s working I’ll look at getting the TTS going. I think I read somewhere there is a way of doing this on the fly via a synchronous https call… something like https://some-tts-conversion-service/what+I+want+it+to+say/output.mp3 - but I’m not totally sure on that… but when I know the plain old ‘my.mp3’ in my example is working, that will be next…

If the media is stored in your library, I believe you need to use the content id address and not the direct path. Content id can be found in devtools when it’s playing on a media player.

{"media_id":"library://track/767", "media_type": "track"}