What I'm trying to do is have my Sonos speak something if a contact sensor is triggered when my Hubitat is armed at night. I have this working but I'm unhappy with the lack of control of the volume.
In Rule machine I under "Audio Notifications" you can set the Sonos to do TTS.
Under "On this Speech Device" you can do TTS, but it makes the Sonos talk at whatever the volume level it was previously set on. Most of my rooms I would want to play this message has the volume set very low - so you wouldn't hear anything - or it wouldn't wake you up.
Under "on this music device" you can do TTS and actually set the volume level.
This is better but not great. If you have music playing at 15% volume and then do a TTS @ 60% volume, the music you were playing comes right back to 60% volume when the TTS is finished.
Also annoyingly the TTS Alert also becomes the last thing on the Sonos play list, so if you walk up to the Sonos and hit the play button it's not turning on your last radio station, it's playing that alert.
I didn't purchase the Sonos for this purpose, I already had it. I had looked at working with Amazon Echos, but the auth key is too much maintenance for me.. The Amazon device is awesome but I really dont like the thought of people listening in on me.
Maybe I should scrap the Sonos idea and use something else?
In a lot of our announcement rules where I have it at a loud volume. I also have it to lower the volume back down to 25%, about ten seconds after the announcement. A normal low volume to start with next time the speaker gets used. I also have it announce that it's resetting the volume to 25%.
I created three rules specific to alerts based on destination. One is for my mobile, one is for the whole house and one is just for the kitchen (see below):
The first line takes the current level of the Sonos and stores that into variable.
The second line speaks the text from variable (that variable is populated from whichever rule has fired).
The third line delay's the rule to make sure the message has finished.
The forth line resets the volume back to a pre-alert setting.
The fifth makes sure the Kitchen Sonos joins back into the group (only if you are running the API).
I'm running into a problem when i try playing any TTS on my sonos its not working. it stops playing what it was playing and I see on the App that it tries playing text but nothing is coming out of the speaker. I have multiple speakers. I had no problem with SmartThings before. I'm trying to create some custom TTS but before even going that RM isn't working I'm seeking issue with communication between hubitat and sonos. Thank you for any help