Roon Command Line Control version 2

I have made a package for Arch Linux AUR (en) - roon-cli as well as PyRoon AUR (en) - python-roonapi

Thanks for your work on this.

1 Like

@Matej_Lach thanks! Thatā€™s great.

@Ronald_Record, this is great and useful. Thank you. In exploring, I did run across a possible typo: do you prefer those reported here or as an issue on your repo?

root@LimePi:/usr/local/Roon/bin$ diff roon roon.safe
399c399
<     zones=$($ROON/bin/get_zones | sed -e 's/\, /\,/g')
---
>     zones=$(ROON}/bin/get_zones | sed -e 's/\, /\,/g')

@Nathan_Wilkes thanks for reporting this. I discovered the same thing and it has been fixed in the latest release, v2.0.8r5.

Reporting issues with RoonCommandLine here is fine as long as it is in a thread I am following or you tag me.

Embarassingly I seem to have installed using RoonCommandLine_2.0.8-4.deb yesterday, so sorry to waste your time on this.

@Nathan_Wilkes heh, I share your embarrassment having made such a stupid mistake. Itā€™s all good though, the stupid thing got fixed. Please continue to raise issues as you encounter them, it helps a lot.

Note: I have moved to Neovim as my editor of choice and it has all kinds of syntax checkers, language server support, formatters, linters, and extras to alert me to coding errors. No more missing or unmatched brackets, parentheses, or braces!

When I choose ā€œList Tagsā€, I get the following:

Please enter your Roon command choice (numeric or text): 21
Traceback (most recent call last):
  File "/usr/local/Roon/api/list_tags.py", line 69, in <module>
    tags = roonapi.list_media(output_id, ["Library", "Tags", searchterm])
  File "/usr/local/lib/python3.9/dist-packages/roonapi/roonapi.py", line 527, in list_media
    total_count = self.browse_browse(opts)["list"]["count"]
TypeError: 'NoneType' object is not subscriptable

Given that ā€œList Playlistsā€ and ā€œList Genresā€ yield incomplete results (as easy examples to check), I suspect that the ā€œdefaultā€ profile being used is one that is no longer active, and so there are no tags visible to that (unused) profile, hence the error.

Iā€™ll have to figure out (in Roon) how to ensure that all profiles can view all genres, playlists, and tagsā€¦

It might not be quite that simple as I get the same error, even though some of my tags are visible to all profiles. This behaviour is a bit different to playlists, where shared playlists do show up in RoonCommandLine while those assigned to my profile do not.

I am going to open an issue for this as I cannot immediately come up with a solution or workaround. It may take some digging.

Thanks for reporting this! Keep em coming.

Alas @DaveN, your surmise is correct. I have actually found several Roon issues:

  1. Not all custom Genres are displaved in the Roon app (or returned via rooncommandline) though fortunately accessible through Focus. This seems to be a Roon bug.
  2. The Playlists returned by rooncommandline seem to be somehow associated with a deleted profile, as some listed are not accessible at all through the Roon gui at present. Also a Roon problem.
1 Like

The roon python api (which I maintain and is non official) doesnā€™t currently allow you to change roon profiles - and just uses a default.

I did see a report that profile section didnā€™t work correctly - so havenā€™t made this a priority.

Last night Roon Command Line was not responding. When I did some troubleshooting I saw pyroonconf was corrupted and looking like this:

LOCAL=true
export PYTHONUSERBASE=/usr/local
ROONAPIPATCHED=true
ROON_ZONE=ā€œKeukenā€
r Bose"

Iā€™ve deleted the file and started Roon from the command line, a new pyroonconf was created. Problem solved.

Since this morning when I look at the running processes on the Raspberry Pi where Roon Command Line 2.0.8-5 is running I noticed a process running constantly:

python3 zone_command.py -c verify -z Woonkamer Bose

I canā€™t remember seeing that proces before. What does it do and does it need to be running constantly?

Iā€™m on vacation in beautiful Enid, Oklahoma with limited net access. I wonā€™t be able to address this for a couple of weeks. The ā€˜roon_commandā€™ process is used to verify the zone is legit. It must have gotten confused. Probably need to handle some additional cases.

1 Like

Enjoy your vacation Ronald!!!

Good luck. The weather reports from OK right now seem a bit dicey.

@Ron_Witkamp iā€™m back and can report that Oklahoma is still ok.

The command you saw running is run by set_zone. It should not be continuously running as it simply checks to see if this is a valid zone. It should return either an empty string or the zone name.

I do not know why the command hung on your system. Prior to returning it cycles through the outputs to get the output id of the zone. I cannot reproduce a hang for this command on any of my systems.

Iā€™m stumped. Can you reproduce this or is it working as expected now?

Welcome back! :slight_smile:

I cannot reproduce but suspect it is happening when my Roon Core is updating and Domoticz sends commands using Roon Command Line. When a next Core update is deployed I tried to reproduce by rebooting my Roon Core but without any luck yet. Iā€™ll try with the next Core update.

Iā€™ve been investigating how to set profiles via the roon api. Itā€™s still something on my list to do in the pyroon library.

In doing so Iā€™ve found a trick that may help you.

The api for selecting a profile re-uses the browse api that we use for playing media.

So (at least in Home Assistant) playing the right path will change the profile.

This may also work in the Roon Command Line - @Ronald_Record will be able to confirm.

You can see a HA version here - with the path required.

@GregD cute trick. I donā€™t have any plans to implement Profile management in Roon Command Line. Is it useful for anything other than separate last.fm scrobbling?

I think playlists are specific to a user profile. So there have a been a couple of issues where people couldnā€™t find or play their playlists.

2 Likes