Yes, SharpTools can do audio announcements. TTS is a bit more tricky due to the changes made to the websocket DTH.
SharpTools has access to all of the methods that the new Sonos Websocket DTH exposes including playTrack() and related commands. The playText() method which performed text-to-speech with the previous Sonos DTH is no longer available in the Sonos Websocket DTH.
So there’s not a built-in TTS method directly on the driver anymore, but you can play any file that’s hosted on the web.
So one approach is to use a service like fromtexttospeech.com and then use the resulting file in the playTrack() method.
Enter in your desired phrase and tap Create Audio File
(For testing purposes) Right-click the link of the resulting file and choose ‘Copy link address’
Note: I have no idea how long they keep the files hosted for you, so you’re probably better off downloading the file and storing it on Dropbox, Google Drive, etc. and then using a link directly to your stored copy of the file.
Create the Rule
(Assuming you already have your Sonos authorized in SharpTools)
Choose your Sonos device and select the playTrack() command
Enter the URL to your TTS file in the first string argument
Optionally: enter a target volume level for the number argument
(or switch the ‘Advanced’ toggle on in the top-right corner and delete the number argument)
Note: In most cases, you’ll want to have some sort of Trigger defined in the rule otherwise the rule will never run.
thank God I was using 3rd party device handlers for Sonos speakers (media renderer) and my TTS automation did not break.
but this is really very bad planned update by Samsung.
anyway, is there any good in this update ? (I mean apart from local execution)
Hi all: A question re: the original subject of this thread. There now appears to be 3 separate DTHs for Sonos. Which one am I supposed to use? And are any of them actually going to go away as was originally implied in the thread?
I added my SONOS to ST via the New ST app at the end of November '19 and it used the “LAN Sonos Player”. I had not realized there were others until I found this thread looking to see if I can control the Sonos Station/Favorite directly from webCoRE…alas so far it seems no, and I am stuck with managing an unwieldy IFTTT setup. Awkward and clunky but it works.
The other 2 are:
LAN Sonos Player websocket - which is supposed to be the new one but has very little “capability”
Sonos Player - which seems have to have the same as LAN Sonos Player but I did not compare every line item.
Also all three of them show Execution Location = Cloud. Someone had showed the LAN Sonos Player Websocket as being Local but it did not change for me when I installed the DTH…but I did lose some functionality I had set up in IFTTT so I went back to the one installed by default with the new ST App.
BTW I have a Sonos Play 3 that is a couple or 3 years old. It is still considered a “new” device according to Sonos’ recent announcements about not supporting some of their older speakers.
BTW 2 - I did have an Announcement working with appropriate volume control using LAN Sonos Player but I turned it off as I figured it would be too spooky and annoying with our guests coming and going all the time. I know who comes in based on the code entered on the lock. We run a small B&B.
You should use LAN Sonos Player websocket. That is the latest DH and it runs locally. Indeed, if you have added your device really in November 2019, then that should have been assigned directly.
What do you mean “very little capacity”? If you mean that you cannot control it through WebCoRe, than you need to reach out to the WebCoRe Minions. As far as I know they haven’t implemented the new capabilities what has came with the new DH. For sure, @joshua_lyon has implemented integration in the Sharptools.io rule engine for the new capabilities of the new DH. You can control you Sonos Favourite presets etc.
The new DH has full control over the Sonos, volume/mute, play/stop/pause, next/previous song and preset selection, and media details too. It is far more better than the Sonos app, what allows you to control the device only on the same network. The DH allows you full control from anywhere. But all works in the new OneApp, the one with the “Snowflake” icon.
I have only one Sonos, so I cannot tell exactly. But the DH has group attributes too. So you can use groups I think. Actually the last announcement in the new app talks about group announcements on multiple speakers. And I think I saw something on the Google Play description about the last update, which mentions grouping speakers.
I mean full control, as starting music from within the SmartThings app, not being on the same network as the Sonos. The Sonos app is limited to LAN control as far as I know. You can start the last played tracks/album or start any of your My Sonos Favourite presets, basically anything what has been added there in the Sonos app. Like Spotify albums, tracks, playlist, or TuneIn radio stations. And that is what the Sharptools.io can utilize too. Check their video in the other post.
So still being new to this I could be not understanding what I see. So here is the screen shots from the 3 different DTHs. And yes I did install the Sonos in my ST hub (Nvidia Shield) at the end of November. I had never used the hub before and had just bought a few wi-fi lights to try it out. And ST picked LAN Sonos Player as the DTH. I had never looked at the details in IDE until I read this thread and switched to the Websockets version.
I have virtual switches defined in ST connected via IFTTT to tun on a Favorite in Sonos. Then I wrote a simple piston to make sure that only the last pressed Station switch was “on”. It just turns the others off. I display and control this also in ActionTiles.
As I mentioned I would prefer to set the Station/Favorite directly from webCoRE which is how I found this thread. So I don’t know if that is a missing webCoRE capability or if the Device Handlers cannot provide that capability.
When I switched to the Websockets DTH, my switches via ActionTiles immediately stopped working. I changed the DTH back to the original LAN Sonos Player and all was good again. I never considered if I should have deleted the Sonos and re-added it and then updated all my IFTTT/webCoRE/Action tiles after changing the DTH.
And that is when I noticed that the Current State data for the Websocket version was significantly less than the others. Whih lead to my assumption of “less capable” for the new DTH.
Either way I want to make sure that I use the correct DTH and wonder why the other 2 are still available and what are the difference between them all. Some “release Notes” would be helpful if there is something like that I can read.
Thanks for the help in understanding all this.
LAN Sonos Player:
Shows Execution Location = Cloud
I would try deleting the device and then let SmartThings rediscover it.
The new device handler has local execution capability and has a few more features and functionality than the old DTH. (One exception being that the playText()/speak() commands were dropped so you would need an alternative approach for TTS)
As @GSzabados mentioned, SharpTools.io has full support for the new DTH, including Album art and activating the presets (via rules). We’ve seen some pretty cool usage of the new DTH for doing things like creating jukebox dashboards:
Thanks @joshua_lyon but this is most definitely not what I see when I look in IDE. I deleted the device and added it back in using the new ST app and it chose LAN Sonos player. So I deleted and tried with ST Classic and got the same thing. I tried adding a deice via IDE but there appears to be no device discovery so I tried using the same Network ID and that did not work either.
So at the moment, I can only add it using the ST new app and then change the DTH to the Websocket version. But then all I see for data is what I posted. Nothing anywhere near what you can see.
I am using ActionTiles at the moment but I am voting for a little consistency. I don’t want to have to purchase SharpTools when the ability should be in webCoRE and I realize webCoRE is not an official ST platform but they seem to be very well “connected” for lack of a better word.
So now depending on what I want to do, I have to either implement capability in ST Native, or maybe IFTTT or maybe webCoRE or maybe ActionTools.
And the less I have to use my SmartPhone the better. It is fine for adding the odd device and doing a quick “somethingOrOther”, but it is not a tool to develop with or to be the primary control device especially when tools like SharpTools or ActionTiles are available.
@joshua_lyon, as @Michael_Edmonds mentioned that he has an Nvidia Shield, I have some doubts that would it run locally. The Nvidia Shield hasn’t received Firmware update for ages. It might have missing something for local execution, but I am just guessing.
@Michael_Edmonds, the LAN Sonos and Sonos Player should utilize the mediaPlayer capability what is supported by WebCoRe, the new web socket version uses Media Playback and many other.
Actually I’ve found the post what you need. And it gives a hint why your setup used the LAN Sonos instead of the web socket one.
Thanks @GSzabados. I had read this post but did not clue in to the HubCoreVersion. My shield is still running 0.20.12. and the post stated the Hubs V2/V3 need 0.27.x
Which would explain why it keeps selecting the old DTH. BUT… should I not be able to select the new DTH in IDE and all be good? Or is my Hub firmware version simply incompatible with the new DTH regardless?
Guess I need to bug ST about getting the Shield updated. (not holding my breath.)
Hi @Michael_Edmonds: You’ll want to keep your Sonos speakers on the LAN Sonos Player DTH, which is what is set initially during discovery on Nvidia Shields. Only hubs running firmware >= 0.27.x can make use of the local WebSocket version, and unfortunately the Shield is still on 0.20.x.