[RELEASE] cast-web 1.0.0 - Chromecast Device Handler & SmartApps

dth_av
requires_server
project_av
chromecast
googlehome

(Tobias) #270

Yes. It does nothing more then displaying ‘group playback’ on the group members, if the group is playing something.

Only Google Home and Chromecast audios can be grouped in the GH app. So every cast enabled device that doesn’t have a screen :wink:


(Tobias) #271

I also used dory once. Can look into it later. Commands are quite easy after you set up node:

  1. git clone https://github.com/vervallsweg/cast-web-api.git
  2. cd cast-web-api
  3. npm install
  4. node castWebApi.js

That’s it.


#272

Hey Brent, if you remember how you did it can you share the steps you used to install this on windows? Other than cloning docker images on my raspi I am new to node.js. Right now I get a bunch of errors when trying to install mdns, the only thing I have gotten to work so far is the installation of windows build tools. Thanks in advance.


(Tobias) #273

You don’t need them anymore.


#274

is that only for docker? When I enter the “git clone…” command I get and error “git is not recognized command”. I dont have docker installed just node.js


(Tobias) #275

You on windows? Just download the zip file from the repo, you cannot clone. Just hit the green clone/dl button on the repo and download the zip folder. Unzip it. Change the directory of your command line to the unzipped folder and then run npm install.


#276

Doh, I should have known that… Thanks everything is up and running now!


(Matt Behnken) #277

I’m sure Google will implement it in 5 years. To accomplish sync can I send multiple API calls simultaneously? Instead of having the same media wait for it’s turn to play? Would I need multiple API hosts and multiple smart app cast web instances?


(Terry Honn) #278

Anyone else wanting to use this to cast output from IP camera or Blue Iris camera software? When I try setting one of the presets to a local image or stream URL, I get a generic icon on my TV and an error in the cast-web console…

Request to: /getDeviceStatus?address=192.168.1.125:8009
Request to: /setMediaPlayback?address=192.168.1.125:8009&mediaType=image/jpg&mediaUrl=http://192.168.1.100:81/image/Front&mediaStreamType=LIVE&mediaTitle=NewCam&mediaSubtitle=tesdfsd±+Preset+1&mediaImageUrl=ttp://192.168.1.100:81/image/thumbnail.jpg
Exception caught: TypeError: Cannot read property ‘playerState’ of undefined

(I tried unsuccessfully to change the media type to image/jpg… the error is present even using video/mp4 or audio/mp3.

Thanks in advance!


(Tobias) #279

Yes you can.

Oh… I see. The only problem is that chromcasts have different loading times, based on network load, … . However Chromecast video devices are slower to load then audio devices and they drop the first second or so of audio playback.

I mean you can try, but it won’t be easy. I’d recommend getting a chromecast audio, even if you have a video and audio device attached to the same speakers as a result. It’s worth it :sweat_smile:


(Tobias) #280

Is it an mjpeg stream?

https://developers.google.com/cast/docs/media


(Matt Behnken) #281

yes i’ve got a few audio’s for my built in ceiling speakers and big stereo as well as a few chromecasts (vid) around the house, and 5 or so minis and 1 of the OG google homes. I’ve experienced the cutoff of the first few seconds on the chromecasts, I should prob just adj the timeout param. Thank you for the reply, i’ll get back with my findings if I can find some testing time!


#282

How do you adjust the timeout parameter of a chromecast?

And if it’s a matter of synchronizing the audio streams with the GH speakers, what does that have to do with the timeout parameter? Don’t you mean an audio delay parameter?

E.g. In my experience, when I issue a playback command to both GH speakers and Chromecast to play an audio stream, the Chromecast audio is usually delayed by 0.25 seconds as compared to the GH speakers (and this delay is probably caused by the A/V receiver)


(Tobias) #283

True. The timeout parameter just defines how long the API should wait for an answer from the Cast device.

Maybe with some precise timing he can get it to work. Maybe not perfect, but usable.


(Matt Behnken) #284

yes my bad, maybe timeout /t 2,


(Satish P) #285

I did setup the node.js and all the required smart apps. I do have a GH group for all my google home devices ( Have a chromecast too but that is not included in this audio group). Used this audio group as a cast device to play my notifications. It works.

The problem i see that after the notification is played, on the smartthings app on phone, I see the group still shows “Playing” even after the notification is played and finished. I have to explicitly press the STOP button to make the status “READY”… I see the below errors in the log…

2:27:34 PM: debug groupStatusUpdated called, theAudioGroup.currentState('status').value: playing
2:27:34 PM: debug getLatestVersion(), data: { "version": 0.2, "type": "release", "date": "February 11, 2018", "changelog": "https://github.com/vervallsweg/smartthings/blob/master/smartapps/vervallsweg/cast-web-group-sync.src/README.md#version-02" }
2:27:34 PM: debug getLatestVersion(), response status: 200
2:27:34 PM: error getLatestVersion(), something went wrong: java.lang.NullPointerException: Cannot get property 'smartAppVersionDTO' on null object

(Matt Behnken) #286

Have you tried lowering the polling rate in the cast web smart app for each device? Mine is at like 5 minutes because the Google home doesn’t answer if it’s responding to an app poll, it’s on a few seconds of downtime but I’ve hit it before.


(Tobias) #287

Well thats a current limitation. The API doesn’t inform ST yet, when the notification stopped playing. ST has to ask every x minute what’s currently (not) playing. What @Matt_Behnken does is the best solution right now.


(Satish P) #288

Matt, vervallsweg

I just changed the refresh rate of each device to 2 mins. Mine also
previously set at 5min refresh rate. The one thing I don’t understand is
that the status of playing stayed for hours on my group until I hit stop
button. Why wouldn’t it refresh after 5min?


(Tobias) #289

Hmm… maybe thats a bug in the group manager, but not sure yet.

Make sure to also change the refresh of the actual group device. The group manager does nothing else but copying the group device’s playback status to the members. So it’s crucial that the group updates fast enough in order to set the new status to the members.