So I have a working baseline of what I want to do, where a Node Express site controls Roon via URLs. (Thanks FunkBrother!). Pause, Play, Next etc work perfectly by passing the commands as URL parms, but I would also like to be able to control volume. I see that there is a change_volume method in the transport API, and I have set up my site JS code to handle that command, but I am having a couple problems:
Even though I am passing the zone to the method, I get an error saying that it (output_id) is missing. Here is the code:
transport.change_volume(zone, "absolute", 20);
"zone" above is a variable set earlier in the code, and I know it is correct because the variable works correctly for Play/Pause etc.
If I hard to code the zone id (which I can see in the logging so I can grab it), I don’t get that error, BUT, it does not change the volume.
FYI, the zone I am testing with is a RaspberryPi --> AQ Dragonfly Red.
I also see a separate volume API, but I don’t understand why this exists if the transport api has volume control. Also I didn’t see any examples for the volume API. and I am new at this, so I need some examples!
Your change_volume line will work if you have the correct zone object type. There appear to be 2 variants of it, a big one containing all required info to create a UI and a small one containing just a name and an output_id. It’s the second one that has to be used to change volume.
I got the correct object type via a zone selection pulldown in my settings dialog, I don’t know if there are other ways to obtain it.
I just got the pieces and parts last night, so I should be good on the version of the transport api…and THANKS SO MUCH for the info on the zone.outputs[0]
I will give that a try tonight.
I would definitely RTFM is there was one Meanwhile, FunkBrother / All, where can I find details like “zone.outputs[0]” without having to post here? Where are you finding these answers? Thanks Again!
Try and error. The error message stated, that there’s an output_id required. So i looked at the zone data structure and found the outputs array. Since i only have 1 output per zone, i’m using the first element of the array.
can you not pass zone there instead of zone.outputs[0]? you should be able to, since volume can be changed on a grouped zone as well…if you cant… give me an “issue” on github and ill resolve
i have lower level protocol docs that need to be converted into jsdoc – if anyone is up to the challenge of helping me out here… just let me know…