Script to play Radio 2 on Marantz M-CR610 amplifier using LMS?

…and now a different error when I run the same script again:

2025-01-09 23:27:35.059 INFO (MainThread) [homeassistant.components.script.radio_2_on_marantz_2] Radio 2 on Marantz: Running script sequence
2025-01-09 23:27:35.059 INFO (MainThread) [homeassistant.components.script.radio_2_on_marantz_2] Radio 2 on Marantz: Executing step call service
2025-01-09 23:27:35.062 INFO (MainThread) [pysqueezebox.server] Query run on unknown player bb:bb:8f:34:e8:c6

EDIT: Seems to be a syntax problem - this works:

mode: single
icon: mdi:music
sequence:
  - data:
      command: favorites
      parameters:
        - playlist
        - play
        - item_id:2
    target:
      entity_id: media_player.marantz_m_cr610
    action: squeezebox.call_method

Yes, that error is wrong. I’ve changed it in the next build to say unknown player or incorrect command syntax

Thanks. As a matter of interest, do you know why the 2nd version of my script worked, and the first didn’t? I’ve been staring at it (for probably too long!) and, as far as I can see, the only difference is the order of the elements in the sequence: list. Is the sequence critical here?

No - sequence doesn’t matter. I don’t know what’s wrong with the first one tbh - just have to change it line by line to match the second to see what happens.

@psketch Could you please guide how to get the count of items in a particular favorites folder?

e.g. if I have a folder “English Songs” under favorites and there are 15 items in folder “English Songs”, how do i get the count of items in folder “English Songs”
Or How do I list items in favorite folder “English Songs”?

This is what I have tried.

action: squeezebox.call_query
data:
  command: favorites
  parameters:
    - items
    - 0
    - 10
    - "search: English Songs"

But its returning all items containing the search words. Whereas i need to return the items in fav folder “English Songs”

Kindly guide

Hmm - odd one… So, for some reason, search:xxx doesn’t seem to return folders od that name, only “normal” items. I don’t know why it does that tbh - If you run it directly using the lyrion cli from telnet for example, it’s the same. So, you’ll need to just search for all favorites (which includes folders), find the item_id for the folder you want, and then do another call_query but use “item_id:the_id_you_found”.

Thank you so much for the reply.