I’m pretty sure the cast-web application will only work with internet-accessible URLs for the media. I’ve tried configuring a local LAN URL once but it didn’t work.
If there is some website where you could post your mp3 files, perhaps you could do what you want to do. I don’t know if something like Google Drive could work?..
Anyone able to get this working using an old Android device as the server? Have tried the instructions but the Node JS wont install due to write access. All permissions have been allowed and using the downloads folder as the path location.
I went to a “text to speech” website and created a MP3 that says" Fire, Fire, leave immediately and repeats about 10 times. Then I went to Google drive, uploaded the MP3, created an URL and entered it into Preset 1 URL. I wanted that to play on all the Google speakers throughout the house if a Smart smoke alarm is activated with Smartthings.
I started a routine but all I see is “play message on speaker”. Is there a way to play that URL to play on Google speakers with a Smartthings routine?
@TomWilliams1950
I may have found a solution, but I don’t know how permanent it is because I have not tested it long term.
The following are instructions for using the pCloud file hosting website as your http web server. I think that pCloud is the best choice because their account inactivty period is 6 months - the longest I’ve found so far. Source: https://www.pcloud.com/help/general-help-center/how-long-will-my-account-stay-active-if-i-am-not-performing-any-operations
Keep in mind that pCloud charges a monthly fee for sharing files publicly for the purpose of having a static, direct access http address to your files, also known as their Public Folder. Source: https://www.pcloud.com/help/general-help-center/what-is-the-public-folder
However, these steps should circumvent the paywall and give you a free, direct access URL to your audio file.
Start by creating a Basic pCloud account, making sure to verify your registration email address.
Upload the file that you want to use as a preset audio notification.
After the file has been uploaded, find it in your account files. To the right of the filename, there will be a “Share” button - click it and you will then see the shareable https URL.
Copy and paste the shareable URL into your web browser. For my example, I am using Chrome but the method is relatively the same among other browsers.
Now press Ctrl+Shift+L in the browser window with the link you copied and pasted. This will open the ‘inspect page’ or ‘developer options’ of the browser allowing you to see what’s behind the curtain. (Wizard of Oz reference)
Now in the dev window that opened, click on the Network tab - for Chrome, it’s between the Sources and Performance tabs. If you’re using Firefox, the Network tab is between Debugger and Style Editor.
Next find and click on the Media tab. For Chrome, it’s between Img and Font. For Firefox, it’s the tab between Images and WS.
Refresh the page (Ctrl+R), click the replay button in the main window and the direct link to your audio file will be listed in the dev window waterfall. Find the URL ending in .mp3 and copy it (right click → Copy → Copy link address). I’ve noticed that the URL is different dependant on browser but both will work.
Take the direct URL you copied from the dev window and assign it to the preset in the Google Cast Manager.
Be careful with the amount of traffic used by your link, they keep track of its data usage. There is a ‘Link Stats’ option to view total traffic in the ‘Share’ window of the file. Let me know if you get stuck along the way and I can post a few screenshots as guidance.
Thanks. I had everything set up in Google drive. It was very similar to your instructions for pcloud. In setting up the routine, I was using the notify someone instead of selecting the speaker and selecting playback. It now works perfectly.
Interesting. I tried Google Drive but didn’t see an http address that would fit in the Preset URL field - they were being truncated because the link exceeded the preset character limit. Glad you found a way that worked.
My mistake. I thought I had it because the url had the mp3 in it. I had the one from pcloud set as the preset and thought it was the one from google drive.
@swdeason had shared with me this info, which might also address what you wanted to do:
Create your own custom Smartthings announcement and save mp3 file to your Google drive. Make sure to change the general access share properties for this file to “Anyone with the link” and then copy the link (keep link to be used later for Google Drive Direct Download Link Generator)
Go to https://www.gdirect.link/ or open Download Link Generator app and copy your Google drive share link into the “Put Google Drive share link here”, click “Get Link Download”, and copy this generated link
I haven’t tried it myself, but if you have a valid URL for the mp3 file, then you should be able to configure a preset in the Chromecast Manager settings, which you can then use in automations.
Example:
Preset 1 Title: Intruder Alert
Preset 1 URL: http://xxxxxxxx/xxx/myalert.mp3
Preset 1 Media type: audio/mp3
Preset 1 Stream type: LIVE
Create your own custom Smartthings announcement and save mp3 file to your Google drive. Make sure to change the general access share properties for this file to “Anyone with the link” and then copy the link (keep link to be used later for Google Drive Direct Download Link Generator)
Go to https://www.gdirect.link/ or open Download Link Generator app and copy your Google drive share link into the “Put Google Drive share link here”, click “Get Link Download”, and copy this generated link (keep link to be used later for Tasker).
Go to your Sharptools dashboard and resync your Smartthings account with Sharptools. Your new Google Home devices should show now on Sharptools dashboard. From here create your Sharptools rule engine, so Sharptools can be the “middleman” between Smartthings and Tasker. You will be creating a switch, door, lock, etc rule so when the state changes (trigger) for the Smartthings device, Sharptools send a push notification from Pushover to Tasker (flow).
Open Tasker and enter the below info into your 1st Tasker profile and task. The “Front door lock left unlocked” Tasker profile is setup to flow when Tasker receives the Pushover notification called “Door state, confirm the “pushovermessage.state” condition is “unlocked”, wait 8 mins, and then send your Google shared drive mp3 file to your Google device.
Open Tasker and enter the below info into your 2nd Tasker profile and task. The “Front door lock locked” Tasker profile is setup to flow when Tasker receives the Pushover notification called "Door state”, confirm the “pushovermessage.state” condition is "locked, and then STOP the “Front door lock left unlocked” profile
*** You can create different Sharptool’s state rules for your switches/locks/sensor/or doors; so you can push the state notifications to Tasker for switches/locks/sensors/or doors Google home custom announcements.
Credit: Jake_Mohl for Tasker/Sharptools switches/locks/sensors/doors state profile
Not sure what I’m doing wrong but when I paste the link from google drive, the generated url link doesn’t have the file name at the end. it ends with “view?usp=sharing”.
The link doesn’t need to end in the file’s extension for it to work as a preset. I just tested a direct URL provided by gdirect.link and it played fine. Make sure to change the file’s share permissions role from viewer to editor before using gdirect.link.
I copied the url to preset 3 and named it “test”. I can go to a specific Google speaker and click on the star to Play a favorite and select “test”. it plays perfectly.
I created a routine that is triggered by a virtual switch to play “Test” on a specific speaker. I entered
preset 3, preset #3, Test but the mp3 won’t play. Could some one share a screen shot of a routine.