Roon Extension: macro.on

Hello everybody,

It’s time to show you my new Roon extension: macro.on

You will find a more detailed description and installation instructions right here:
https://github.com/bsc101/roon-extension-macroon-readme

A brief summary of what macro.on is about:

macro.on lets you define macros. A macro is a sequence of macro steps (a sequence of Roon commands).
For example:

You can run your macros manually or by sending an http GET request, this way you can run macros from any other software that is capable of sending http GET requests.

Furthermore, macros can be run automatically by using triggers. Examples for triggers are: a certain point in time (alarm clock), a Roon endpoint appears (autoplay after power on), and so on…
For Example:

trigger_example

You can assign constraints to a trigger to restrict the execution of a macro. A simple example would be an alarm clock that runs at 6am in the morning, but only on Mondays through Fridays. A more advanced example would be an autoplay functionality with different audio sources played at different times of day (news radio station in the morning, music playlist in the evening).

macro.on comes with a web interface where you can configure everything:

Here are a few examples of what I do with macro.on:

  • Alarm clock:
    Play a radio station at 5:50 AM with some specified volume, wait 10 minutes, increase volume.
  • Autoplay:
    I have a few Sonos devices which I typically power off if I do not use them. I want them to autoplay something when I plug them in. The Sonos in my bathroom does the following:
    If I turn it on between 6:00 and 9:00, it plays a radio news station.
    If I turn it on between 9:00 and 17:00, it plays my favorite music radio station.
    If I turn it on after 17:00, it continues playing a playlist (plays current queue).

So, you should now have a first impression of what macro.on is about and I hope you find it interesting. Looking forward to your feedback!

Cheers :beers:


Please note:

This is a first version, there is still a lot to do. The currently available macro steps, triggers and constraints are just a subset of what is possible. I will of course add further functionality with future releases. So, your input is very welcome!

