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

Hi
I installed the api on a linux server and did everything in smartthings etc -> I now have the google home mini speaker in the ST app and I am able to control it, eg change volume etc (not everything works)

the question I have is this: how to use this service?

there does not seem to be instructions out there on how to use this - for example, how do I set it up so that I get a sound (chime) on the google speaker when, for example, a door is opened? I tried making an automation but it does not work, also I do not understand what I am supposed to chose when controlling the speaker.

I also I do not understand how presets are supposed to work, let alone how to set them

help is appreciated, thank you - please can somebody explain how to make google home speaker play a sound when a door is opened, for example.

@liviumac
Not sure how others are using it but for me I’m using the ST app Speaker Companion.

In ST Go to > Automation > SmartApps (tab) > Add a SmartApp (bottom) > Music & Sound > Speaker Companion

From there I setup ‘Play a Notification’ which allows you to trigger a sound or custom message when something happens.

well that was easy :-))
thank you very much, it works

I just did not think of google home as a regular speaker for ST :slight_smile:

I did a clean install today, the cast part works as it always has but I can not get the assistant sdk portion to work. I complete the “setup google assistant” page with no errors but after it says I am done the webpage says “{“assistant”:false,“ready”:false}”

Any idea how to lower the volume during a custom notification?

I’ve set my speaker to announce “The back door is open” when my door opens, it works well but the speaker changes itself from its default 50% to 100% to make the announcement.

I can’t seem to find a setting for announcement volume anywhere.

Thanks in advance.

Good afternoon everyone… i installed everything and my smart app cant seem to find my google home devices. i am sure this has something to do with my addresses not lining up - I would appreciate any feedback that the community is willing to give.

my node address is showing up as

pid │ name │ status │ address │ log │
├───────┼──────────────┼────────┼────────────────┼───────────────────────────────────────────────┤
│ 19624 │ cast-web-api │ online │ 127.0.0.1:3000 │ C:\Users\steve.pm2\logs\cast-web-api-out.log

i am not sure which address to put into the cast-web-api? i tried putting in this same address of
127.0.0.1

my local address is 192.168.1 and the google homes are 192.168.1.124 etc.

the smart app isn’t discovering any devices. I also tried putting the 127.0.0.1 into the smart app, and it wouldnt work, naturally as my devices are on my home router.

I’m sorry if my questions are basic. I’m trying to make this work with basic skills

please help.
Steven

1 Like

Using cast-web-api to have all of my chromecast audio devices show up as Things in Smartthings as expected.In Sharptools, I add the tile as an Album Art Tile, the cover art does not display for the device that is currently playing on Spotify. The song title does, but never the cover art… am I missing something?

See SharpTools thread here:

1 Like

From the SharpTools.io side of things, we’re looking for the DTH to report an audioTrackData attribute (from the Audio Track Data capability) formatted similarly to the official Sonos device.

{
    "title": "Falling",
    "artist": "Trevor Daniel",
    "album": "Falling",
    "albumArtUrl": "http://192.168.1.120:1400/getaa?s=1&u=x-sonos-spotify%3aspotify%253atrack%253a4TnjEaWOeW0eKTKIEvJyCa%3fsid%3d12%26flags%3d8224%26sn%3d1",
    "mediaSource": "Spotify"
}

By default, we’ll try to use the albumArtUrl field of the audioTrackData property directly to display the album art. If that’s not available, we fall back to searching for the artwork online using the album and artist fields of the audioTrackData property if they’re available.

If none of those are available, we also have support for the legacy trackData property which was used with the legacy Sonos driver. Specifically, we’ll use the album and artist fields to search for the album art online.

 {
     "audioSource": "Sonos Q",
     "station": null,
     "name": "Falling",
     "artist": "Trevor Daniel",
     "album": "Falling",
     "trackNumber": "1",
     "status": "stopped",
     "level": "4",
     "mute": "unmuted",
     "uri": "x-rincon-queue:RINCON_949F3E7E9CC801400#0",
     "trackUri": "x-sonos-spotify:spotify%3atrack%3a4TnjEaWOeW0eKTKIEvJyCa?sid=12&flags=8224&sn=1",
     "transportUri": "x-rincon-queue:RINCON_949F3E7E9CC801400#0",
     "enqueuedUri": "x-rincon-cpcontainer:1006206cspotify%3aplaylist%3a37i9dQZF1DXcBWIGoYBM5M?sid=12&flags=8300&sn=1",
     "metaData": "...xmlmetadata...",
     "trackMetaData": "...xmlmetadata..."
 }

PS. I started down the path of installing cast-web-api yesterday and tried again today to see if the data was already available in a different format and I could submit a PR, but my kids have been keeping me busy this weekend. (And I was having trouble building a valid docker container to run on my NAS for testing)

1 Like

Hi
@Steven_Ross1
use the ip address of the machine you are running the cast-web-api on, something like 192.168.1.X:3000 - this is the address you could also access e.g. from your laptop via the internet browser

127.0.0.1:3000 will not work

and I also have a question for people who used this for longer than I have: is it normal for the music on google home NOT to resume after a notification is played through cast-web-api?
even if in the ST automation I have checked that it should resume music initially playing?

I tried both the Speaker Companion app and the Sonos app and although the “resume music playing” slider is ON, any notification cuts the music and, even more, Google Home also considers that nothing was playing, so when I tell it to resume it says that nothing was playing.

good morning and thank you very much @liviumac i will try this tonight…

