[SOLVED] How to get Alexa to speak variable text?

I am currently trying to create multi room timers for Alexa using the Amazon Echo Control binding.

My problem is how can I get alexa to speak a variable text ?

This would be my text:

val String formattedTimeAboveOneHour = "You got" + totalHours + "hours and" + remainderMins + " Minutes left on your" + durationTimer + "minutes timer"

How can I let alexa speak this variable text using rules DSL?
Someone said he got it working but sadly he did not exactly post how and I think he did it with node red and not with the rules DSL. ([SOLVED] Get Alexa to speak a variable text)

Looking for advice.

regards,
salexes

You should be able to do this…

val formattedTimeAboveOneHour = "You got" + totalHours + "hours and" + remainderMins + " Minutes left on your" + durationTimer + "minutes timer"// don't cast unless you have to... the DSL will be happier when it can figure things out for itself
TTS_Item.postUpdate(formattedTimeAboveOneHour)

In Python, you could do…

formattedTimeAboveOneHour = "You got" + totalHours + "hours and" + remainderMins + " Minutes left on your" + durationTimer + "minutes timer"
events.postUpdate("TTS_Item", formattedTimeAboveOneHour)

Thank you for the quick response.

I just noticed that using:
SalexesEchoDot_Speak.sendCommand(" " + formattedTimeAboveOneHour + " ")
works perfectly.

Should have checked that first. I must have missunderstood the documentation. Sorry for that.

No need for the spaces at the end… this should work…

SalexesEchoDot_Speak.sendCommand(formattedTimeAboveOneHour)

Ah perfect. Thank you for the tipp.

Sorry I didn’t know you wanted a few examples.:neutral_face: Looks like Scott got you pointed in the right direction but I can post a couple of DSL rules if you like.