el TTS de google dejó de funcionar hace bastantes meses por restricciones en su API
modificaron el VD para hacerlo funcionar con voicerss.org, yo uso el VD que te adjunto, que le puse tambien unos botones para los playlist.
para hacer funcionar TTS tienes que registrarte en voicerss.org, sirve la cuenta gratis, te dará un código de api, ese codigo lo tienes que poner en el código del boton PROCESS, en esta linea
voiceRssApiKey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
sustituye las x por tu código.
Para hacer funcionar las playlist modifica
RINCON_XXXXXXXXXXXXX1400
por el de tu sonos, que puedes verlo en
http://SONOS_IP:1400/status/upnpPara lanzar un TTS desde una escena, usa este código. La variable message es el texto que se escuchará por el sonos. También modifica valor de volumen a tu gusto.
-- 408 is the Virtual Device ID
-- 28 is the Process button ID
local sid, bid = 408, 28
-- Create TTS params object
local params = {
-- TTS Message
message = "esto es una prueba",
duration = 'auto', -- Duration: "auto", xx seconds
language = "es-es", -- Language: es-es
volume = 5 -- Volume
}
local _f = fibaro
local _x ={root="x_sonos_object",load=function(b)local c=_f:getGlobalValue(b.root)if string.len(c)>0 then local d=json.decode(c)if d and type(d)=="table"then return d else _f:debug("Unable to process data, check variable")end else _f:debug("No data found!")end end,set=function(b,e,d)local f=b:load()if f[e]then for g,h in pairs(d)do f[e][g]=h end else f[e]=d end;_f:setGlobal(b.root,json.encode(f))end,get=function(b,e)local f=b:load()if f and type(f)=="table"then for g,h in pairs(f)do if tostring(g)==tostring(e or"")then return h end end end;return nil end}
-- Make a request to the remote to process params object instantly
_x:set(tostring(sid), { tts = params })
_f:call(sid, "pressButton", bid)
fibaro:debug("ON")