Available control and data requests

Christian edited this page Jan 7, 2017 · 60 revisions

The Raumserver has many requests which can be used to control the raumfeld system. There are control requests like start or stop playing and there are data requests which will return useful data like the current zone configuration. Those data requests in addition to the control requests may be used to create a web controller for home autmation or even a whole web client.

Control Requests

Control request can be sync(default) or async and are made on following url
http://[ip]:[port]/raumserver/controller/[requestCommand]?sync=false

  • play
    With this request you can start or resume playing the current playlist for a zone or for all zones
    /raumserver/controller/play
    /raumserver/controller/play?id=Wohnzimmer

  • stop
    With this request you can stop playing the current playlist for a zone or for all zones
    /raumserver/controller/stop
    /raumserver/controller/stop?id=Wohnzimmer

  • pause
    With this request you can pause playing the current playlist for a zone or for all zones
    /raumserver/controller/pause
    /raumserver/controller/pause?id=Wohnzimmer

  • next
    With this request you can jump to the next track of the current playlist for a zone or for all zones
    /raumserver/controller/next
    /raumserver/controller/next?id=Wohnzimmer

  • prev
    With this request you can jump to the prev track of the current playlist for a zone or for all zones
    /raumserver/controller/prev
    /raumserver/controller/prev?id=Wohnzimmer

  • seekToTrack With this request you can jump/seek to a track
    You can use trackIndex (trackIndex=3) parameter to jump to the given index (starts with 0)
    You can use trackNumber (trackNumber=4) parameter to jump to the given number (starts with 1)
    /raumserver/controller/seekToTrack?trackIndex=3&id=Wohnzimmer
    /raumserver/controller/seekToTrack?trackNumber=4&id=Wohnzimmer

  • seek
    With this request you can seek within a track
    The value parameter is in milliseconds
    /raumserver/controller/seek?id=Wohnzimmer&value=3000

  • setPlayMode
    With this request you can set the play mode for a zone or for all zones
    Available play modes are NORMAL, SHUFFLE, REPEAT_ONE, REPEAT_ALL, RANDOM (Shuffle + Repeat All)
    /raumserver/controller/setPlayMode?mode=SHUFFLE
    /raumserver/controller/setPlayMode?id=Wohnzimmer&mode=SHUFFLE
    /raumserver/controller/setPlayMode?id=Wohnzimmer&mode=REPEAT_ALL

  • sleepTimer
    With this request you can set a sleep timer for a zone or for all zones
    You can use secondsUntilSleep (secondsUntilSleep=120) parameter to set the remaining playing time in seconds
    If you set secondsUntilSleep to 0 (secondsUntilSleep=0) the sleeptimer is canceled
    You can use secondsForVolumeRamp (secondsForVolumeRamp=120) parameter to set the ramp for the volume decrease in seconds
    /raumserver/controller/sleepTimer?secondsUntilSleep=0
    /raumserver/controller/sleepTimer?secondsUntilSleep=600
    /raumserver/controller/sleepTimer?id=Wohnzimmer&secondsUntilSleep=600
    /raumserver/controller/sleepTimer?id=Wohnzimmer&secondsUntilSleep=1200&secondsForVolumeRamp=120

  • setVolume
    With this request you can set the volume either for a whole zone or for a single room.
    To set the value for the whole zone you have to add the scope (scope=zone) parameter.
    The volume may be set absolut or relative. For relative volume change you have to add the relative (relative=true) parameter
    /raumserver/controller/setVolume?value=25
    /raumserver/controller/setVolume?value=25&id=Wohnzimmer
    /raumserver/controller/setVolume?value=25&id=Wohnzimmer&scope=zone
    /raumserver/controller/setVolume?value=-5id=Wohnzimmer&scope=zone&relative=true

  • volumeUp
    With this request you can raise the volume either for a whole zone or for a single room.
    To raise the value for the whole zone you have to add the scope (scope=zone) parameter.
    /raumserver/controller/volumeUp?value=5
    /raumserver/controller/volumeUp?value=5&id=Wohnzimmer
    /raumserver/controller/volumeUp?value=5&id=Wohnzimmer&scope=zone

  • volumeDown
    With this request you can lower the volume either for a whole zone or for a single room.
    To lower the value for the whole zone you have to add the scope (scope=zone) parameter.
    /raumserver/controller/volumeDown?value=5
    /raumserver/controller/volumeDown?value=5&id=Wohnzimmer
    /raumserver/controller/volumeDown?value=5&id=Wohnzimmer&scope=zone

  • fadeToVolume
    With this request you can fade the volume either for a whole zone or for a single room to a specific value.
    To fade the value for the whole zone you have to add the scope (scope=zone) parameter.
    The volume may be faded absolut or relative. For relative volume fade you have to add the relative (relative=true) parameter
    The duration of the fade can be specified by adding the duration (duration=2000) parameter which value will be treated as milliseconds
    /raumserver/controller/fadeToVolume?value=25
    /raumserver/controller/fadeToVolume?value=25&id=Wohnzimmer
    /raumserver/controller/fadeToVolume?value=25&id=Wohnzimmer&duration=5000
    /raumserver/controller/fadeToVolume?value=25&id=Wohnzimmer&scope=zone&duration=100
    /raumserver/controller/fadeToVolume?value=-5id=Wohnzimmer&scope=zone&relative=true

  • mute
    With this request you can mute a whole zone or a single room
    To mute the whole zone you have to add the scope (scope=zone) parameter.
    /raumserver/controller/mute
    /raumserver/controller/mute?id=Wohnzimmer
    /raumserver/controller/mute=id=Wohnzimmer&scope=zone

  • unMute
    With this request you can unmute a whole zone or a single room
    To unmute the whole zone you have to add the scope (scope=zone) parameter.
    /raumserver/controller/unMute
    /raumserver/controller/unMute?id=Wohnzimmer
    /raumserver/controller/unMute=id=Wohnzimmer&scope=zone

  • toggleMute
    With this request you can toggle mute for a whole zone or a single room
    To toggle mute the whole zone you have to add the scope (scope=zone) parameter.
    /raumserver/controller/toggleMute
    /raumserver/controller/toggleMute?id=Wohnzimmer
    /raumserver/controller/toggleMute=id=Wohnzimmer&scope=zone

  • createZone
    With this request you can create a zone from a room
    /raumserver/controller/createZone?id=Wohnzimmer

  • addToZone
    With this request you can add a room to a zone
    /raumserver/controller/addToZone?id=Wohnzimmer&zoneId=Badezimmer

  • dropFromZone
    With this request you can drop a room from a zone
    /raumserver/controller/dropFromZone?id=Wohnzimmer

  • loadContainer
    With this request you can load a container id into a zone playlist
    A container id is a id which is used by a upnp media server to define for example playlists, albums, artists aso.
    /raumserver/controller/loadContainer?id=Wohnzimmer&value=[urlencoded container id]
    /raumserver/controller/loadContainer?id=Wohnzimmer&value=0%2FFavorites%2FMyFavorites%2F20433

  • loadPlaylist
    With this request you can load a stored playlist id into a zone playlist
    /raumserver/controller/loadPlaylist?id=Wohnzimmer&value=[urlencoded playlist name]
    /raumserver/controller/loadPlaylist?id=Wohnzimmer&value=Rock

  • loadUri
    With this request you can load a uri into a zone playlist
    You may use this for loading streams which are not accessible via the upnp server
    Currently only direct urls will work (no playlist urls)
    /raumserver/controller/loadUri?id=Wohnzimmer&value=[urlencoded uri]
    /raumserver/controller/loadUri?id=Wohnzimmer&value=http%3A%2F%2Fmp3channels.webradio.rockantenne.de%2Fheavy-metal

  • loadShuffle
    With this request you can load a shuffle into a zone playlist
    Use the source (source=RecentArtists) parameter to define the type of the shuffle.
    Valid types are RecentArtists, TopArtists, All, Genre, Artists
    Whereat Genre, Artists you may add the selection (selection=TODO@@@) paramter which ranges the shuffle source
    /raumserver/controller/loadShuffle?id=Wohnzimmer&source=TopArtists
    /raumserver/controller/loadShuffle?id=Wohnzimmer&source=Genre&selection=TODO@@@

  • enterAutomaticStandby
    I am not sure what this one does O_o
    /raumserver/controller/enterAutomaticStandby
    /raumserver/controller/enterAutomaticStandby?id=Bad

  • enterManualStandby
    With this request you can set a device to standby(eco) mode if the device does have the option (2nd Gen)
    /raumserver/controller/enterManualStandby
    /raumserver/controller/enterManualStandby?id=Bad

  • leaveStandby
    With this request you can leave the standby(eco) mode if the device does have the option (2nd Gen)
    /raumserver/controller/leaveStandby
    /raumserver/controller/leaveStandby?id=Bad

