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


(Mark C) #535

id like to link it to git hub could you provide the address, ive tryed navagating but cant get to your git hub repostorys, just the info pages and the raw

(John Miele) #537

I had the Google Assistant Relay device still installed. Once I removed that from the ST app the new devices installed perfectly.

I had Google Assistant Relay installed. I tried uninstalling Node JS and all the associated folders, reinstalled and I am getting the same error.

(Tobias) #538

For the device handlers and smartapp? They should all be here: https://github.com/vervallsweg/smartthing

(Tobias) #539

So it is working now? Interesting, didn’t know that assistant relay also needs to parse packages on lan. Thought that was more of a one way affair :joy:

(John Miele) #540

Its working great! I have it playing sound clips from simpsons when my kids activate things. As soon as I removed the Google Assistant Relay app it worked.

(John Miele) #542

So I am a bit confused on the play track and resume /Speak text and resume. Is this supposed to continue whatever was playing on the GH prior to the message? I have a door chime setup through webcore and it stops the music playing from Google Play Music, sounds the chime from an mp3 file then nothing. Is this expected? Is there a way to continue playing the music?

(Tobias) #543

It will only resume presets!

Yes and yes only if it’s a preset.

(Mark C) #544

Im struggling creating presets, could you give some working examples eg BBC news, rockfm.

(Adam) #545

Hey. Thanks for creating this program…I got it all set up to the point that I just have to put in the presets.i have tried numerous links and each time I only get the default chrome sound. Any tips? Any sample links you can share?

(Mark C) #546

