Roon Extension: Logitech Harmony Source Control (GitHub)

Context

I mainly listen to music in my living room, where I also watch TV or play some games. Audio is always played through my Denon AVR, and for convenience I’ve been using a Logitech Harmony for at least 10 years. Well, three different models that is.

So far, playing music via Roon required me to use both the remote control as well as the Roon App: first I had to start the “Listen to Music” activity on my Harmony, then I could press the play button in Roon (actually, the order is not relevant here). Worse, when stopping the music or turning off everything via the remote, I often forgot to do the other step, which either left the music playing or the receiver powered on for the rest of the day.

And that’s where the Source Control extension comes into play…

Controlling Harmony Activities via Roon

I just finished the initial version of Source Control extension for Logitech Harmony. It works by connecting to the Harmony Hub (so it needs to be a rather new Harmony, I guess), then exposing each of the configured activities as one Source Control item. In my case, this results in entries for “Watch TV”, “Play Games”, and “Listen to Music”.

The Source Control extensions can then be bound to an output device - in my case an RPi - which will have the following effect:

  • If the activity is not activated when starting output to the device, the extension will tell Harmony to switch to that activity.
  • If you are using the Harmony remote control to turn off everything, Roon will stop playback.
  • Last but not least, when bringing up the volume control UI, there is a button to turn off the activity from within Roon.

With that: feel free to give it a try if you are also using a recent Logitech Harmony remote control. I am sure there will be some glitches, but overall things seem to be running rather smoothly.

What’s next?

The extension does not provide a way to control the volume. For me, this is on purpose because Harmony only supports relative volume adjustments. I am currently working on Volume Control extension for Denon/Marantz AVRs, which will allow for absolute volume control, which I find much more convenient. Roughly, it’s working but it needs some more tweaking…

https://github.com/docbobo/roon-extension-harmony

12 Likes

This is great. Will give it a try when I have time.

Great idea and good functionality to start with. Really looking forward to the volume change functionality.
However, while I was able to install, get running and see/configure the extension in Roon it doesn’t seem to do any play/pause on power off or activity change. Does the Harmony activity for music need to be named something specifically?

Did you go to the service setup of your output device to associate the activity with it?

No, of course I didn’t! Must have missed that bit in the instructions…

Now it’s working perfectly! Many thanks.
I do use headphones with my DAC at times and other family members may be using the media centre/tv at the time. Any ideas on how to configure exceptions so that I don’t switch off their activities in this case? I guess I can just stop the extension for these times.

I guess I need to spend some more time on documenting the setup…

The headphone workflow is a tricky one. I am not aware that the Harmony can have multiple activities runnint at the same time. So the only possibility would be to enhance the extension to directly control devices via the Harmony - but that would also require lots of configuration UI since you would want to select the correct DAC input etc.

I’m sure it was me that didn’t read the instructions, honestly.

I think the answer would be for Roon to have the capability to have multiple activities using the same hardware but different settings.

Hey @Boris_Pruessmann

Just installed the Harmony SC extension this morning. Works like a charm – very convenient. The auto power-on on play and turn off through Roon were about the last things I missed after selling off my Meridian sources. :slight_smile:

Thank you for your effort!

1 Like

I am not a linux wizz so how would I run this automatically on startup. I am running roon core on Vortexbox distro and can only run this via ssh into my core machine and then running it, which is no use as soon as I close the terminal it exits the extension. Any ideas would be welcome.

You could either make a service for this, or install ‘forever’ to keep the node.js server running well eh… forever:

npm install forever

Start the extension with:

forever start /path/to/roon-extension-harmony-master/app.jps

I put this in my crontab so it starts automatically at boot:

crontab -e

add the following line at the end:

@reboot forever start /path/to/roon-extension-harmony-master/app.jps

(Change ‘/path/to’ to the actual path to your extension).

1 Like

thank you will try those solutions.

Ok this does not seem to work well for me. I cant install v8 of nodejs as my os will only allow upto v6 so not sure if this is the cause. I can get it to run but the functionality is not as I would think it should be or this might be as its intended.

When adding the remote control extension to the device it seems to be adding it more than once. Deleting the extras does not work as when I go back to check they are there again. It adds 3 version of the same event I am asking it run on the harmony.