Data Requests

Data requests are in JSON format and are always sync requests
They can be called by following url
http://[ip]:[port]/raumserver/data/[requestCommand]

  • getVersion
    This request returns the current version information of the raumkernel and raumserver libraries that are used
    /raumserver/data/getVersion

  • getZoneConfig
    This request returns the current zone configuration and the unasigned rooms (in an empty zone)
    This request has the ability for long polling by providing the updateId parameter which is returned on the first request in the Response header
    /raumserver/data/getZoneConfig
    /raumserver/data/getZoneConfig?updateId=[updateId]

  • getMediaList
    This request returns a list of media items for the Container id that's passed
    This request has the ability for long polling by providing the updateId parameter which is returned
    To load the list from cache you have to add the useCache (useCache=true) parameter.
    on the first request in the Response header
    /raumserver/data/getMediaList?id=[ecoded container uri]
    /raumserver/data/getMediaList?id=0%2FFavorites%2FMyFavorites
    /raumserver/data/getMediaList?id=0%2FFavorites%2FMyFavorites&updateId=[updateId]

  • getZoneMediaList
    This request returns a list of media items that are currently loaded in the zone playlist
    To load the list from cache you have to add the useCache (useCache=true) parameter.
    This request has the ability for long polling by providing the updateId parameter which is returned on the first request in the Response header
    /raumserver/data/getZoneMediaList?id=Wohnzimmer
    /raumserver/data/getZoneMediaList?id=Wohnzimmer&updateId=[updateId]

  • getRendererState
    This request returns the renderer state for one or all zones (eg. virtual renderers)
    Use the listAll (listAll=true) parameter to include renderers without connections to a zone
    This request has the ability for long polling by providing the updateId parameter which is returned on the first request in the Response header
    http://10.0.0.6:8080/raumserver/data/getRendererState
    http://10.0.0.6:8080/raumserver/data/getRendererState?updateId=[updateId]
    http://10.0.0.6:8080/raumserver/data/getRendererState?id=Wohnzimmer
    http://10.0.0.6:8080/raumserver/data/getRendererState?listAll=true