ALTSonos Group ID changes overtime.

I have started to use the ALTSonos plugin to run TTS over my sonos. Announcements, etc But one flaw I have seen is that you must play the sound/TTS over a Group ID. The problem lies in that the group ID will change over time and there is not way via Luup code to retrieve it. When ever I pair speakers via a group, in the Sonos App, the Group ID number will change. Or if I create a

local ALTUI_DEVICE_NO = 850
local ALTUI_DEVICE_SID = “urn:upnp-org:serviceId:altui1”
local ALTSONOS_DEVICE_NO = 879
local ALTSONOS_DEVICE_SID = “urn:upnp-org:serviceId:altsonos1”
local GROUP_ID_KITCHEN = “RINCON_B8******:725

–Set Volume and Make announcement
luup.call_action(ALTSONOS_DEVICE_SID, “SetVolumeRelative”, { groupID = GROUP_ID_KITCHEN, volumeDelta = DIFFERANCE_VOLUME} , ALTSONOS_DEVICE_NO)
luup.call_action(ALTUI_DEVICE_SID, “SayTTS”, {newMessage = EVENT_MESSAGE, newVolume = EVENT_VOLUME, newGroupDevices = GROUP_ID_KITCHEN}, ALTUI_DEVICE_NO)

  1. Is there a way to have TTS over a “Player ID”? New Action?
    luup.call_action(ALTUI_DEVICE_SID, “SayTTS”, {newMessage = EVENT_MESSAGE, newVolume = EVENT_VOLUME, newPlayerName = “Kitchen”}, ALTUI_DEVICE_NO)
  2. Is it possible to get Group ID via new action based on Friendly name? New Action?
    resultCode, resultString, job, returnArguments = luup.call_action(ALTSONOS_DEVICE_SID, “GetGroupID”, { playerName= “Kitchen”} , ALTSONOS_DEVICE_NO)

With the Group ID changing, it will be impossible to really use Sonos, unless I am missing something.

[quote=“kyle.dawson, post:1, topic:200315”]I have started to use the ALTSonos plugin to run TTS over my sonos. Announcements, etc But one flaw I have seen is that you must play the sound/TTS over a Group ID. The problem lies in that the group ID will change over time and there is not way via Luup code to retrieve it. When ever I pair speakers via a group, in the Sonos App, the Group ID number will change. Or if I create a

local ALTUI_DEVICE_NO = 850
local ALTUI_DEVICE_SID = “urn:upnp-org:serviceId:altui1”
local ALTSONOS_DEVICE_NO = 879
local ALTSONOS_DEVICE_SID = “urn:upnp-org:serviceId:altsonos1”
local GROUP_ID_KITCHEN = “RINCON_B8******:725

–Set Volume and Make announcement
luup.call_action(ALTSONOS_DEVICE_SID, “SetVolumeRelative”, { groupID = GROUP_ID_KITCHEN, volumeDelta = DIFFERANCE_VOLUME} , ALTSONOS_DEVICE_NO)
luup.call_action(ALTUI_DEVICE_SID, “SayTTS”, {newMessage = EVENT_MESSAGE, newVolume = EVENT_VOLUME, newGroupDevices = GROUP_ID_KITCHEN}, ALTUI_DEVICE_NO)

  1. Is there a way to have TTS over a “Player ID”? New Action?
    luup.call_action(ALTUI_DEVICE_SID, “SayTTS”, {newMessage = EVENT_MESSAGE, newVolume = EVENT_VOLUME, newPlayerName = “Kitchen”}, ALTUI_DEVICE_NO)
  2. Is it possible to get Group ID via new action based on Friendly name? New Action?
    resultCode, resultString, job, returnArguments = luup.call_action(ALTSONOS_DEVICE_SID, “GetGroupID”, { playerName= “Kitchen”} , ALTSONOS_DEVICE_NO)

With the Group ID changing, it will be impossible to really use Sonos, unless I am missing something.[/quote]

v 0.12 includes a change that enables you to pass a playerID instead of a groupID; the action will affect the group currently owning that player. please note the UPNP parameter name change

