Roon extension - http APIs

Run npm install first.

1 Like

:blush:

Thanks!

Hi @Tech_Whisky_Lab ,

Yes, as @crieke mention, you would need to re run npm install again since we have added a new dependency for the default values.

If you go to roon’s extension page, you can click on the “settings” button to enter 2 default values:

  1. HTTP Port (thanks Christopher). You can change the port if for some reason this is already been used.

  2. Default Zone. Previously the zone that is displayed when (re)connecting is whichever Zone is returned by roon. You can specify which zone you’d like to have displayed as a default here. Make sure you enter it exactly as in roon.

bastian

1 Like

@St0g1e is it possible to identify local or tidal album playing and have it display? Like maybe the Tidal logo over Tidal albums and the roon logo for local?
Just ideas! :smiley:

Thanks!

Hi Fernando,

I can’t add the tidal logo as there is no information returned on whether the track playing is sourced from Tidal or locally.

Thanks for ideas and keep them coming :slight_smile:
if it is possible i’ll try to add them.

Bastian

Hi All,

I have updated the player app with search functions.
You can get to this page by clicking on the magnifying icon next to the zone list.

You can browse to Album level and play the album for the zone.

There are several limitations that i’m still stuck on how to fix it, for example, we cannot have more than one client running the search/browse.

bastian

3 Likes

@St0g1e AWESOME!
Thanks!

@St0g1e,

I did a git pulll and and just incase a npm install:

and got:

[code]
root@darkdreams:/roon_projects/roon-extension-ws-player# nodejs .
Listening on port: 3002
-> REQUEST 0 com.roonlabs.registry:1/info
<- COMPLETE 0 Success {“core_id”:“4a65ce19-8183-4440-aafc-10fdfbff6db8”,“display_name”:“darkdreams”,“display_version”:“1.3 (build 223) stable”}
-> REQUEST 1 com.roonlabs.registry:1/register {“extension_id”:“st0g1e.roon-ws-browser”,“display_name”:“roon-ws-browser”,“display_version”:“0.0.1”,“publisher”:“bastian ramelan",“email”:"st0g1e@yahoo.com”,“required_services”:[“com.roonlabs.transport:1”,“com.roonlabs.image:1”,“com.roonlabs.browse:1”],“optional_services”:[],“provided_services”:[“com.roonlabs.status:1”,“com.roonlabs.settings:1”,“com.roonlabs.pairing:1”,“com.roonlabs.ping:1”],“token”:“611614d0-8b3b-4480-acf5-1c4655e735e2”}
/roon_projects/roon-extension-ws-player/apps.js:181
core.services.RoonApiImage.get_image(msg, {“scale”: “fit”, “width”: 300, “height”: 200, “format”: “image/jpeg”}, function(cb, contentType, body) {
^

TypeError: Cannot read property ‘services’ of undefined
at Socket. (/roon_projects/roon-extension-ws-player/apps.js:181:10)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at /roon_projects/roon-extension-ws-player/node_modules/socket.io/lib/socket.js:503:12
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickCallback (internal/process/next_tick.js:104:9)
root@darkdreams:/roon_projects/roon-extension-ws-player# nodejs .[/code]

So I did a brand new Roon install on another box and worked like a charm… My home install keeps crashing after the update.

@Tech_Whisky_Lab

Stop the extension and remove the config.json file from the directory that you cloned this repo into. Then start the extension and use a Roon client to enable the extension.

That file is automatically generated when you pair the extension to a core server. It may have gotten messed up somehow.

(As a side note - you really should not be running Node.JS as “root”. It runs perfectly fine as a standard user and that is much safer.)

I caught that one after reading a bit about nodejs and services.
That did it. Thanks.

@Mike_Plugge and @St0g1e code together would make a killer Roon-Web :blush:

To be fair - my project would not have happened without @St0g1e. I learned more about the API from his code than from anything else.

1 Like

I was just giving this a look and wanted to try it out. I was looking into the APIs and this as a faster way to control Roon because the iOS app takes too long to start & connect.

I wrote a quick Dockerfile to make it easier to test and run this and just submitted a PR with it :slight_smile:

Hi @Tech_Whisky_Lab and @Mike_Plugge

I created the projects to test the APIs and later the web socket functionalities.
The Player and browser are just an examples on how to connect to the controllers.

I have zero knowledge on UI stuff and to be honest, the one we have on the project was created by @crieke (I hope I have not forgotten to thank you for this). Thank you for helping, Christopher.

Mike, I really like your professional looking UI and glad that others are using it.

I’ll keep finding a way on how to add functionalities with the available APIs and hopefully Mike or others can add more good looking clients to their project.

Bastian

1 Like

Hi @Patrick_Lang,

Thank you for the PR. I see that it does not conflict with my code and will merge shortly.

bastian

Thanks @St0g1e!

You are really good at figuring out the Roon API and I have learned more from your code than anything else. So I hope you keep playing!

@St0g1e, many thanks for the example code.

I have it working and I am trying to add a new API call to put an output into standby. I have added the following to your example as follows:

— roonAPI.js —

exports.standby = function(req, res) {
core.services.RoonApiTransport.standby(zones[req.query[‘output’]], {});

res.send({
“status”: “success”
})
};

— routes.js —
app.get(’/roonAPI/standby’, apis.standby);

— call made to http server —
http://localhost:3001/roonAPI/standby?output=1701ed7165c2cb977ddeb8f537f3ed49cdca

Did I miss something?

Many thanks again!

Hi @cg321,

I think you are working off of the https://github.com/st0g1e/roon-extension-http-api (http extension).

If you are, You also need to update the routes.js to have call recognized.

I was looking at roon’s Lab transport extension and they also have toggle_standby to get the output out of standby mode.

May I know what the standby is used for?

You can create a pull request or I can also add these functionalities if you want to.

Thanks for looking at the code,
Bastian

Hi @St0g1e, yeah I updated the routes.js as well:

— routes.js —
app.get(’/roonAPI/standby’, apis.standby);

I am guessing standby allows an output (my DAC) to be put in standby mode. I want to be able to turn it off as part of my home theatre scripts.

Chris