ChriD / node-raumserver

A nodejs module/server to control the raumfeld multiroomsystem via HTTP-Requests
58 stars 14 forks source link

Get current volume level via http request #40

Open brotkasten87 opened 7 years ago

brotkasten87 commented 7 years ago

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!

gahujipo commented 7 years ago

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

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

brotkasten87 commented 7 years ago

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!

ChriD commented 7 years ago

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!

brotkasten87 commented 7 years ago

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

ChriD commented 6 years ago

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

gahujipo commented 6 years ago

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.

brotkasten87 commented 6 years ago

Any updates on this request? Getting the volume via

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

would be great.

ChriD commented 5 years ago

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

davie2000 commented 5 years ago

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?!

ChriD commented 5 years ago

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

davie2000 commented 5 years ago

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

brotkasten87 commented 5 years ago

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

davie2000 commented 5 years ago

@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 ...