do i use my laptop or pc address for both the cast-web-api and the smart app to find the google home speakers?

thanks again,
S

hi
I am not sure I understand what you mean by “using the laptop address for the cast-web-api”, so let’s back up a litlle

  1. you have the cast-web-api client installed on a device (be it server, laptop, phone, raspberry etc) - this device has a local IP adress in the form of 192.168.1.X

  2. it is this address followed by :3000 that you have to input in the Cast web - service manager smart app in your smartthings phone app :slight_smile:

this is just step 3 from the below instructions

you normally do not have to input/ change any IP in the cast-web-api-client so that’s why I do not understand the first part of your question

So I got a chance to install cast-web-api and take a closer look. It looks like album art is stored in the image field in the trackData attribute.

@vervallsweg any thoughts on remapping this field of the trackData attribute to better match the official Sonos driver?


For reference purposes, here’s the existing reported trackData for a few test cases:

Spotify
{
    "application": "Spotify",
    "title": "You Make My Dreams",
    "groupPlayback": false,
    "muted": false,
    "status": "PLAYING",
    "subtitle": "Daryl Hall & John Oates",
    "volume": 8,
    "image": "https://i.scdn.co/image/ab67616d00001e026de69821e8460a9d689e20ba"
}
Google Play Music
{
    "title": "Ruby, My Dear (feat. Coleman Hawkins)",
    "application": "Google Play Music",
    "status": "PLAYING",
    "muted": false,
    "groupPlayback": false,
    "volume": 8,
    "subtitle": "Thelonious Monk Septet",
    "image": "http://lh3.googleusercontent.com/N9WJY4KjbfqWSDS0a1nLM_sM30yIYBq0siCmc18GJLQM_1xzC6t4NQDht05mGJxCk1stlWzq7A"
}
Pandora
{
    "title": "Radioactive",
    "application": "Pandora",
    "status": "PLAYING",
    "muted": false,
    "groupPlayback": false,
    "volume": 8,
    "subtitle": "Imagine Dragons",
    "image": "http://mediaserver-cont-dc6-2-v4v6.pandora.com/images/public/int/1/6/4/6/602537286461_500W_500H.jpg"
}

If the driver could remap the field names to match what the Sonos driver is using (or at least duplicate a few select fields under different aliases), that would improve compatibility and get the album art working:

Current Field Mapped Field
image albumArtUrl
application mediaSource
subtitle artist†

† This might not be a perfect mapping for non-music sources. I tried a few podcasts and news and it was a reasonable enough translation in my limited tests.

Other Examples:

'Play the News' Example
{
    "application": "Google News",
    "title": "Congress demands answers from Trump about Soleimani killing",
    "groupPlayback": false,
    "muted": false,
    "status": "BUFFERING",
    "subtitle": "AP Audio Stories",
    "volume": 8,
    "image": "https://images.theabcdn.com/i/33861969/1400x1400.jpg"
}
'Play a Podcast' Example
{
    "application": "Google Podcasts",
    "title": "\"You Have the Rite\" | Marc Bamuthi Joseph",
    "groupPlayback": false,
    "muted": false,
    "status": "PLAYING",
    "subtitle": "",
    "volume": 8,
    "image": "https://lh3.googleusercontent.com/proxy/etAt_XgRZDaEMNIZg0tPh3_6M5TfyTAeaR1WwY0xh_jOl2eNaT5a2t8YFhIkFWczXLt5ak2kSrKFVEm3nkHtwcmikW6G158oz6wX-Q=s225-e14"
}

As noted in my original post above, these are technically in the new audioTrackData attribute (from the Audio Track Data capability) in the official Sonos device… though at least getting a remapped field within the trackData attribute would bring these closer to parity.

3 Likes

Is there a way to have a “MAIN” tile that showed the current chromecast playing, instead of specific to the chromecast device?

For example: Instead of adding my “Kitchen Speaker” tile to a dashboard, I would just add a “universal” chromecast tile, which would then pull music info from whatever device is currently playing on my network.

Hi

Can someone please help !

I have the Cast web api running on windows. I can stream to the devices on the network, but I don´t get any Playback information on the devices.
This was the same problem when I was running on Raspberry PI, so I don´t think it has somthing to do with the server. But I don´t know.
Do I need to setup something on the server to get the server to sent playback information to the devices?
I only get the “Smartthings default media reciever Smartthings playback” in the actiontile and Smartthings apps.
Thanks.

If I “move” Cast Web Api to a different device, do I have to reinstall the device handler or can I just change the IP address in the app?

I’m trying to install this in Synology. and is getting this error while running npm install cast-web-api-cli -g

Anyone has similar issues?

gyp WARN EACCES user "root" does not have permission to access the dev dir "/volume1/@appstore/Node.js_v8/usr/local/lib/node_modules/cast-web-api-cli/node_modules/grpc/.node-gyp/8.9.4"
gyp WARN EACCES^C

This app seems not available anymore. hmm…

I can’t seem to change the port using the command prompt on my pi using the example ```
cast-web-api-cli start -H 192.168.0.11 -p 8080. The command prompt still shows 127.0.0.1:3000. Thanks!

Bumping this, still can’t seem to find a solution.

Hi @jess,
if you use for example the Speaker Companion app, there is an option to “temporarily change volume” (you need to tap “More options” to see it)

It works for me.

And may I ask whether in your case music is resumed after the notification? in my case it is not resumed even if this option is enabled in the Speaker Companion app.