Using variables in TTS text


I am using the imperihome plugin and as part of scenes. In some cases I am adding sayTTS for the wall mounted tablet. Is there any way in which you can add variables into the text so that the unit can include supplied values in the text ? For example, could you add a variable in the text that would include the current outdoor temperature or something along those lines ? It would be pretty cool if when as part of the voice recognition process, you would select or trigger voice recognition, the tablet would ask you what it could do for you, then you would be able to tell it what to do.

It is possible to use variables but you need to write some Luup code.
Create a scene and select the Luua tab. Here is a sample:

local StatusID114 = luup.variable_get(“urn:upnp-org:serviceId:SwitchPower1”,“Status”, 114)

if (StatusID114 == “1”)

lamp_status = “on”
lamp_status = “off”

status_txt = "Lamp is "… lamp_status

luup.call_action(“urn:imperihome-com:serviceId:ImperiHomeDevice1”, “SayTTS”, {Text = status_txt}, 181)

On the first line, 114 is the device id for one of my switches so I check if it is on and set the variable lamp_status for the “on” TTS message, of not you get the “off” message.

On the last line, 118 is the device id for my ImperiHome plugin.