Also if I have already turned it all on and paused playback using Roon remote and then select another album or playlist and use the play now it seems to cause Roon issues as it does not move on to the new album or playlist but resumes playback of the previous material its only when I leave Roon playing that it will switch to a new album/playlist or force it a second time.

Also if it does manage to turn anything on from pressing play in Roon it takes a long time to send the commands.

@CrystalGipsy: I haven’t attempted to run the extension with v6, but I can certainly give that a try tonight. However, the issues that you are describing do not sound like a node issue.

Some questions:

  • What’s your Roon Setup? Do you have more than one Roon Core running on the network?
  • Can you share the extension’s log output?
  • Can you share a screenshot of the output zone’s configuration dialog?

Also if I have already turned it all on and paused playback using Roon remote and then select another album or playlist and use the play now it seems to cause Roon issues as it does not move on to the new album or playlist but resumes playback of the previous material its only when I leave Roon playing that it will switch to a new album/playlist or force it a second time.

I’ve seen similar behaviour exactly once, last week to be precise, so I didn’t blame it on the extension. Is this reproducible for you? Given the fact that the extension itself does not interfere with any of the playlist management, it might be a general Roon issue that only gets exposed with extensions.

Also if it does manage to turn anything on from pressing play in Roon it takes a long time to send the commands.

Are you saying that it takes a long time until the Harmony shows that it’s switching to the selected activity? Or are you saying that it takes a long time until that activity is finished? I can confirm the second statement, but that’s due to the way that Harmony works. If you took a stopwatch to time that, I am sure you’ll find out that it takes the exact amount of time that it takes when selecting that activity directly on the remote control.

Will attempt to get some logs and run through it all again.

I have one Roon core on my network which is hard wired to the router. My endpoint I am using it on is Raspberry Pi running Ropieee Roon Endpoint.

Its the starting the activity that takes a long time nothing happens for ages if it works at all. And when it does Roon does not play. This is from off. I will try it from another activity.

Hi Boris

all works now i think my harmony had got a bit confused. I just removed it from roon and then rebooted the harmony added the extension back to Roon and my endpoint and all works. Great little extension, now if only I could use the harmony to pause Roon and not need to find my tablet or phone all the time.:slight_smile:

@CrystalGipsy If you are using a modern Linux system which uses systemd, you can use this method to start Node on system startup.

systemd is the init system used by modern Linux systems. Here is a sample systemd unit file which can be used to automatically start this application at Linux system boot time.

[Unit]
Description=NodeJS app - Roon Logitech Harmony
After=network.target

[Service]
User=node
WorkingDirectory=/srv/node/roon-logitech-harmony
ExecStart=/usr/bin/node app.js

[Install]
WantedBy=multi-user.target

Usage:
To use this unit file:

  1. Save this template to a file called roon-logitech-harmony.service
  2. Edit the user field to be the user running the application
  3. Edit the WorkingDirectory field to be the location where the application is installed (NOTE: the user must have read and write access to this location!)
  4. Using either sudo or as root, copy the edited roon-logitech-harmony.service file to /usr/lib/systemd/system
  5. Reload systemd: sudo systemctl daemon-reload
  6. Start the application: sudo systemctl start roon-logitech-harmony.service
  7. Enable the application at boot up: sudo systemctl enable roon-logitech-harmony.service

You can monitor the output of this application using journalctl.

  • To show the application output: sudo journalctl -u roon-logitech-harmony.service
  • To follow the application output: sudo journalctl -f -u roon-logitech-harmony.service

Thanks Mike, how would I also add your 1.20 Web Controller?

@CrystalGipsy

You have a couple of options.

You can either have a separate directory for the web controller and follow the instructions that I have posted to the Github site https://github.com/pluggemi/roon-web-controller

Or you can try out the Extension Manager that @Jan_Koudijs has written. Both the Roon Web Controller and the Logitech Harmony Source Control extensions have registered with Jan. You can read the details about his project at Roon Extension Manager v0.7.1

Ill stick with just systemd for now. Got both working so many thanks.

1 Like

Ok I am having issues with this now It keeps not working and I then cant play anything at all until I restart the roon server or disable the remote control on the endpoint. Making my other half very annoyed. How do I get a log out from this to see what the issue might be? I switched to using the Extension manager now to see if that would help or If I messed up making it a service so reinstalled it using it but its the same as it was when manually installing and running it as a service,