I’ve been using the media_player.play_media action to sound alarms on my Squeezebox Boom for a few years now, but over the last couple of months playback has been failing. Instead of playing the requested media file, the player buzzes and the track name is displayed as " [tempplaylist_0004201e97d7]" or something similar.
The action looks like this:
@itm1960 The thing that’s changed of late is that we’ve introduced announcements - i.e. the ability to a file as an announcement over other music and then returns to the original playing music. Squeezebox (Lyrion Music Server) - Home Assistant . Now, that shouldn’t cause any problems of course as you don’t seem to be using it, but the tempplaylist name does look like what you might get playing a local mp3 as it doesn’t have any metadata. Is your media content id correct - I’d expect it to be media-source://media_source/local/parking-booking.mp3, not just the path. Does it work if you try and use an http music source e.g. https://bigsoundbank.com/UPLOAD/mp3/0001.mp3.
Thanks for your reply. Bizzarrely, the problem seems to have magically rectified itself without any intervention from me. This is after a couple of months of failing.
Very strange…!!
OK - well, glad it’s working again. You might want to update the media source - just in case it stops working in the future. Given what you’re using it for, you might want to look at the announce functionality as well.
Thanks - I will need to look into media_source, as I haven’t come across it before.
The announce functionality sounds useful, but I have a question: if a player is in a paused state when an announcement arrives (because I have chosen to pause it), will it start playing again following an announcement (even though I want it to remain paused)?
Firstly, if I add the announce: true line to my automation it doesn’t seem to have any effect - the media announcement plays but the player does not return to its previous state (the playlist is cleared):
I just checked the media_source thing now I’m home - that might just be the way things are setup - the /local might just be what you have defined in your configuration.yaml. The example they used in the doc might be overly complex
and it cleared and then re-added the playlist. If you want to enable debug logging on the squeezebox integration, try an announce, and disable logging and post it, I’ll take a look.
Curious why you have an one set defined - action: … and one defined -entity_id, which the visual editor at least doesn’t like. Why don’t you just have one action with 4 targets? Have you just tried a simple script playing to a single target - not saying this shouldn’t work, but just to keep things simple while i look at that debug?
Good question! I think it just evolved over time - the bedroom player used to require a different content type as it was the only native Squeezebox player of the group (the others were UPnP-connected players) - I probably copy and pasted the code for it from another automation. I don’t think it’s the cause of the issue, as I have the same issue with another automation which uses different syntax.
So, as far as I can see, that should all be working. You’ll see the lines after that resetting things like repeat, power, volume etc. to their previous values.
Do you still see a playlist called tempplaylist_cccc1db992ab? It should be being deleted when it’s resumed, but wonder if it’s still there, and if so, what’s in it.
As you say, not likely anything to do with the problem, but I’ve not seen that before - it looks backwards entity then action, rather than action then entity. Probably worth just swapping them around as you never know when something like that migh stop working - the visual editor doesn’t understand it, so you never know when some cleanup might just stop it working,
The display on the Boom says “Home Assistant” for a few seconds while playing the announcement, then displays “Alarm clock” (which is one of the normal menu items on the player).
If I look at the Kitchen Display in the LMS UI (MAC address ‘cc:cc:fe:1b:e0:e1’), there was a paused playlist at the time of the automation:
I no longer see tempplaylist_cccc1db992ab, but that could be because I have now populated the ID3 tags of the media file with meaningful data (Artist: Notification, Title: Parking Booking). Interestingly, neither of those two pieces of metadata are displayed when the media file is played.
To eliminate another variable (the type of player hardware), I have retried this with a paused playlist on the Squeezebox Boom (Mac address 00:04:20:1e:97:d7).
This was the playlist before the automation:
OK - that’s confusing. If that’s the boom, why is it playing to it via UPnP/DLNA. That Home Assistant name isn’t coming from the squeezebox integration. When you say some of them are using upnp, how is that setup (on HA or via LMS)? Is the player you’re sending to here setup via the UPNP integration? I didn’t see any playing action being sent to that player. I wonder if you’ve got this player setup twice and are playing the announce to the upnp player perhaps (guessing a little as I’ve no idea what that upnp format on the announcement means)