I uploaded new version and reloaded LUUP engine. But getting failure now:

08 12/28/18 13:16:00.141 JobHandler_LuaUPnP::HandleActionRequest device: 879 service: urn:upnp-org:serviceId:altsonos1 action: AudioClip <0x778eb320>
08 12/28/18 13:16:00.141 JobHandler_LuaUPnP::HandleActionRequest argument Duration=4 <0x778eb320>
08 12/28/18 13:16:00.141 JobHandler_LuaUPnP::HandleActionRequest argument groupID=RINCON_B8######### <0x778eb320>
08 12/28/18 13:16:00.142 JobHandler_LuaUPnP::HandleActionRequest argument urlClip=http://192.168.1.120/altui-sonos.mp3 <0x778eb320>
04 12/28/18 13:16:00.143 <0x778eb320>
01 12/28/18 13:16:00.144 LuaInterface::CallFunction_Job device 879 function SALTSonos_altsonos1_AudioClip_job failed [string “-- // This program is free software: you ca…”]:855: bad argument #3 to ‘format’ (string expected, got nil) <0x778eb320>
01 12/28/18 13:16:00.144 Lua_Job::Run job#189 : dev:879 (0x19c77a0) P:50 S:0 Id: 189 failed <0x778eb320>

I get same error if I use the Action from ALTUI SayTTS or if I use my own luup code. It creates the MP3, but when it looks to run the AudioClip, it fails. When I try the AudioClip from the ALTSonos Action directly, it works. I think you updated the parms in ALTSonos but in ALTUI, does not pass new name? groupID_playerID

I updated local copy L_ALTUI.lua and seems to works now.

local params = {urlClip=uri, Duration=estDuration}
if (groupDevices ~= “”) then
params[“groupID_playerID”]= groupDevices
else
params[“groupID_playerID”]= “ALL”
end

[quote=“kyle.dawson, post:3, topic:200315”]I uploaded new version and reloaded LUUP engine. But getting failure now:

08 12/28/18 13:16:00.141 JobHandler_LuaUPnP::HandleActionRequest device: 879 service: urn:upnp-org:serviceId:altsonos1 action: AudioClip <0x778eb320>
08 12/28/18 13:16:00.141 JobHandler_LuaUPnP::HandleActionRequest argument Duration=4 <0x778eb320>
08 12/28/18 13:16:00.141 JobHandler_LuaUPnP::HandleActionRequest argument groupID=RINCON_B8######### <0x778eb320>
08 12/28/18 13:16:00.142 JobHandler_LuaUPnP::HandleActionRequest argument urlClip=http://192.168.1.120/altui-sonos.mp3 <0x778eb320>
04 12/28/18 13:16:00.143 <0x778eb320>
01 12/28/18 13:16:00.144 LuaInterface::CallFunction_Job device 879 function SALTSonos_altsonos1_AudioClip_job failed [string “-- // This program is free software: you ca…”]:855: bad argument #3 to ‘format’ (string expected, got nil) <0x778eb320>
01 12/28/18 13:16:00.144 Lua_Job::Run job#189 : dev:879 (0x19c77a0) P:50 S:0 Id: 189 failed <0x778eb320>

I get same error if I use the Action from ALTUI SayTTS or if I use my own luup code. It creates the MP3, but when it looks to run the AudioClip, it fails. When I try the AudioClip from the ALTSonos Action directly, it works. I think you updated the parms in ALTSonos but in ALTUI, does not pass new name? groupID_playerID

I updated local copy L_ALTUI.lua and seems to works now.

local params = {urlClip=uri, Duration=estDuration}
if (groupDevices ~= “”) then
params[“groupID_playerID”]= groupDevices
else
params[“groupID_playerID”]= “ALL”
end[/quote]

yes I also updated ALTUI.

please note these ALTSONOS evolutions:
v 0.12 : Ability to pass a playerID in the UPNP api where a groupID is expected. the api will affect the group currently owning the player
v 0.13 : respect Volume parameter in AudioClip UPNP action if specified ( set new volume and restore old one after )

Reloaded and everything working and now able to use player IDs. Thanks for update.