node-raumserver icon indicating copy to clipboard operation
node-raumserver copied to clipboard

Get current volume level via http request

Open brotkasten87 opened this issue 8 years ago • 13 comments

Hi,

I'm trying to add an Raumfeld Speaker Service to my HomeKit Installation. For this, I need the current volume of the raumfeld zone/speaker as an http request in plain "0" - "100" format.

Is this already possible? I know that it's possible to set the volume, but how to get the current volume level back?

Thanks for your help!

brotkasten87 avatar Sep 21 '17 14:09 brotkasten87

you can do this by calling /raumserver/controller/getRendererState?id=Zonename

The property "Volume" gives you the current percentage value of the volume.

gahujipo avatar Sep 21 '17 16:09 gahujipo

Hi, thanks for your answer. Is there a possiblity to get the value of the property back directly by calling something like:

/raumserver/controller/getRendererState?id=Zonename&property=Volume

I'm trying to use the homebridge-http-speaker plugin to connect Raumfeld to Apple HomeKit. ( https://www.npmjs.com/package/homebridge-http-speaker ) It requires the Volume to be a 0-100 value.

Thanks in advance!

brotkasten87 avatar Sep 22 '17 08:09 brotkasten87

Sorry, this is not possible in the current release. I can add this as feature request. But currently i have so much work to do that it will take some time before i can implement this!

ChriD avatar Sep 22 '17 09:09 ChriD

Thanks for your answer. Alright, it would be great if that's possible in a future version. Thanks!

brotkasten87 avatar Sep 22 '17 09:09 brotkasten87

I thougt about it and i think i will add a getRendererValue request which will return the current value of the given key. The key will the exactly the one given in the UPNP specs
e.g.: /getRendererValue?id=Küche&key=Volume Maybe i will do a combination with the trigger issue #54 I have to think about that

ChriD avatar Feb 03 '18 20:02 ChriD

Would it be possible to implement there a third parameter that triggers a value conversion? I am using Loxone to access the raumserver. Loxone until now doesn't offer a way to react on strings like "true" or "false", therefore a conversion for true to 1 and false to 0 would help using those values.

gahujipo avatar Feb 04 '18 21:02 gahujipo

Any updates on this request? Getting the volume via

/getRendererValue?id=Küche&key=Volume

would be great.

brotkasten87 avatar Oct 20 '18 10:10 brotkasten87

Sorry, no updates. i am busy programming KNX and a home automation gui in my house XD

ChriD avatar Dec 02 '18 10:12 ChriD

I have cobbled something together which is able to get some RendererState-Variables, e.g. Volume, CurrentTrackDuration, etc. - fact is: many variables are NOT working which results in empty answer but no error.

I am not proud of it, but here is the content for the new file lib.request.getRendererValue.js: https://pastebin.com/0RpirwC9

Maybe ChriD will be so nice and cut the code down to what it really needs to work correctly?!

davie2000 avatar Dec 26 '18 10:12 davie2000

Whoooo sorry davie2000. i missed this answer completely, Thank you for your code! I'll check it.

ChriD avatar Apr 09 '19 07:04 ChriD

No problem! Thread opener seems not to be in a hurry anyway ;-) I am looking forward to seeing a correct version from you ...

davie2000 avatar Apr 09 '19 17:04 davie2000

@ChriD - I'm not in a hurry of course but are there any updates on the /getRendererValue?id=Küche&key=Volume request? Thanks!

brotkasten87 avatar Oct 07 '19 09:10 brotkasten87

@brotkasten87 You can try it yourself by adding the file from pastebin into your local copy of node-raumserver. You could make a pull request and ChriD will add it maybe ...

davie2000 avatar Oct 10 '19 17:10 davie2000