[RELEASE] cast-web v1.2.1 - Chromecast Integration (EDGE Driver discussion begins in post 1668)

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.

Something like this does work:

http://s3.amazonaws.com/smartapp-media/sonos/bell1.mp3

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?..

Thanks for the tip. I’ll give it a shot.

Yes something like Apache on a Pi would 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.

  1. Start by creating a Basic pCloud account, making sure to verify your registration email address.
  2. Upload the file that you want to use as a preset audio notification.
  3. 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.
  4. 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.
  5. 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)
  6. 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.
  7. 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.
  8. 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.
  9. Take the direct URL you copied from the dev window and assign it to the preset in the Google Cast Manager.
  10. Create the ST routine

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.

Thanks again!

Tom

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:

  1. 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)
  2. 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

Nooice. :+1: Wish I had known of gdirect.link before.

Here is the full setup. You will need to make some changes.

Needed to cast Smartthings’s custom notifications/announcements to Google Home devices:

  • Cast-Web-API - cast-web

  • Austin’s Google Cast Manager - Edge drivers for google home devices

  • Pushover - Used to push Smartthings state change notifications from Sharptools to Tasker

  • Sharptools - Rule manager for Smartthings devices and Pushover

  • Google drive - Storing mp3 file for use in Tasker

  • Gdirect.link OR Direct Download Link Generator app

https://www.gdirect.link/ https://play.google.com/store/apps/details?id=io.kodular.ertweetj14.DirectDownloadLink

  • Tasker - Profile and task to receive Smartthings state changes and cast mp3 file to Google Home devices

Steps:

  1. Download and install Cast-Web-API (I used the Windows install).

  2. Following Austin’s instruction from this page to add google devices: [RELEASE] cast-web v1.2.1 - Chromecast Integration (EDGE Driver discussion begins in post 1668) - #1695 by montyfert

  3. 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)

  4. 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).

  5. 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).

Pushover context variable for the Lock State:

{“thing”:“{{$context.event.deviceName}}”,“attribute”:“{{$context.event.attribute}}”,“state”:“{{$context.event.value}}”,“method”:“{{$context.event.data.method}}”,“codename”:“{{$context.event.data.codeName}}”,“codeid”:“{{$context.event.data.codeId}}”}

Pushover context variable for the Door/Switch State:

{“thing”:“{{$context.event.deviceName}}”,“door”:“{{$context.event.value}}”}

Credit: Jake_Mohl

Tasker setup to start casting announcement

  1. 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.

https://taskernet.com/shares/?user=AS35m8l3i8fuHeG1YCq4Fd5pFLFJRG18%2FL%2F003q0gWPE6AuYYyldVhdzoRqQmQrNSX%2F%2F&id=Profile%3ALock+state+unlocked+example

Tasker setup to stop casting announcement

  1. 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

https://taskernet.com/shares/?user=AS35m8l3i8fuHeG1YCq4Fd5pFLFJRG18%2FL%2F003q0gWPE6AuYYyldVhdzoRqQmQrNSX%2F%2F&id=Task%3ALock+state+locked+task+example

*** 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

Graphical user interface, application Description automatically generated|228.0x299.0 Graphical user interface, application Description automatically generated|322.0x297.0

2 Likes

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.

:

Already answered in post #1710

1 Like

Sorry to be a pain. I had a space between preset and the number. Sorry

Nah, you’re fine. We’re here to help each other. :slightly_smiling_face:
I’ve edited my post so it won’t confuse anyone else.

Key and Peele?! :rofl:

lol yeah :sunglasses: