We have moved at community.getvera.com

Author Topic: TTS Volume not working, unable to set.  (Read 419 times)

Offline kyle.dawson

  • Full Member
  • ***
  • Posts: 153
  • Karma: +1/-1
TTS Volume not working, unable to set.
« on: December 15, 2018, 02:42:08 pm »
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

VeraPlus(1), Sonos(3), GE Switch(30), GE Dimmer(5), GE Zwave Outlet(3), MimoLight Garage Door(1),Neo Motion(6), Door Sensors(3) Camera(9), Honeywell Thermostat(2), Google Home(4), Alexa(4), Google Chrome Cast(5)  - Driven via ALTUI

Offline amg0

  • Moderator
  • Master Member
  • *****
  • Posts: 3174
  • Karma: +210/-8
Re: TTS Volume not working, unable to set.
« Reply #1 on: December 15, 2018, 06:35:24 pm »
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

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.

Offline kyle.dawson

  • Full Member
  • ***
  • Posts: 153
  • Karma: +1/-1
Re: TTS Volume not working, unable to set.
« Reply #2 on: December 16, 2018, 10:46:27 am »
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.



VeraPlus(1), Sonos(3), GE Switch(30), GE Dimmer(5), GE Zwave Outlet(3), MimoLight Garage Door(1),Neo Motion(6), Door Sensors(3) Camera(9), Honeywell Thermostat(2), Google Home(4), Alexa(4), Google Chrome Cast(5)  - Driven via ALTUI

Offline amg0

  • Moderator
  • Master Member
  • *****
  • Posts: 3174
  • Karma: +210/-8
Re: TTS Volume not working, unable to set.
« Reply #3 on: December 16, 2018, 03:49:03 pm »
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

Offline kyle.dawson

  • Full Member
  • ***
  • Posts: 153
  • Karma: +1/-1
Re: TTS Volume not working, unable to set.
« Reply #4 on: December 16, 2018, 05:54:54 pm »
Duh, sorry for that.  I am good now.
VeraPlus(1), Sonos(3), GE Switch(30), GE Dimmer(5), GE Zwave Outlet(3), MimoLight Garage Door(1),Neo Motion(6), Door Sensors(3) Camera(9), Honeywell Thermostat(2), Google Home(4), Alexa(4), Google Chrome Cast(5)  - Driven via ALTUI

Offline kyle.dawson

  • Full Member
  • ***
  • Posts: 153
  • Karma: +1/-1
Re: TTS Volume not working, unable to set.
« Reply #5 on: December 16, 2018, 08:29:00 pm »
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)


VeraPlus(1), Sonos(3), GE Switch(30), GE Dimmer(5), GE Zwave Outlet(3), MimoLight Garage Door(1),Neo Motion(6), Door Sensors(3) Camera(9), Honeywell Thermostat(2), Google Home(4), Alexa(4), Google Chrome Cast(5)  - Driven via ALTUI

Offline amg0

  • Moderator
  • Master Member
  • *****
  • Posts: 3174
  • Karma: +210/-8
Re: TTS Volume not working, unable to set.
« Reply #6 on: December 17, 2018, 02:59:28 am »
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)

Typically a call action url like this :
Code: [Select]
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:
Code: [Select]
{ "u:GetVolumeResponse": { "LastVolume": "7" } }
it also works with luup call_action
Code: [Select]
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
Code: [Select]
{LastVolume = "7"}
cf screen shot.