as is see, the web controller uses nodejs. it should be no problem to add it there.
you can change the code from that script by yourself, but it will be lost on every update.
so better to do this by the developer of the roon web controller.
streamy, its untested, but it should look like this: (volume slider not included)
you can change the code from that script by yourself, but it will be lost on every update.
so better to do this by the developer of the roon web controller.
streamy, its untested, but it should look like this: (volume slider not included)
Code:
####################
var phantomBridge = "192.168.0.123";
var Volume = "20";
####################
var body = '<s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">' +
<s:Body>' +
<u:SetVolume xmlns:u="urn:schemas-upnp-org:service:RenderingControl:2">' +
<InstanceID>0</InstanceID>' +
<Channel>Master</Channel>' +
<DesiredVolume>'+Volume+'</DesiredVolume>' +
</u:SetVolume>' +
</s:Body>' +
</s:Envelope>';
var postRequest = {
host: phantomBridge,
path: "/Control/LibRygelRenderer/RygelRenderingControl",
port: 36933,
method: "POST",
headers: {
"Accept": "text/xml",
"Content-length": Buffer.byteLength(body),
"Content-Type": "text/xml;charset=UTF-8",
"SOAPAction": "urn:schemas-upnp-org:service:RenderingControl:2#SetVolume",
}
};
var buffer = "";
var req = http.request( postRequest, function( res ) {
console.log( res.statusCode );
var buffer = "";
res.on( "data", function( data ) { buffer = buffer + data; } );
res.on( "end", function( data ) { console.log( buffer ); } );
});
req.on('error', function(e) {
console.log('problem with request: ' + e.message);
});
req.write( body );
req.end();