We have moved at community.getvera.com

Author Topic: (Solved) SAY function only work from advance tab, but no more from LUA  (Read 1061 times)

Offline peterluc8080

  • Full Member
  • ***
  • Posts: 124
  • Karma: +4/-2
Hi all,

A while ago, I created several dynamic messages for my 5 sonos in the LUA tab of a scene and everything was working. But, now, when I activate the scene, I don't get any sound in any of my Sonos.

BUT, if I go in the advance tab of a scene and add the say function there, I'm able to hear the message.

I didn't change anything in my LUA scenes for my several sonos and now all my 35 scenes for voice with Sonos doesn't work....

Here is an exemple of one :

url = require("socket.url")

local AV_DEV = 47
local LS_SID = "urn:micasaverde-com:serviceId:Sonos1"
local SONG_SID = "urn:upnp-org:serviceId:AVTransport"
local titleSong = luup.variable_get(SONG_SID,"CurrentTitle", 59)
local artistSong = luup.variable_get(SONG_SID,"CurrentArtist", 59)
local sayLang = "fr"
local sayVolume = 40
 
luup.call_action(LS_SID, "Say", {Text = string.format("La chanson en cours est %s. de %s.", titleSong. artistSong , Language=sayLang, Volume=sayVolume}, AV_DEV)
luup.call_action(MN_SID, "Play", {},AV_DEV)
« Last Edit: December 21, 2014, 02:27:59 pm by lolodomo »

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: SAY function only work from advance tab, but no more from LUA
« Reply #1 on: December 04, 2014, 08:06:43 am »
What's the reason of your final call ? luup.call_action(MN_SID, "Play", {},AV_DEV)
There is a possibility that it breaks the previous TTS.

Offline peterluc8080

  • Full Member
  • ***
  • Posts: 124
  • Karma: +4/-2
Re: SAY function only work from advance tab, but no more from LUA
« Reply #2 on: December 05, 2014, 08:12:26 am »
I had this line for all my TTS and everything was ok with this line so I leave it. I try to remove it, reload several times, try the scene, but still not working

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: SAY function only work from advance tab, but no more from LUA
« Reply #3 on: December 05, 2014, 01:09:45 pm »
The string.format is not closed + you put a . rather than a , between the two parameters.
You should have an error in your logs.

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: SAY function only work from advance tab, but no more from LUA
« Reply #4 on: December 10, 2014, 04:48:13 am »
You should get a better result with that code line:

Code: [Select]
luup.call_action(LS_SID, "Say", {Text = string.format("La chanson en cours est %s. de %s.", titleSong, artistSong) , Language=sayLang, Volume=sayVolume}, AV_DEV)

Offline peterluc8080

  • Full Member
  • ***
  • Posts: 124
  • Karma: +4/-2
Re: SAY function only work from advance tab, but no more from LUA
« Reply #5 on: December 21, 2014, 01:35:02 pm »
By fixing this error, all my say scene are working now. Thanks!