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

I have not replaced anything for privacy. This is actuall log captured on my raspeberry pie.

I havenā€™t been tinkering with my ST for a while so Iā€™ve lost touch with cast-web-api for about 4-5 months ever since I broke it when trying (and failing) to update cast-web-api to a newer version (prior to the 1.0.0 version). In any case, if you havenā€™t already found it, Iā€™d suggest to use the Docker image from https://hub.docker.com/r/breadlysm/cast-web-api/. I use Synology and I set the image to auto restart while using the same network as the Docker host. Immediately upon running it, the logs recognized all my various Google devices.

1 Like

Hi friends! Sorry for being a dodo. ; )
Can I kindly get some direction for setting this up on Raspbian? Thank you!!!
I tried to follow the instructions.
When I type ā€œcast-web-apiā€
I get:
-bash: cast-web-api: command not found

Full output:

pi@raspberrypi:~ $ sudo npm install cast-web-api -g
/opt/nodejs/bin/cast-web-api -> /opt/nodejs/lib/node_modules/cast-web-api/bin/cast-web-api

  • cast-web-api@1.0.2
    updated 1 package in 3.426s
    pi@raspberrypi:~ $ cast-web-api
    -bash: cast-web-api: command not found
    pi@raspberrypi:~ $

Hmmmā€¦ looks like the install went through.

Maybe just try:
/opt/nodejs/bin/cast-web-api

Sometimes on raspbian only full path works.

You are awesome, thank you!!!
It seems to see only 4 out of 7 devices but I will see if I can get it to work at all =D
*** never mindā€¦ the smart app itself did see all of my devices upon setup. ; )

1 Like

Is cast-web-api v1.0.2 the latest release?

Sadly it still isā€¦

Iā€™m using this with Webcore. Iā€™m a noob here. Can someone kindly give me an idea how I would pass this an mp3 file stored locally on the raspberry pi I also happen to be running cast-web on? I imagine I have to have some type of http or ftp server running on the pi for a file to be accessible via an URL? Or is there some other way? Thank you!!

Exactly. You need an HTTP server, Iā€™d recommend installing apache/httpd or nginx. Installation should be pretty easy, just google raspberry pi (your raspberry operating system) install apache. This guide should probably cover you. No need to install php, just put your mp3 files into the web server dir (eg. /var/www/html).

You can try it, by opening the http://ip-address/yourfile.mp3 your browser and it should start playing the file.

Now you can either put the mp3 file(s) urls into a preset, or play them through webCoRE.

Worked perfect, thank you so much! I really appreciate this community and people such as yourself for sharing their creations AND supporting them. So awesome, you rock!

1 Like

That advice worked perfectly! This docker worked right away with the default settings on my UnRaid server.

Now, just to figure out if there is a way to remove the cast delay by keeping an always-on cast connection. I have 6 Google Home Miniā€™s set aside specifically for whole house SmartThings alerts.

I really canā€™t thank you enough. Cheers!

Glad to hear it! I will disable my Docker since I really am not well versed in that kind of stuff and to stop messing up people who happen to find it. Cheers!

Iā€™m having fun with this in webcore. Is there any way to know when an audio has actually started playing or close to it? Or any way to implement a ā€œwait for audio to startā€? (outside of webcore if necessary) Iā€™m trying to synchronize the lowering of my projector screen with a popular cinematic intro theme sent to a chromecast audio connected to my av receiver. The theme happens to be the same duration as it takes my screen to lower. Itā€™s really awesome. =D BUTā€¦ the issue is that once the cast request is sent it is really hit or miss as to how long it takes until the audio to start playing. Sometimes the two are in sync, sometimes they arenā€™t. If I could know when the audio starts (more or less) then I could start the lowering of the screen at the same time.
It usually take about 4.5 - 5.5 seconds for the audio to start from the time of the requestā€¦ but sometimes it lags out to 10+ seconds. Sometimes there is audio doesnā€™t start at all.
Ahhhā€¦ lifeā€™s problems right?

Thanks!!!

Sure, just create an if block in webCoRE. If status changes to ā€˜playingā€™ screenshot is attached.
Of course this would need to be wrapped in or perform some kind of ā€˜is this the lower projector activity?ā€™ check. I guess you donā€™t want to always lower the project when something plays on that chromecast :wink:

Probably not easy or even impossible. Some info maybe:

  1. Load time varies by group size, internet/wifi speed at device location
  2. Devices are constantly connected to cast-web-api, just not the default media receiver needed to playback custom media and tts is open, because:
  3. You might be playing different media (spotifiy, tunein, etc.)
  4. And most importantly, cast receivers close after a certain timeout without any playback.

Hah, thank you!! So simple. It didnā€™t work yet, however. Iā€™m not sure why this isnā€™t triggering.
I made simple pistons to test this status change trigger.
One to cast an mp3 and another to listen for the status change.
The mp3 starts playing, and this one does nothing.
ā€œOffice Speakerā€ is one of my Google Home Minis.
I even tried the more generic ā€œOffice Speakerā€™s status changesā€ (to anything) and that didnā€™t trigger either.
Any idea why?
(the push notifications are working, I tested that) =D

Thanks again!!! =D

image

I think you have use Location, first, then, send push notificationā€¦ Have you been on the webCoRE forum? They are very helpful

Thatā€™s not correct. =D Iā€™m no expert but I donā€™t need to use location to send push notifications. Thanks!
** correction **ā€¦ if I open the editor it IS using location. It is there. The issue isnā€™t with the push notification. I can change the IF to anything that resolves to true and the push works. The issue is with this change status not firing for some reason? Thanks =D

Hi guys,

What is the best way to use tts through webcore. I was able to get the audio file to play but not get the message voiced.

why is the Smartapp saying v1.0.0 is the latest? Curiousā€¦