Using RampToVolume calls

Guys, good work on the plugin so far. I’ve been following along and trying to make this work for my setup and I’m getting very close to the way I’d optimally like it to work. Rather than use the Say function, I’ve created a bunch of mp3s from iSpeech (I think the voice is more natural sounding than Google TTS). I managed to get the mp3’s to play (It took some work but I got it using x-file-cifs:// before the file name). Now I just need to get volume adjusted everytime one of those mp3s plays. I’m assuming I can use the RampToVolume and RestoreVolumePriorToRamp functions, but I don’t know what parameters to use. Nothing I put in seems to do anything to the volume. What should I be typing for the Instance ID, Channel, and RampType parameters?

Also, FYI, SavePlaybackContext and a delayed RestorePlaybackContext are working great when used with an mp3. I’ve tested the functions on a local mp3 playlist, Sirius XM, and Pandora. All of them are supported. Unfortunately, Pandora doesn’t resume from the same song, but I’m guessing there is no way around that.

Can you check what is the behaviour when you stop Pandora and then play it again (using only Stop and Play buttons) ? Is it the same song or a new one ?

When I stop it and then start it again, it will always play a different song. I don’t think there is any way around this unless you can somehow pause Pandora in the background, play the requested file and then resume Pandora playback.
It’s essentially the same when using a smart phone. If you pause it and then hit play 10 minutes later, you can resume the same song. If you close the app and immediately open it back up, you will get a different song.

[quote=“habano, post:3, topic:173425”]When I stop it and then start it again, it will always play a different song. I don’t think there is any way around this unless you can somehow pause Pandora in the background, play the requested file and then resume Pandora playback.
It’s essentially the same when using a smart phone. If you pause it and then hit play 10 minutes later, you can resume the same song. If you close the app and immediately open it back up, you will get a different song.[/quote]

In this case, I don’t think we can do anything for that. It is not possible to pause Pandora in the background.

Opening the file S_SonosRenderingControl1.xml could help to get few information like the allowed values.
For the channel, use “Master”.

It took a little work, but I just managed to set up my scene the way I wanted. Thank you lolodomo for helping me figure out what channel to use. I ended up not using RampToVolume. Apparently that wasn’t the call I need to be using.

For anyone trying to play an mp3 at a set volume, here is how I set up my scene:
Immediate - SavePlaybackContext
Immediate - GetVolume (Channel: Master)
Immediate - SetVolume (Channel: Master, Desired Volume: 80)
Immediate - PlayURI (URIToPlay: x-file-cifs://[remote IP]/[folder]/[filename].mp3)
Delay 4 seconds - RestoreVolumePriorToRamp (channel: Master)
Delay 4 seconds - RestorePlaybackContext

I don’t know that this is the most efficient way to set the scene up, but it gives me exactly what I want. Now I just need to program about 20 different scenes.

You can probably forget the channel parameter as its default value is master

So is SetRelativeVolume what the main sonos software would show when averaging multiple sonos systems with different volume controls, but still move up or down in relation to master volume slider?
I do the EXACT same thing you’re doing @Habano, except I have 2 sonos (1 play3, and a the one that has a line out to serve 8 zones through my russound CAM6.6… And i’m having the issue of not hearing the alerts, if someone turned the volume down.

Getting them to play on BOTH systems is the challenge as it requires them to be grouped with my Play3 as the master since I’m serving this to the Play3 in Vera…

RampToVolume works now, for me, but I had to add a RampTime parameter as well.
Channel: Master
RampType: SLEEP_RAMP_TYPE
DesiredVolume 25
ResetVolumeAfter: 0
ProgramURI:
RampTime: 0

It seems RampTime is ignored, though. ProgramURI was empty, and DesiredVolume can be anything.

habano, are you configuring this scene in the GUI, or programmatically with Lua code? Either way, a screenshot would be nice. I’ve been trying to find a little time to accomplish exactly what you’ve done here and I (as well as others,) would appreciate it if I could see how you did it. Thanks!
Pasqual

My setup as I had it is listed above; it was all done through the advenced tab on the scene configuration and without Lua. I never got RampToVolume to work and instead used GetVolume, SetVolume, and RestoreVolumePriorToRamp. Accoring to qedi’s post, it doesn’t look like RampToVolume was ever fully functional. Perhaps it’s a bug that lolodomo needs to look at.
I have since changed my setup and simply replaced it with Alert for my needs. I gave the scene the volume I want and it reverts after the scene completes.

I just checked and I can confirm the bug, that is the rlast parameter is forgotten.
I will provide a fix.

RampTime is an output parameter, not an input parameter. There is no valid reason to provide it when calling the action.

I succeeded in using RampToVolume using these parameters without any change of the plugin:
Channel: Master
RampType: AUTOPLAY_RAMP_TYPE
DesiredVolume 50 (the final volume value you want)
ResetVolumeAfter: 0
ProgramURI:

Please note that SLEEP_RAMP_TYPE is not a valid value for the RampType parameter. You have to choose between SLEEP_TIMER_RAMP_TYPE, ALARM_RAMP_TYPE and AUTOPLAY_RAMP_TYPE

Hello.
I’m trying to do some “things” with autovera and tasker on my android phone and one of those is handling the volume of sonos speakers. I’m trying to use RampToVolume but doesn’t work. Through the logs of autovera the command that is sent is the following:

http://192.168.1.105:3480/data_request?id=lu_action&serviceId=urn:upnp-org:serviceId:RenderingControl&action=RampToVolume&DesiredVolume=35&ResetVolumeAfter=0&RampType=ALARM_RAMP_TYPE&DeviceNum=38&output_format=json

And the response I get is:
{ “u:RampToVolumeResponse”: { “RampTime”: “0” } }

There are some more fields that are not sent cause I dont know what values should they have: Instance ID, Channel, Program URI

Other actions like Say and SetVolume do work fine!
Does somebody know what’s missing?
Thanks

InstanceID has to be set to 0.
Channel has to be set to Master.

With the RampToVolume calls is it possible to have a it slowly ramp. For example I have music fade on in the morning. And I want it to go from 5 to 80 Volume over a matter of 30 minutes. How would I do that?