I decided to give you the possibility to support me and the development of this extension (https://www.buymeacoffee.com/bsc101). You will find more details on the About page of the web interface. Supporters will be able to create more than 3 macros and triggers :wink:


This extension is also required by the macro.on Android App. You can find the app in the Google Play Store:
https://play.google.com/store/apps/details?id=com.bsc101.macroon
And some more details about the app right here:
https://community.roonlabs.com/t/roon-extension-macro-on-android-app/


Thank you @Christian_Riedl for the C# API :sunglasses:

16 Likes

This could be the answer to a prayer. Thank you.

What prayer exactly?

First and foremost I’ve been looking for ways to automate or program playback. I looked at Alarm Clock but I don’t understand how to install it. Bummer. I’m new to Roon and the Extensions system seems pretty opaque to me. In any event this seems to have that nailed.

In addition, I’m assuming you’ll also be considering something akin to IF THEN ELSE branching which would take it to another level.

I don’t want to get carried away at this time with questions and requests. I’m sure you have your own list and priorities. That said, I will post to your Github site once I have it installed and get some experience under my belt.

-Thanks again

Thanks @KGLT_Radio,
Let me know if you need any help and don’t hesitate to provide some feedback regarding your needs and use cases!
Cheers :slightly_smiling_face:

1 Like

Are you working on an iOS/OSX version? How about a Roon extension (Roon Extension Manager) with a web interface?

Hello @Johannes_Lohmeier,

An OSX version of this extension is already available, you can find the download right here:
https://bsc101.eu/downloads/macroon/roon-extension-macroon/
And the extension already comes with a web interface, just use a browser to configure everything.

The extension manager integration is on my todo list, depends on the demand… currently you have to download the application using the link above.

Regarding the mobile app, it is Android only at the moment. But it is not needed to use this extension, the app is just an addon!

Did you already try the OSX version?

Hi everybody,

For those of you who like to use docker, you can now find docker images right here:
https://hub.docker.com/r/bsc101/roon-extension-macroon

And the current version 1.1.4 comes with a new MacroStep: Play Tag
“Play Tag” shuffles all tracks tagged with the specified tag.

If you are updating from an older version: keep the configuration files config.json and automation.json!

1 Like

Hi @Boris_Schaedler,
I’ve successfully installed macro.on on my Synology NAS using the inbuilt docker app. My core sits on a sonicTransporter i5 NUC.

I’ve set up an alarm to play the radio each morning on my BlueSound Pulse Flex, which is woring fine except that the time is 1 hour out, i.e. set for 7am, alarm starts at 8am.

I’m based in the UK, which is GMT+1 at the moment (British Summer Time), which I guess may have something to do with it. I have checled the time settings on both the NAS and Core, and they are both correct, so looking for help to resolve this.

Any ideas?
thanks
Nick

Hi @Stampie ,

Did you or can you specify the time zone when running the docker image?

Thanks @Boris_Schaedler,

I wasn’t prompted to set a timezone, but have figured out how to do it.

There is a ‘Advanced Settings’ option in the container settings, where Environment Variables can be set.
I added a line TZ with a value of GB and restarted the container. I then setup a test trigger and I think it has resolved the problem.

In case anyone else needs to add this variable, the codes to use can be found at the following wiki page List of tz database time zones - Wikipedia

Regards
Nick

1 Like

I can recommend using macro.on with url based triggers. +1
Once set up (in my case: Docked-based Roon + Docked-based macro.on), I trigger macros using Apple Shortcuts to control Roon from my Apple Watch.

2 Likes

Yeah! New version of macro.on is out.

“Set Volume Relative” is increasing or decreasing volume by a defined (by you) value.

If I like a track in my favorite radio station I say “Hey Siri, louder” and Roon will play louder. When ads are annoying me I say “Hey Siri, quiter”.

There is also grouping and Ungrouping of zones as new functions.

Thumps up Boris!

2 Likes

Yes, thanks @Thomas_Forster !

Here is an example macro with the new functionality:

You can now group/ungroup your audio outputs and you can increase/decrease the volume of an audio output with an optionally specified time period (fade in, fade out).

1 Like

Quick question before I update the docker image on my Synology NAS. How do I ensure that my existing macros are retained once I remove the current container and create a new one?

There is an option to export and import settings which I have used on other docker images, but want to make sure before I update
thanks for any help
Nick

Hi Nick,

I’m not familiar with docker on Synology, but as far as I know from another user, updating is more or less just a click on a button. Export and import of all settings is on my todo list, but shouldn’t be necessary when just updating.
How do you start the container? Do you specify any parameters? Do you bind mount the /app/data directory somehow like I described here: https://hub.docker.com/r/bsc101/roon-extension-macroon

docker run ... -v macroon_data:/app/data ... bsc101/roon-extension-macroon:latest-amd64

The specified docker volume or folder contains the configuration files, config.json and automation.json. Do you know where these two files are saved?

I’m using docker directly from command line and updating is just:

docker container stop ...
docker pull bsc101/roon-extension-macroon:latest-amd64
docker run ...

Hope this helps somehow…
Boris

Thanks @Boris_Schaedler.
I’m not conversant in the command line stuff to be honest. The advantage of the synology docker app is that it is all done with a few clicks. I have now updated the image in the app using the ‘Actions - Reset’ option to update the version used by the container, but this has removed my existing macros, so I will need to start again.

Also, following the update I needed to re-enable the extension in Roon.
Rgds

@Boris_Schaedler: First of all: many thank for implementing that extension. It delivers functionality that should be part of Roon itself.

Do you have any plans to provide more Trigger options? Would be great to have some kind of web hook. That would offer the possibility to integrate your extension in Smarthome systems…

Hi @Michael_Kletzin ,
There is already the possibility to run macros by issuing an http get request, it looks like this:

	http://192.168.0.52:8180/api/v1/Macro/Run?id=9acaa266-930a-40d1-8331-787be747edca

Is that what you need?

2 Likes

Yes, exactly what I was looking for. Thanks!