Sonos TTS

Hey There team,
I have a rule to send a TTS notification when the washing machine is done. Yesterday when I was home - played some music at 20% volume, stopped playing it went about my day.
2hrs later when the washing machine rule fired, the TTS came through at 20% - not 40%. It is just listed as "send http / speak" whatever that one is, I list the text, put it as a music TTS and set the level to 40%. Is that the wrong way, why didnt it come through at the right level ?

1 Like

Where are you doing this? Rule machine? Setting the volume to 40% after the TTS won't change the volume for the TTS. You'd have to change the volume first. Unless the driver has a custom command for both.

when I say "changing the volume after" I mean the TTS RM action is to speak the text, on the sonos, with volume at 40% - kinda useless if its setting the volume AFTER the TTS has spoken.
That cant be how its meant to work?

That's only available if you choose it as a music player instead of a Speech device or a Notification device. I don't know that the command is supported by the driver that you're using. I'm assuming you're using the built-in one? There is no command available to play message at volume. So, the action in RM would have to use two commands, which I highly doubt is what is really gong on. I would try setting the volume first and then use the Sonos as a speech device instead and then you can always set the volume back again if you first capture it either through the capture action or a variable.

It is using the sonos as a music player for the TTS as an option in RM.
Using it as speech device doesnt let you set the volume, only if you choose play on music device.
here is an example,

You have to pick either speech or music. Not both. In this case you want to pick it as a music device. Otherwise, it is going to use it as a speech device will not use the volume control.

Yep - I did write that that was an example pic, I dont have it set to do speech & music for the one notification.
It is set as "the washing cycle has finished" as a music device, at volume 40% (but it spoke at 20% as that was the previous volume I was using it as)...

I kind of feel like ive explained this afew times over, im just saying should it not of set the volume to 40% to do the TTS notification if it says "at this volume" ?

1 Like

Thgat's all I have to go by.

Okay...,I'll stop trying to help you then. But it works fine for me. So, good luck.

Next time I will post a pic of my actual rule - that would give people a better idea of what I have and then explain my issue better. Apologies as im at work and dont have access to it.

Here was the screenshot of that rule, like I said it played the TTS at 20% and not 40% when it fired.

so after all this, I had the TTS level adjust set to "no change" thinking that was the right setting - but it has to be set to "no selection".
But even when I have it set to "no selection" and click save pref - the driver changes the TTS level adjust to +10%... it doesnt sound right, and i tested it - it doesnt increase the TTS by 10% each time. So im at a loss, @mike.maxwell did you have any answers why the driver changes the TTS level adjust when set to "no selection" to 10% even though its not adjusting it by 10% when it fires.

no selection defaults to 10%, one must select no change is that's what you want

If I am playing music at 20%, and have the driver is set to "no change" the TTS comes though at 20%.
Even though the rule is set to make the TTS 40%.

I have the music player tile and im trying to test it off that, but it doesnt seem to be accurate. I'll keep playing with it.

Try setting the volume, then a delay, then the TTS.
The TTS message is probably canceling the volume command on the sonos side.

I have the same exact problem and its driving me crazy (Sonos TTS and Hubitat). For Rule Machine, adding a command to set volume and then playing the TTS message about 1-2 seconds later works just fine.

Problems with this approach:

  1. If music is actively playing on the speaker, it will momentarily raise volume to the music. Annoying and occasionally jarring. To fix this issue, would recommend to send a Pause command before increasing volume.
  2. Need to add a command after the TTS to lower the volume back down to a default, say 30.
  3. Notifications that use TTS cannot be remedied in the same way. These TTS messages will continue to occasionally play at the desired volume or at varying volumes during the message.

Seems to me like the proper fix is to account for this delay via the Sonos Integration App.

Recommended work around in Rule Machine:

  1. If playing, send pause command.
  2. Increase volume for TTS.
  3. 1-2 sec delay.
  4. TTS
  5. Decrease volume to "default"
  6. Resume if previously playing.
1 Like

yeah I gave up.
I have the volume set for the sonos, and if I play music, I just set it back to the default volume that HE uses after that so the notifications come through at the right level.
If the levels set low, the notifications come through low.
And sometimes it stops playing the songs altogether. So ive reserved to the fact its a glorified TTS speaker now which sucks cause it has brillaint sound.

I just bought a few more Sonos speakers with the last of my Qantas frequent flyer points, and now I have a dedicated Sonos notification speaker! I'm not sure our airlines will survive Covid19, so I burned all my FF points.

1 Like

Hey Everyone,

After messing around with it for a couple days, I believe I've figured it out. The solution is not to use Hubitat's default Speaker or Music Player actions. If you use the Speaker command, it will play TTS at the current volume (whatever that may be). If you play TTS via the music player, it will occasionally not play at the desired volume and will stop any music that was in progress.

Sonos has a "Play Text and Restore" command. This is TTS with volume level setting. Music will automatically resume at the previous volume level (if playing). This command requires a "string" parameter (text) and a "number" parameter (volume).

To add to Rule Machine:

  1. Set Mode or Variables, Run Custom Action: Run Custom Action
  2. Music Player
  3. Select your Speaker
  4. Select Custom Command: playTextandRestore
  5. Parameter Type: String
  6. String Value: [text]
  7. Add Another Parameter (need to click outside of text box to enable option)
  8. Parameter Type: Number
  9. Integer Value: [1-100]
  10. Done with this action (need to click outside of text box to enable option)

Your command will look something like this: "playTextAndRestore(Goodmorning, 70) on Kitchen Sonos Speaker".

The only downside is that you cant add a string of random messages or add custom device descriptors like %device% or %time% easily like before. If needed, you can probably come up with some Rule Machine logic to overcome this.


Yikes - thats fairly complicated just for a TTS command.
I re-did my front doorbell setup - so it would look like this ?

** when I use your method - she stunners and says "sa-someone is at the front door"

That looks correct to me. Mine was working nicely for about a week and now occasionally stammers as well with intermittent volume modulation. The command is good, not sure what is causing this. Maybe adding a couple second delay before TTS will help?