TTS Volume not working, unable to set.

I have the TTS working but there is one issue I am seeing. I am not able to set the Volume level. It will play my TTS(Via the ALTSonos plugin) but only at the current value the sonos devices is set at. I have tried via LUUP code and the Action optin in Scene creator in ALTUI.

local ALTUI_DEVICE_NO = 850
local ALTUI_DEVICE_SID = “urn:upnp-org:serviceId:altui1”
local GROUP_ID_KITCHEN = “RINCON_######################”
local EVENT_VOLUME = “75”

EVENT_MESSAGE = “Garage Freezer door has been left open for more then five minutes, please close to prevent food from going bad.”
return luup.call_action(ALTUI_DEVICE_SID, “SayTTS”, {newMessage = EVENT_MESSAGE, newVolume = EVENT_VOLUME, newGroupDevices = GROUP_ID_KITCHEN}, ALTUI_DEVICE_NO)

I have my Sonos volume at 5 and when this runs, it should put volume to 75 but it does not. Any Ideas?

Volume

[quote=“kyle.dawson, post:1, topic:200239”]I have the TTS working but there is one issue I am seeing. I am not able to set the Volume level. It will play my TTS(Via the ALTSonos plugin) but only at the current value the sonos devices is set at. I have tried via LUUP code and the Action optin in Scene creator in ALTUI.

local ALTUI_DEVICE_NO = 850
local ALTUI_DEVICE_SID = “urn:upnp-org:serviceId:altui1”
local GROUP_ID_KITCHEN = “RINCON_######################”
local EVENT_VOLUME = “75”

EVENT_MESSAGE = “Garage Freezer door has been left open for more then five minutes, please close to prevent food from going bad.”
return luup.call_action(ALTUI_DEVICE_SID, “SayTTS”, {newMessage = EVENT_MESSAGE, newVolume = EVENT_VOLUME, newGroupDevices = GROUP_ID_KITCHEN}, ALTUI_DEVICE_NO)

I have my Sonos volume at 5 and when this runs, it should put volume to 75 but it does not. Any Ideas?

Volume[/quote]

I am looking at it but the sonos cloud loadStreamUrl does not support a vol parameter so changing the volume would cost an extra call prior to playing the mp3 file ( hence delay ) plus may not restore the previous vol.

Can you make an action on the ALTSonos plugin to get and set volume? I am using luua to do my TTS, so I can call a get volume and save it, then set new volume and run TTS. Afterwords I would set with original volume. For me, the little delay is ok, I do not need fast TTS. Just within a minute or so to be honest.

these 2 actions already exists as per this screen shot of ALTUI. they are ALTSonos plugin actions

Duh, sorry for that. I am good now.

I am not sure how to get the value. I can call the Action but it returns 0 every time, even when volume is at 75. I looked how to call an action to get a value, my only experience is to call action and pass value, no retrieve.

I tried the following:

local currentLevel = luup.call_action(ALTSONOS_DEVICE_SID, “GetVolume”, { groupID = GROUP_ID_KITCHEN, } , ALTSONOS_DEVICE_NO)

or

local resultCode, resultString, job, returnArguments = luup.call_action(ALTSONOS_DEVICE_SID, “GetVolume”, { groupID = GROUP_ID_KITCHEN, } , ALTSONOS_DEVICE_NO)

[quote=“kyle.dawson, post:6, topic:200239”]I am not sure how to get the value. I can call the Action but it returns 0 every time, even when volume is at 75. I looked how to call an action to get a value, my only experience is to call action and pass value, no retrieve.

I tried the following:

local currentLevel = luup.call_action(ALTSONOS_DEVICE_SID, “GetVolume”, { groupID = GROUP_ID_KITCHEN, } , ALTSONOS_DEVICE_NO)

or

local resultCode, resultString, job, returnArguments = luup.call_action(ALTSONOS_DEVICE_SID, “GetVolume”, { groupID = GROUP_ID_KITCHEN, } , ALTSONOS_DEVICE_NO)[/quote]

Typically a call action url like this :

http://192.168.1.17/port_3480/data_request?id=action&output_format=json&DeviceNum=264&serviceId=urn:upnp-org:serviceId:altsonos1&action=GetVolume&groupID=RINCON_5CAAFD48410601400%3A4657
returns this result in the body:

{ "u:GetVolumeResponse": { "LastVolume": "7" } }

it also works with luup call_action

local resultCode, resultString, job, returnArguments = luup.call_action("urn:upnp-org:serviceId:altsonos1", "GetVolume", {["groupID"] = "RINCON_5CAAFD48410601400%3A4657"}, 264)

output format could be xml as well which returns in returnArguments a lua table lie this

{LastVolume = "7"}

cf screen shot.