RenderingControl service
Volume related controls
The RenderingControl service is available on these models: v2-S1 / v2-S13 / v2-S14 / v2-S18 / v2-S21 / v2-S27 / v2-S3 / v2-S33 / v2-S38 / v2-S6 / v2-S9 / v2-Sub.
const SonosDevice = require('@svrooij/sonos').SonosDevice
const sonos = new SonosDevice('192.168.x.x')
sonos.RenderingControlService.OneOfTheMethodsBelow({...})
All actions that require input expect an object with the specified parameters, even if it only requires one parameter.
- GetBass
- GetEQ
- GetHeadphoneConnected
- GetLoudness
- GetMute
- GetOutputFixed
- GetRoomCalibrationStatus
- GetSupportsOutputFixed
- GetTreble
- GetVolume
- GetVolumeDB
- GetVolumeDBRange
- RampToVolume
- ResetBasicEQ
- ResetExtEQ
- RestoreVolumePriorToRamp
- SetBass
- SetChannelMap
- SetEQ
- SetLoudness
- SetMute
- SetOutputFixed
- SetRelativeVolume
- SetRoomCalibrationStatus
- SetRoomCalibrationX
- SetTreble
- SetVolume
- SetVolumeDB
- RenderingControlService event
GetBass
Get bass level between -10 and 10
const result = await sonos.RenderingControlService.GetBass({ InstanceID:... });
Input object:
| property | type | description |
|---|---|---|
| InstanceID | number | InstanceID should always be 0
|
Output object:
| property | type | description |
|---|---|---|
| CurrentBass | number |
GetEQ
Get equalizer value
const result = await sonos.RenderingControlService.GetEQ({ InstanceID:..., EQType:... });
Input object:
| property | type | description |
|---|---|---|
| InstanceID | number | InstanceID should always be 0
|
| EQType | string | Allowed values DialogLevel (bool) / MusicSurroundLevel (-15/+15) / NightMode (bool) / SubGain (-10/+10) / SurroundEnable (bool) / SurroundLevel (-15/+15) / SurroundMode (0 = ambient, 1 = full) / HeightChannelLevel (-10/+10) |
Output object:
| property | type | description |
|---|---|---|
| CurrentValue | number | Booleans return 1 / 0, rest number as specified |
Remarks Not all EQ types are available on every speaker
GetHeadphoneConnected
const result = await sonos.RenderingControlService.GetHeadphoneConnected({ InstanceID:... });
Input object:
| property | type | description |
|---|---|---|
| InstanceID | number | InstanceID should always be 0
|
Output object:
| property | type | description |
|---|---|---|
| CurrentHeadphoneConnected | boolean |
GetLoudness
Whether or not Loudness is on
const result = await sonos.RenderingControlService.GetLoudness({ InstanceID:..., Channel:... });
Input object:
| property | type | description |
|---|---|---|
| InstanceID | number | InstanceID should always be 0
|
| Channel | string | Allowed values: Master / LF / RF
|
Output object:
| property | type | description |
|---|---|---|
| CurrentLoudness | boolean |
GetMute
const result = await sonos.RenderingControlService.GetMute({ InstanceID:..., Channel:... });
Input object:
| property | type | description |
|---|---|---|
| InstanceID | number | InstanceID should always be 0
|
| Channel | string | Allowed values: Master / LF / RF
|
Output object:
| property | type | description |
|---|---|---|
| CurrentMute | boolean |
GetOutputFixed
const result = await sonos.RenderingControlService.GetOutputFixed({ InstanceID:... });
Input object:
| property | type | description |
|---|---|---|
| InstanceID | number | InstanceID should always be 0
|
Output object:
| property | type | description |
|---|---|---|
| CurrentFixed | boolean |
GetRoomCalibrationStatus
const result = await sonos.RenderingControlService.GetRoomCalibrationStatus({ InstanceID:... });
Input object:
| property | type | description |
|---|---|---|
| InstanceID | number | InstanceID should always be 0
|
Output object:
| property | type | description |
|---|---|---|
| RoomCalibrationEnabled | boolean | |
| RoomCalibrationAvailable | boolean |
GetSupportsOutputFixed
const result = await sonos.RenderingControlService.GetSupportsOutputFixed({ InstanceID:... });
Input object:
| property | type | description |
|---|---|---|
| InstanceID | number | InstanceID should always be 0
|
Output object:
| property | type | description |
|---|---|---|
| CurrentSupportsFixed | boolean |
GetTreble
Get treble
const result = await sonos.RenderingControlService.GetTreble({ InstanceID:... });
Input object:
| property | type | description |
|---|---|---|
| InstanceID | number | InstanceID should always be 0
|
Output object:
| property | type | description |
|---|---|---|
| CurrentTreble | number | Number between -10 and 10 |
GetVolume
Get volume
const result = await sonos.RenderingControlService.GetVolume({ InstanceID:..., Channel:... });
Input object:
| property | type | description |
|---|---|---|
| InstanceID | number | InstanceID should always be 0
|
| Channel | string | Allowed values: Master / LF / RF
|
Output object:
| property | type | description |
|---|---|---|
| CurrentVolume | number | Number between 0 and 100 |
GetVolumeDB
const result = await sonos.RenderingControlService.GetVolumeDB({ InstanceID:..., Channel:... });
Input object:
| property | type | description |
|---|---|---|
| InstanceID | number | InstanceID should always be 0
|
| Channel | string | Allowed values: Master / LF / RF
|
Output object:
| property | type | description |
|---|---|---|
| CurrentVolume | number |
GetVolumeDBRange
const result = await sonos.RenderingControlService.GetVolumeDBRange({ InstanceID:..., Channel:... });
Input object:
| property | type | description |
|---|---|---|
| InstanceID | number | InstanceID should always be 0
|
| Channel | string | Allowed values: Master / LF / RF
|
Output object:
| property | type | description |
|---|---|---|
| MinValue | number | |
| MaxValue | number |
RampToVolume
const result = await sonos.RenderingControlService.RampToVolume({ InstanceID:..., Channel:..., RampType:..., DesiredVolume:..., ResetVolumeAfter:..., ProgramURI:... });
Input object:
| property | type | description |
|---|---|---|
| InstanceID | number | InstanceID should always be 0
|
| Channel | string | Allowed values: Master / LF / RF
|
| RampType | string | Allowed values: SLEEP_TIMER_RAMP_TYPE / ALARM_RAMP_TYPE / AUTOPLAY_RAMP_TYPE
|
| DesiredVolume | number | |
| ResetVolumeAfter | boolean | |
| ProgramURI | string |
Output object:
| property | type | description |
|---|---|---|
| RampTime | number |
ResetBasicEQ
const result = await sonos.RenderingControlService.ResetBasicEQ({ InstanceID:... });
Input object:
| property | type | description |
|---|---|---|
| InstanceID | number | InstanceID should always be 0
|
Output object:
| property | type | description |
|---|---|---|
| Bass | number | |
| Treble | number | |
| Loudness | boolean | |
| LeftVolume | number | |
| RightVolume | number |
ResetExtEQ
const result = await sonos.RenderingControlService.ResetExtEQ({ InstanceID:..., EQType:... });
Input object:
| property | type | description |
|---|---|---|
| InstanceID | number | InstanceID should always be 0
|
| EQType | string |
This actions returns a boolean whether or not the requests succeeded.
RestoreVolumePriorToRamp
const result = await sonos.RenderingControlService.RestoreVolumePriorToRamp({ InstanceID:..., Channel:... });
Input object:
| property | type | description |
|---|---|---|
| InstanceID | number | InstanceID should always be 0
|
| Channel | string | Allowed values: Master / LF / RF
|
This actions returns a boolean whether or not the requests succeeded.
SetBass
Set bass level, between -10 and 10
const result = await sonos.RenderingControlService.SetBass({ InstanceID:..., DesiredBass:... });
Input object:
| property | type | description |
|---|---|---|
| InstanceID | number | InstanceID should always be 0
|
| DesiredBass | number |
This actions returns a boolean whether or not the requests succeeded.
SetChannelMap
const result = await sonos.RenderingControlService.SetChannelMap({ InstanceID:..., ChannelMap:... });
Input object:
| property | type | description |
|---|---|---|
| InstanceID | number | InstanceID should always be 0
|
| ChannelMap | string |
This actions returns a boolean whether or not the requests succeeded.
SetEQ
Set equalizer value for different types
const result = await sonos.RenderingControlService.SetEQ({ InstanceID:..., EQType:..., DesiredValue:... });
Input object:
| property | type | description |
|---|---|---|
| InstanceID | number | InstanceID should always be 0
|
| EQType | string | Allowed values DialogLevel (bool) / MusicSurroundLevel (-15/+15) / NightMode (bool) / SubGain (-10/+10) / SurroundEnable (bool) / SurroundLevel (-15/+15) / SurroundMode (0 = ambient, 1 = full) / HeightChannelLevel (-10/+10) |
| DesiredValue | number | Booleans required 1 for true or 0 for false, rest number as specified |
This actions returns a boolean whether or not the requests succeeded.
Remarks Not supported by all speakers, TV related
SetLoudness
Set loudness on / off
const result = await sonos.RenderingControlService.SetLoudness({ InstanceID:..., Channel:..., DesiredLoudness:... });
Input object:
| property | type | description |
|---|---|---|
| InstanceID | number | InstanceID should always be 0
|
| Channel | string | Allowed values: Master / LF / RF
|
| DesiredLoudness | boolean |
This actions returns a boolean whether or not the requests succeeded.
SetMute
const result = await sonos.RenderingControlService.SetMute({ InstanceID:..., Channel:..., DesiredMute:... });
Input object:
| property | type | description |
|---|---|---|
| InstanceID | number | InstanceID should always be 0
|
| Channel | string | Allowed values: Master / LF / RF
|
| DesiredMute | boolean |
This actions returns a boolean whether or not the requests succeeded.
SetOutputFixed
const result = await sonos.RenderingControlService.SetOutputFixed({ InstanceID:..., DesiredFixed:... });
Input object:
| property | type | description |
|---|---|---|
| InstanceID | number | InstanceID should always be 0
|
| DesiredFixed | boolean |
This actions returns a boolean whether or not the requests succeeded.
SetRelativeVolume
const result = await sonos.RenderingControlService.SetRelativeVolume({ InstanceID:..., Channel:..., Adjustment:... });
Input object:
| property | type | description |
|---|---|---|
| InstanceID | number | InstanceID should always be 0
|
| Channel | string | Allowed values: Master / LF / RF
|
| Adjustment | number |
Output object:
| property | type | description |
|---|---|---|
| NewVolume | number |
SetRoomCalibrationStatus
const result = await sonos.RenderingControlService.SetRoomCalibrationStatus({ InstanceID:..., RoomCalibrationEnabled:... });
Input object:
| property | type | description |
|---|---|---|
| InstanceID | number | InstanceID should always be 0
|
| RoomCalibrationEnabled | boolean |
This actions returns a boolean whether or not the requests succeeded.
SetRoomCalibrationX
const result = await sonos.RenderingControlService.SetRoomCalibrationX({ InstanceID:..., CalibrationID:..., Coefficients:..., CalibrationMode:... });
Input object:
| property | type | description |
|---|---|---|
| InstanceID | number | InstanceID should always be 0
|
| CalibrationID | string | |
| Coefficients | string | |
| CalibrationMode | string |
This actions returns a boolean whether or not the requests succeeded.
SetTreble
Set treble level
const result = await sonos.RenderingControlService.SetTreble({ InstanceID:..., DesiredTreble:... });
Input object:
| property | type | description |
|---|---|---|
| InstanceID | number | InstanceID should always be 0
|
| DesiredTreble | number | between -10 and 10 |
This actions returns a boolean whether or not the requests succeeded.
SetVolume
const result = await sonos.RenderingControlService.SetVolume({ InstanceID:..., Channel:..., DesiredVolume:... });
Input object:
| property | type | description |
|---|---|---|
| InstanceID | number | InstanceID should always be 0
|
| Channel | string | Allowed values: Master / LF / RF
|
| DesiredVolume | number |
This actions returns a boolean whether or not the requests succeeded.
SetVolumeDB
const result = await sonos.RenderingControlService.SetVolumeDB({ InstanceID:..., Channel:..., DesiredVolume:... });
Input object:
| property | type | description |
|---|---|---|
| InstanceID | number | InstanceID should always be 0
|
| Channel | string | Allowed values: Master / LF / RF
|
| DesiredVolume | number |
This actions returns a boolean whether or not the requests succeeded.
RenderingControlService event
const SonosDevice = require('@svrooij/sonos').SonosDevice
const sonos = new SonosDevice('192.168.x.x')
sonos.RenderingControlService.Events('serviceEvent', (data) => {
console.log(data);
});
The RenderingControlService emits events with these properties. Not all properties are emitted every time.
| parameter | type | possible values |
|---|---|---|
| AudioDelay | string | |
| AudioDelayLeftRear | string | |
| AudioDelayRightRear | string | |
| Bass | number | |
| DialogLevel | string | |
| EQValue | number | |
| HeadphoneConnected | boolean | |
| HeightChannelLevel | number | |
| LastChange | string | |
| Loudness | boolean | |
| MusicSurroundLevel | string | |
| Mute | boolean | |
| NightMode | boolean | |
| OutputFixed | boolean | |
| PresetNameList | string | |
| RoomCalibrationAvailable | boolean | |
| RoomCalibrationCalibrationMode | string | |
| RoomCalibrationCoefficients | string | |
| RoomCalibrationEnabled | boolean | |
| RoomCalibrationID | string | |
| SpeakerSize | number | |
| SubCrossover | string | |
| SubEnabled | boolean | |
| SubGain | string | |
| SubPolarity | string | |
| SupportsOutputFixed | boolean | |
| SurroundEnabled | boolean | |
| SurroundLevel | string | |
| SurroundMode | string | |
| Treble | number | |
| Volume | number | |
| VolumeDB | number |
This file is automatically generated with @svrooij/sonos-docs, do not edit manually.