TTS interface (text to speech)

Any idea on what could cause it to not complete the words listed in the rule? I tried this on a sonos one as well?

Edit, I turned off the "Stop after TTS Complete" toggle on the driver page, it appears to complete it now.

1 Like

Is there any documentation around which of the SSML tags work with Hubitat and which ones don't? I am tyring to use some of them and they don't seem to be working but other seem to work fine. For example, the <break time="3s"/> works fine but <say-as interpret-as=”ordinal”> does not. The REAL problem I'm running into is that logging does absolutely no good in trying to figure out if these are working correctly or being stripped out. This phrase: This is <break time="3s"/> a test of TTS. on a log, looks like this: This_is__a_test_of_TTS. (substituted underscores for spaces since discourse won't allow you to put two spaces next to each other). It's really a bit of a bugger to figure out.

Any of the embedded tags that poly supports should work.
We don't perform any filtering.


I figured out the problem for some reason the quote marks I copied from one reference source for Amazon Polly did not come through as regular double quotes. It wasn't until I typed it by hand that it worked correctly. The one that didn't work was:
<say-as interpret-as=”ordinal”>52</say-as>
And the one that worked was:
<say-as interpret-as="ordinal">52</say-as>

Very, VERY subbtle difference. It wasn't until I put them side-by-side that I got it to work. Sorry for the confusion.


ahhh yes.. The “pretty” quotes don’t work for code.. That used to drive me bananas when I wasn’t using an ide and copying and pasting..

It's almost impossible to see unless you put them into the right font and right next to each other. I've never run into this before so it wasn't anything I've had to look for. Only spun my wheels on that for half a day. UGH! :angry: lol

1 Like

been there.. Cursing why isn’t this #%*%# code working.. Now I use an IDE that has built-in github integration and supports all the languages I need..

And doesn’t do the pretty quotes

Well, this was typing into the edit device no other real option than Chrome. Not like I was writing code. :slight_smile:

1 Like

Just come over from ST and loving HE. Local execution rules! I am using TTS with RM, passing the text in a string using a custom command and it works well. I am trying to embed a SSML pause as shown above in my TTS but as I save it drops out the command. Is there special syntax? can I use a local variable and concatenate it in? BTW, I have been successful with using a variable to add text, but not with SSML in it

For example, my TTS string is “this is a test” %variable%” and it works if %variable% is text string but I can’t pass “” as it will not save into the variable string.

Any help would be appreciated or a simple nope won’t work, SSML is only for use in code is good as well.

If anyone knows how to do this in RM, @bravenel would know.

You can put "" in a variable:

What you want to do is to get the entire string into a variable, and then use the variable in the speech action. Please show the actual string you want to use.


@bravenel or @mike.maxwell:
Is there any way to query what the current Hubitat system setting is set for the TTS Language? The reasoning behind this is I want to determine what the "native" language for a user is so my driver can query API's with the actual user's language in mind instead of always just getting them US-English data. The TTS Language is more likely to be correct and I was hoping to avoid having another preference for them to have to select (likely I would just leave them stuck with English).

I searched the documentation and forum but did not find any method for that. I did find the getTTSVoices() but that just returns the entire list of possibilities.

There isn't, but we can add one.

1 Like

Do you want me to add a topic in the "Feature Request" section for it? I think it would be handy to have, but I cannot say it is high-priority (at least for me).

@mike.maxwell old thread from 4 years ago, but did we get a solution to determine the current HE setting for TTS language?

Pretty simple really, should be out in 2.4.0 getTTSVoice()

1 Like

:frowning: Nope. It isn't included.

I also did a method scan and only see the getTTSVoices() method and see nothing that resembles other TTS thingys.

def listAllMethods() {
    def methods = []    
    this.metaClass.methods.each { method ->
        methods <<
    methods.unique().sort().each { method ->
        log.debug "Method: ${method}"

Well, since 2.4.0 has not yet even been released in Beta, it makes sense that you're not going to see Mike's new getTTSVoice() function yet... :wink:


Good grief. Didn't put that together. Thank you. :slight_smile:

1 Like