Poll : New Actions for Lyrion/Squeezebox integration

Never would have thought of that :sweat_smile:. Brilliant. I think I’ve been stuck in a mindset where the queue only lives on the ‘master’ player.
Edit: worked perfectly, thanks for the hint.

Hi again. I’m playing around with trying to create a ui for displaying and interacting with the current playlist.

I can get it using call_query (and status), but I don’t think I’m going to get around having to call query multiple times in order to populate the amount of info I need.

The loop is a bit hard to manage though, as I stead of awaiting the data, I have to look at the attributes of the player, and it feels a bit fragile. Especially because users might themselves use call_query and if the timing is just right, clear the query, or populate it with something unexpected.

Is there some way to call_query and get the data back, like you can with search_media for example?

Hi @minutnudler Anton. Just so I understand your question, are you bumping up against a limit in the amount of data that call_query is returning? Off the top of my head, I don’t recall a limit, but I can take a look if that’s the problem. I added a “browse_limit” to the configuration a while back, but that would just apply I think to the media_browser and wouldn’t affect call_query. If you want to give me an example of what call_query you’re having problems with, I’ll take a look.

@psketch If I understand this correctly, wouldn’t this situation (wanting to avoid potential overwrites of the player’s attributes) be a good use for your Lyrion CLI Integration?

@minutnudler Peter’s integration returns the query data in a response variable, rather than adding it to the player’s attributes. It’s great - I use it as a full replacement now.

I did hit a timeout issue with larger queries (in this case to the Mixcloud plugin) which took longer than 10 seconds, but that would also affect the squeezebox.call_query action in any case. In that sole specific case, I use a HA shell command as a workaround which uses CURL to access the Lyrion API and return a similarly structured response.

If the lyrion cli integration returns a response variable that’s perfect!
My issue was with getting the response from attributes, as I might have to do concurrent queries, and even if I can get around that the attributes might get overridden by some automation.

Edit: to your question Peter, my only issue was with getting the response. Not hitting any limit :slight_smile:

@reste_narquois , yes the lyrion_cli may help (and would certainly make the return easier to process), but I’m not sure where the limitation is from what @minutnudler describes. If the problem is actually in the underlying library, then it would be the same for both the core integration and lyrion_cli. I’ve had a quick look and I can’t see anything in the integration or the library which limits the result set though.

BTW @reste_narquois I’ve updated the library to take a timeout parameter, but haven’t had a chance to add it to the integrations yet - I’ll take a look at adding that to lyrion_cli for you - I’m not sure if the core team will let us add it to the integration as they don’t like the call_query call in general.

Ah - looks like our responses crossed. take a look at peteS-UK/lyrion_cli: Lyrion CLI Home Assistant Integration The core team don’t want us to update call_query and call_method as they don’t like the “call anything you want from the api” approach, so I added a seperate integration which allows me to do things they’re uncomfortable with. This is an addon to the squeezebox integration really - it uses the players etc. setup by the core integration and just sits ontop of them.

@reste_narquois Chris, I added the timeout parameter to the query action and posted a pre-release version 0.2.3b - please give it a try and if it works I’ll release it.

Apologies for the delay in getting back to this: just found a moment to test version 0.2.3b and the timeout parameter: can confirm it works perfectly on all the Mixcloud plugin queries I’d been using the workaround for.

Many thanks for your work, much appreciated as always!

Thanks Chris. I’ll push it out as a new release.

Thanks for the idea. That iframe thing only works if the iframe forms ALL of the dashboard, right?

You can do both. I just checked to remind myself. I have both. But I use full page for LMS because I presumed you need the space. Try webpage card

@psketch , or anyone else, already since last months release, I'm having some strange issues.
I have a morning routine which works as an alarmclock to start playing (current playlist is saved and emptied) a song randomly from a list of songs defined as variables.

Before starting to play, some announcements (time in a loop, current weather, today's calendar entries) are made.
While that wake-up track is playing, that saved playlist is added to the current one.
I see that saved playlist being added and after the wake-up track, playback continues.
So far everyhing is OK and this worked for years.

Quite soon the playback stops and the playlist is empty!?
I found this error which seems to be related:

Logger: pysqueezebox.player
Source: components/squeezebox/util.py:20
First occurred: 10:16:57 AM (2 occurrences)
Last logged: 10:26:49 AM

Timed out (5) waiting for playlist_urls to have value [{'url': "file:///mnt/zpool/MultiMedia/Music/Pop/Peter_Gabriel/New_Blood/cd2/10_-_Don't_Give_Up_(Instrumental).mp3"}]
Timed out (600) waiting for mode to have value stop

Does this makes sense and do you have any clue what is happening?

EDIT: multiple players are always synced and this topic seems to be similar.

Hi Nick - could you be specific about the release that this stopped working in - that'll help work out what changed as some stuff changed in point releases.

Hi Peter, thanks for your swift reply!

I cannot answer to that since it took me some time to realize what was happening and since it's the alarmclock, I have to get going to start off and I didn't test it later on those days to find the issue again the next one... :upside_down_face:
I always thought the next update would fix it and now the new release so that's also why I waited.

If I run these steps manually or in a script it's OK.

Are these time out values seconds?
The strange thing is: that song is getting loaded and starts playing fine, even the first song of the saved playlist plays nicely after that random track.

I'm also having problems with my ESP32 player; I don't use sync, I only have one player. The sound cuts out, lags, and stops completely. I'm not sure when this problem started; it could have been one of the three latest versions. The ESP32 is connected to the soundbar via cable (not Bluetooth), and there seem to be no problems if only the add-on is enabled, without integration (I've been testing this for about 15 minutes now).

@slimak that sounds like an ESP32 player, LMS or network problem. All the integration does is talk to the LMS - it never talks to the player directly. Lags, cut outs etc., sound like an issue between the LMS and the player - the integration just tells the LMS to play something on the player for example. The one issue I can think of is if your LMS is terribly under powered since the integration is polling the LMS for status every few seconds - but it seems unlikely that just this one simple call could make your LMS stagger.

I know, I can't rule it out. I checked to see if the ESP was dropping out of the WiFi network and if I could connect to it via telnet (which didn't reveal any issues), but it could still be some less obvious WiFi/ESP issue.

I struggled with this for a while, but couldn't find any clues in the logs. I finally gave up and disabled the add-on and the integration about two weeks ago. I've now learned that integration isn't necessary to use the ESP, so I'll try to determine if the problems only occur with integration enabled.

When you're looking for where it's dropping, keep in mind that the integration never talks to the player. It connects to the LMS via http to query or issue commands. Any actual streaming is only between the player and the LMS, the integration and HA are never involved directly (unless as i said, it's impacting the LMS in some way). TBH, it sounds more like a wifi problem than anything else.

In 2026.6.2, we allowed parallel commands to be passed to the LMS, rather than them being queued. Might that align with it stopping working? Does one of your "announcements" have an announce timeout of 600 seconds set? We "see" the end of an announcement by the mode changing to stop,, and then use that to restore the playlist after an announcement. Likewise, the 5 second timeout is waiting to see if the playlist play has worked, Does the order of those timeouts tell us anything?