Also, im still strugling with a NAS drive i can creat a url (ftp) which works in my browser, but when i try to cast in smartthing it statrs the process (spining cirle) but then just swithcs to a casting icon on the TV
presetObject: {"preset1":{"mediaTitle":"Greatest showman","mediaSubtitle":"Celebrates the birth of show business, and tells of a visionary who rose from nothing to create a spectacle that became a worldwide sensation","mediaType":"video/mp4","mediaUrl":"","mediaStreamType":"BUFFERED","mediaImageUrl":"https://upload.wikimedia.org/wikipedia/en/1/10/The_Greatest_Showman_poster.png"},"preset2":{"mediaTitle":"

(Tobias) #547


(Mark C) #548

Http didn’t work thats why I’m trying.other things

(Tobias) #549

Then it’s a different problem. Post the preset object with http:// urls here.

This one with http urls didn’t work?
Post here with the http urls and I’ll try to fix it.

(Mark C) #550

{“preset1”:{“mediaTitle”:“Greatest showman”,“mediaSubtitle”:“Celebrates the birth of show business, and tells of a visionary who rose from nothing to create a spectacle that became a worldwide sensation”,“mediaType”:“video/mp4”,“mediaUrl”:“",“mediaStreamType”:“BUFFERED”,“mediaImageUrl”:“https://upload.wikimedia.org/wikipedia/en/1/10/The_Greatest_Showman_poster.png”},“preset2”:{“mediaTitle”:"Preset 2”,“mediaSubtitle”:"",“mediaType”:"",“mediaUrl”:"",“mediaStreamType”:"",“mediaImageUrl”:""},“preset3”:{“mediaTitle”:“Preset 3”,“mediaSubtitle”:"",“mediaType”:"",“mediaUrl”:"",“mediaStreamType”:"",“mediaImageUrl”:""},“preset4”:{“mediaTitle”:“Preset 4”,“mediaSubtitle”:"",“mediaType”:"",“mediaUrl”:"",“mediaStreamType”:"",“mediaImageUrl”:""},“preset5”:{“mediaTitle”:“Preset 5”,“mediaSubtitle”:"",“mediaType”:"",“mediaUrl”:"",“mediaStreamType”:"",“mediaImageUrl”:""},“preset6”:{“mediaTitle”:“Preset 6”,“mediaSubtitle”:"",“mediaType”:"",“mediaUrl”:"",“mediaStreamType”:"",“mediaImageUrl”:""}}


@vervallsweg, thanks for providing this update. I have a few questions/issues when installing the new version.

Previously, I edited casWebApi.js to put in my specific IP address and specified port 8075. I did this on the new version, but when I run ‘cast-web-api’ it says it’s running off port 3000 (which I know is the default).

Also, I installed Forever, but when I run ‘forever start castWebApi.js’ it starts up but I don’t think it’s working because it stops and doesn’t pull up on ‘forever list’.

Last question, can you be a bit more specific in your GitHub directions on how to make it run at start/reboot? I previously added a file to my ‘init.d’ folder to auto run casWebApi.js, but this doesn’t seem to work now using the command ‘cast-web-api’.

Any help is very much appreciated!


Also, when i just try to run ‘node castWebApi.js’ I get the following Error: Cannot find module ‘castv2’. Any idea what’s causing this?

Again, I’m a somewhat newbie but have been using your prior version for a while. Before, I would just run ‘node castWebApi.js’ to get the service up and running and I had it start at boot/reboot. Now, to get it working and communicating properly in SmartThings, I have to manually run ‘cast-web-api’; however, it seems to stop after a while.

Again, any help is very much appreciated.

(Tobias) #553

You can set hostname and or port with the corresponding params, see here.

Yes that’s probably caused by your missing dependency…

… here. How have you installed cast-web-api through GitHub then npm install, or npm install cast-web-api -g?
Maybe try installing it by following the tutorial? There’s even a video available now. Because there shouldn’t be any missing dependencies, npm takes care of that, that’s it’s job.
If the instructions don’t clear things up, let me know how you installed it and we’ll go from there.

We’ll get there as soon as you got the api itself running :wink:


Thanks for the additional color!

  • I understand about setting the hostname and port with the link you provided. But I previously edited casWebApi.js so when it would start at boot it started using the IP and port specified in the casWebApi.js file.

  • I deleted everything on my RPi, and then did the following. Created a new “cast-web-api” folder. Within that folder I installed “sudo npm install cast-web-api -g”. It seems to work, but I am not sure where it’s unpacking and saving any files…I then run “cast-web-api” and it starts up using port 3000.
    (For reference, to install the old version I copied everything from GitHub into a folder on my RPi, modified the castWebApi.js, and then installed everything from that folder location. Then installed forever and set up my file in init.d so it would start at boot. It worked flawlessly, but I’d like to take advantage of this new version.)

  • I then reinstalled “sudo npm install forever -g”. But when I enter “forever start ‘which cast-web-api’” it says it doesn’t exist.


Well, I decided to retry once more but this time old school…or the only way I know how…and it works!

Here’s what I did to install it on my RPi and get it to always run at boot:

  • created a new folder “cast-web-api”
  • Navigate to the folder: $ cd ~/cast-web-api
  • $ git clone https://github.com/vervallsweg/cast-web-api.git
  • I then replaced the IP and Port in castWebApi.js with what I wanted
  • npm install
  • npm install forever -g
  • node castWebApi.js , and it’s up and running!

Now to get it to run at boot

  • $ cd /etc/init.d
  • sudo nano CastService , and then I copied the following contents and saved the file

export PATH=$PATH:/home/pi/cast-web-api
export NODE_PATH=$NODE_PATH:/home/pi/cast-web-api/node_modules
# Provides: CastService
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Google Cast Service
case “$1” in
exec forever --sourceDir=/home/pi/cast-web-api -p /home/pi/cast-web-api castWebApi.js #scriptarguments
exec forever stop --sourceDir=/home/pi/cast-web-api castWebApi.js
echo “Usage: /etc/init.d/CastService {start|stop}”
exit 1
exit 0

Then I executed the following commands

  • $ sudo chmod 755 /etc/init.d/CastService
  • $ sudo sh /etc/init.d/CastService start/stop
  • $ sudo update-rc.d CastService defaults

(Mike) #556

I updated this app and devices this afternoon because it had suddenly stopped working - now I am finding that it is absorbing messages from the Pi that the server component is running on, that is not meant for this API.

Anyone have any thoughts on what I need to change to allow the request to go to the next App, etc?