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

@vervallsweg
I made a pull request on your repo to rearrange the files so that you can use the smartthings github integration. Let me know (and accept the PR) if you’d like that.

Thanks for an awesome script!

1 Like

@vervallswegI’ve also run into a problem:

Your setup works perfectly with the SmartThings Speaker Companion app. Sweet!
However, I can’t seem to get it to work with webCoRE, speak (or play track) method. Here’s what I get:

33c09dee-4865-4301-a023-ecca3ad23b1f  12:40:02 PM: error groovy.lang.MissingMethodException: No signature of method: script15074016013751480490087.playTrack() is applicable for argument types: (java.lang.String) values: [https://s3.amazonaws.com/smartapp-media/polly-tts/salli/hello_world_.mp3]
Possible solutions: playTrack(java.lang.Object, java.lang.Object), nextTrack(), setTrack(java.lang.Object) @ line 447

33c09dee-4865-4301-a023-ecca3ad23b1f  12:41:09 PM: error groovy.lang.MissingMethodException: No signature of method: script15073625217021480490087.playTrack() is applicable for argument types: (java.lang.String) values: [https://s3.amazonaws.com/smartapp-media/polly-tts/salli/hello_world_.mp3]
Possible solutions: playTrack(java.lang.Object, java.lang.Object), nextTrack(), setTrack(java.lang.Object) @ line 1697

33c09dee-4865-4301-a023-ecca3ad23b1f  12:41:46 PM: error groovy.lang.MissingMethodException: No signature of method: script15074017060331480490087.playTrackAndRestore() is applicable for argument types: (java.lang.String) values: [https://s3.amazonaws.com/smartapp-media/polly-tts/salli/hello_world_.mp3]
Possible solutions: playTrackAndRestore(java.lang.Object, java.lang.Object, java.lang.Object) @ line 1697

The first one is using the speak command, the second is the playTrack command, and the third is the playTrackAndRestore command. All sent from the webCoRE dashboard.

Any ideas?

Update:
I was able to fix the problem with speak and playTrack by copying the

def playTrack(uri, level)

method and making a new one:

def playTrack(uri)

I think you mentioned doing that here: https://github.com/vervallsweg/smartthings/issues/7#issuecomment-331717045 (overloading the methods).

Is that still the method you want to use to resolve the speaker companion/webCoRE problem?

Hello,

When I open the http site. x.x.x.x:3000 I receive “cast-web-api version 0.2.2” but when I try to use the smartapp I get a 500 error.

Thanks,
Kevin

Yes that is exactly it. But look at the documentation it doesn’t mention a level parameter. I’m not even sure myself what and how to implement the methods. That’s why my plan is just to overload them and it should work with most apps. Pretty ugly solution, but didn’t even realize it’s a problem till you and others pointed it out.

So yes the issue you mentioned should fix all these methods.

Sorry, didn’t even know that there were requirements for the Github integration :sweat_smile:. I live in Europe and we’ll probably never get that feature and I cannot try it. I’ll look into it and then merge it into the next release :+1: .

500 = internal server error. Check your web API logs, and post the output here, then we should be able to fix it.

Oh and you need to enable debug logging by closing your current instance and opening it again with this command DEBUG=* node (yourdirectory)/castWebApi.js . Then the logging messages will just appear in your terminal window.

I was able to resolve the issues.

Thanks,
Kevin

1 Like

Just got a Google Home Mini and was trying to add it to the smart app. Discovering the device seems to work as i see an additional device when discovering. When trying to add the device (after checking the box and tapping on ‘Next’), i am led to a blank screen.

On the top bar, there’s only Done and Back. When tapping on Done, i get an error saying “Error saving unnamed page. Please contact Smart App developer”.

Is this something to do with the SmartApp or is it the Google Home Mini? Any ideas?

I currently have a Google Home and 2 chromecast connected and has been working with this solution for awhile now.

Great work. I have got everything up and running. Really wishing i could get alerts based on motion etc Like the speaker app.
I did come a across and app that seems to be able to work with the chromecast the app is Talking alarm clock. You can even do TTS with it. I am not programer but I wander if that app can be configured to work as a speaker app.

It doesn’t do any kind of verification so probably the problem is with my smart app.

Device discovery is currently broken and will be fixed in version 0.1 of the smartapp. Will fix it today or tomorrow and you can give it a second try! :slight_smile:

You mean the speaker companion app by SmartThings? That should actually work with the not yet released version 0.1. Not sure if it’s completely fixed yet though. If it’s really urgent you can give it a try now. However I’d recommend at least waiting till the corresponding ticket is closed.
Version 0.1 should be out in a couple of days :+1:

Release version 0.1

Not sure if you get a notification when the first post is edited so I just wanted to let everyone know that v0.1 is finally released. Its been quite a while and I tried to address as many of your problems and wishes as possible.

Just some highlights of v0.1 are GitHub integration, fixed Speaker companion/WebCoRE integration and much more.

Check out the first post for more info and of course the GitHub page.

Let me know how it works for you and what features you would like to have in future releases.

5 Likes

Hi Tobias,

I just noticed your update - thanks for your work! I just installed the new SmartApp and DTH. Control of my Google Home speaker is working fine (as before) but I can’t seem to get the TTS to work. Speaker Companion can successfully toggle play/pause but “Play a notification” or “Play weather report” don’t do anything. Any idea what I might be doing wrong?

Thanks,
Jan

1 Like

Should work tested I just now at home. Custom notification, the ST soundfiles and weather forecast all work for me.

However I encountered some weird behavior: after you install it and click the button it doesn’t always work. Checking the the logs, I find that an exception was thrown that the method wasn’t found. Heading back to the app, pressing the button again, everything works fine. Checking the logs shows, that the exact same method that was ‘missing’ 20seconds ago, was now executed. WTF?
Seriously, I’m not sure if that’s in my power to fix.

Anyways if it still doesn’t work for, try removing speaker companion and installing it again.

Hi,

I actually removed and the re-added Speaker Companion before. Doesn’t work either way: not when using the “play” button and not with a “When:” condition. Can you give me a hint what should I be looking for in “Live Logging”?

Edit: each time i push Speaker Companion’s “play” button, I just get this one line in Live Logging:

8084c013-e108-4f56-8d65-e1446b286814  5:31:23 PM: trace Exiting takeAction()

Thanks,
Jan

You need to enable logging in the SmartApp.
Open the service manager, select the device you’re trying to use with speaker companion, then select logging level and set it to 4.

Then the messages should appear in live logging for that device.

Hi @vervallsweg, many thanks for your excellent work!

  1. Is cast-web-group-sync still necessary, or should this be deprecated since GH groupings are now native? For the record, the only smart-app I installed and used is the cast-web-service-manager (along with the node.js cast-web api) and I’m able to cast to either the separate GH devices, as well as the custom GH groupings I created (and which are found and enumerated by the cast-web-service-manager smartapp.)
  2. Do you have a tutorial that explains how to use cast-web-preset-generator? I thought I saw documentation somewhere, but it’s since eluded me.

First off I think it’s actually broken :joy:. It was never meant to enable casting to groups or anything. The only use for it was to disable playback control on the group members. If you cast to a group and refresh all of its members, you’ll find that one of them actually allows playback control. The goal of the group-sync app was simply to change the status of each group member to ‘group’ and only allow control through the actual group device.

Will update it as soon as I rewrote the whole group playback detection.

Sadly not really. There’s some discussion in this thread about what works and what doesn’t. To cut it short, everything will play with a preset if you have a publicly available direct link to it. Something like: http://example.com/myRadioStream.mp3

With the next update of the prest-generator I’ll also upload an instruction video. Thought about making one for the whole project anyways.

For the time being, just let me know what you wanna play and I’ll try my best to make it work! :slight_smile:

1 Like

Hi,

I did that and the following is logged:

(…) 1:56:18 PM: debug Executing ‘sendHttpRequest’ host: 10.0.7.194:3000 path: /setMediaPlayback?address=10.0.7.25:8009&mediaType=audio/mp3&mediaUrl=https://s3.amazonaws.com/smartapp-media/polly-tts/salli/57f2da7b8ffd72292664301d5b25394dd3e450d7.mp3&mediaStreamType=BUFFERED&mediaTitle=SmartThings&mediaSubtitle=SmartThings+playback&mediaImageUrl=https://lh3.googleusercontent.com/nQBLtHKqZycERjdjMGulMLMLDoPXnrZKYoJ8ijaVs8tDD6cypInQRtxgngk9SAXHkA=w300

If I try to open the above amazonaws from my PC, I get an AccessDenied error, so that’s probably the root issue here. Did I overlook something?

Thanks,
Jan

Edit: if I remove &mediaStreamType=BUFFERED, I can download and play the MP3 file in a web browser

Nice Work…:+1:

i followed the instruction provided in this site http://www.mysmartcave.net/2017/09/11/connecting-google-home-chromecast-smartthings/ . the last step had problem because the links were broken. however managed to navigate to the github and figured it out.

it works well so far. i am happy with your work. Good Job.
letting Alexa go and making room for Google mini.

Do i need the Raspberry pi for cast-web, i have few tablets sitting idle is there instructions setup cast-web node.js on android device?

UPDATE:
I followed the instructions provided on this site https://medium.freecodecamp.org/building-a-node-js-application-on-android-part-1-termux-vim-and-node-js-dfa90c28958f and installed nodejs and cast-web-api and everything worked fine.

4 Likes

Thanks for the reply!

So as a test I am trying to create these three internet radio presets.
Toker.FM - http://178.33.191.197:6060/listen.pls
Jroot - http://184.154.202.243:8306/stream;.mp3
Kol Beramah - http://173.193.205.96:9016

Here is the code generated by your tool which I copied into the cast web service manager smartapp in the “Preset object field”.

{"preset1":{"mediaTitle":"Toker.FM","mediaSubtitle":"מוסיקה יהודית 24 שעות ביממה","mediaType":"audio/mp3","mediaUrl":"http://178.33.191.197:6060/listen.pls","mediaStreamType":"LIVE","mediaImageUrl":""},"preset2":{"mediaTitle":"JRoot","mediaSubtitle":"The Jewish Station that Listens to You!","mediaType":"audio/mp3","mediaUrl":"http://184.154.202.243:8306/stream;.mp3","mediaStreamType":"LIVE","mediaImageUrl":""},"preset3":{"mediaTitle":"Kol Beramah","mediaSubtitle":"NY Jewish Music","mediaType":"audio/mp3","mediaUrl":"http://173.193.205.96:9016","mediaStreamType":"LIVE","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":""}}

Here is the response from each preset:

Preset 1:

82f0c76d-53f3-4b7f-b2e3-974f2130a68a 3:27:58 PM: debug mediaStatus.media.metadata.title: –
82f0c76d-53f3-4b7f-b2e3-974f2130a68a 3:27:58 PM: debug Executing ‘updateAttributesTrack’
82f0c76d-53f3-4b7f-b2e3-974f2130a68a 3:27:58 PM: debug Executing ‘setDefaultAttributesMedia’
82f0c76d-53f3-4b7f-b2e3-974f2130a68a 3:27:58 PM: debug Executing ‘setDefaultAttributesDevice’
82f0c76d-53f3-4b7f-b2e3-974f2130a68a 3:27:58 PM: debug Executing ‘setDefaultAttributes’
82f0c76d-53f3-4b7f-b2e3-974f2130a68a 3:27:58 PM: error HTTP response not ok, status code: 400 requestId: 8e41d468-d69d-4877-9f8c-65afa3dfb629
82f0c76d-53f3-4b7f-b2e3-974f2130a68a 3:27:58 PM: debug parse, msg.json: null
82f0c76d-53f3-4b7f-b2e3-974f2130a68a 3:27:58 PM: debug Parsing ‘index:17, mac:0011323A5519, ip:C0A80133, port:0BB8, requestId:8e41d468-d69d-4877-9f8c-65afa3dfb629, callback:true, headers:SFRUUC8xLjEgNDAwIEJhZCBSZXF1ZXN0DQpDb250ZW50LVR5cGU6IGFwcGxpY2F0aW9uL2pzb247IGNoYXJzZXQ9dXRmLTgNCkRhdGU6IFN1biwgMTIgTm92IDIwMTcgMjA6Mjc6NTggR01UDQpDb25uZWN0aW9uOiBrZWVwLWFsaXZlDQpDb250ZW50LUxlbmd0aDogMTU=, body:UGFyYW1ldGVyIGVycm9y’
82f0c76d-53f3-4b7f-b2e3-974f2130a68a 3:27:58 PM: debug Executing ‘sendHttpRequest’ host: 192.168.1.51:3000 path: /setMediaPlayback?address=192.168.1.27:8009&mediaType=audio/mp3&mediaUrl=http://178.33.191.197:6060/listen.pls&mediaStreamType=null&mediaTitle=Toker.FM&mediaSubtitle=מוסיקה+יהודית+24+שעות+ביממה&mediaImageUrl=
82f0c76d-53f3-4b7f-b2e3-974f2130a68a 3:27:58 PM: debug Executing ‘setMediaPlayback’; mediaType: audio/mp3 mediaUrl: http://178.33.191.197:6060/listen.pls mediaStreamType: null mediaTitle: Toker.FM mediaSubtitle: מוסיקה יהודית 24 שעות ביממה mediaImageUrl:
82f0c76d-53f3-4b7f-b2e3-974f2130a68a 3:27:58 PM: debug Executing ‘playPreset’: 1
82f0c76d-53f3-4b7f-b2e3-974f2130a68a 3:27:58 PM: debug Executing ‘preset1’

Preset 2:

82f0c76d-53f3-4b7f-b2e3-974f2130a68a 3:29:32 PM: debug mediaStatus.media.metadata.title: –
82f0c76d-53f3-4b7f-b2e3-974f2130a68a 3:29:32 PM: debug Executing ‘updateAttributesTrack’
82f0c76d-53f3-4b7f-b2e3-974f2130a68a 3:29:32 PM: debug Executing ‘setDefaultAttributesMedia’
82f0c76d-53f3-4b7f-b2e3-974f2130a68a 3:29:32 PM: debug Executing ‘setDefaultAttributesDevice’
82f0c76d-53f3-4b7f-b2e3-974f2130a68a 3:29:32 PM: debug Executing ‘setDefaultAttributes’
82f0c76d-53f3-4b7f-b2e3-974f2130a68a 3:29:32 PM: error HTTP response not ok, status code: 400 requestId: b827fdb1-1aaf-4666-b91c-fb63601d2298
82f0c76d-53f3-4b7f-b2e3-974f2130a68a 3:29:32 PM: debug parse, msg.json: null
82f0c76d-53f3-4b7f-b2e3-974f2130a68a 3:29:32 PM: debug Parsing ‘index:17, mac:0011323A5519, ip:C0A80133, port:0BB8, requestId:b827fdb1-1aaf-4666-b91c-fb63601d2298, callback:true, headers:SFRUUC8xLjEgNDAwIEJhZCBSZXF1ZXN0DQpDb250ZW50LVR5cGU6IGFwcGxpY2F0aW9uL2pzb247IGNoYXJzZXQ9dXRmLTgNCkRhdGU6IFN1biwgMTIgTm92IDIwMTcgMjA6Mjk6MzIgR01UDQpDb25uZWN0aW9uOiBrZWVwLWFsaXZlDQpDb250ZW50LUxlbmd0aDogMTU=, body:UGFyYW1ldGVyIGVycm9y’
82f0c76d-53f3-4b7f-b2e3-974f2130a68a 3:29:32 PM: debug Executing ‘sendHttpRequest’ host: 192.168.1.51:3000 path: /setMediaPlayback?address=192.168.1.27:8009&mediaType=audio/mp3&mediaUrl=http://184.154.202.243:8306/stream;.mp3&mediaStreamType=null&mediaTitle=JRoot&mediaSubtitle=The+Jewish+Station+that+Listens+to+You!&mediaImageUrl=
82f0c76d-53f3-4b7f-b2e3-974f2130a68a 3:29:32 PM: debug Executing ‘setMediaPlayback’; mediaType: audio/mp3 mediaUrl: http://184.154.202.243:8306/stream;.mp3 mediaStreamType: null mediaTitle: JRoot mediaSubtitle: The Jewish Station that Listens to You! mediaImageUrl:
82f0c76d-53f3-4b7f-b2e3-974f2130a68a 3:29:32 PM: debug Executing ‘playPreset’: 2
82f0c76d-53f3-4b7f-b2e3-974f2130a68a 3:29:32 PM: debug Executing ‘preset2’:

Preset 3:

82f0c76d-53f3-4b7f-b2e3-974f2130a68a 3:31:02 PM: debug mediaStatus.media.metadata.title: –
82f0c76d-53f3-4b7f-b2e3-974f2130a68a 3:31:02 PM: debug Executing ‘updateAttributesTrack’
82f0c76d-53f3-4b7f-b2e3-974f2130a68a 3:31:02 PM: debug Executing ‘setDefaultAttributesMedia’
82f0c76d-53f3-4b7f-b2e3-974f2130a68a 3:31:01 PM: debug Executing ‘setDefaultAttributesDevice’
82f0c76d-53f3-4b7f-b2e3-974f2130a68a 3:31:01 PM: debug Executing ‘setDefaultAttributes’
82f0c76d-53f3-4b7f-b2e3-974f2130a68a 3:31:01 PM: error HTTP response not ok, status code: 400 requestId: 6c259b68-77ed-42de-aa76-6f84c57db06f
82f0c76d-53f3-4b7f-b2e3-974f2130a68a 3:31:01 PM: debug parse, msg.json: null
82f0c76d-53f3-4b7f-b2e3-974f2130a68a 3:31:01 PM: debug Parsing ‘index:17, mac:0011323A5519, ip:C0A80133, port:0BB8, requestId:6c259b68-77ed-42de-aa76-6f84c57db06f, callback:true, headers:SFRUUC8xLjEgNDAwIEJhZCBSZXF1ZXN0DQpDb250ZW50LVR5cGU6IGFwcGxpY2F0aW9uL2pzb247IGNoYXJzZXQ9dXRmLTgNCkRhdGU6IFN1biwgMTIgTm92IDIwMTcgMjA6MzE6MDEgR01UDQpDb25uZWN0aW9uOiBrZWVwLWFsaXZlDQpDb250ZW50LUxlbmd0aDogMTU=, body:UGFyYW1ldGVyIGVycm9y’
82f0c76d-53f3-4b7f-b2e3-974f2130a68a 3:31:01 PM: debug Executing ‘sendHttpRequest’ host: 192.168.1.51:3000 path: /setMediaPlayback?address=192.168.1.27:8009&mediaType=audio/mp3&mediaUrl=http://173.193.205.96:9016&mediaStreamType=null&mediaTitle=Kol+Beramah&mediaSubtitle=NY+Jewish+Music&mediaImageUrl=
82f0c76d-53f3-4b7f-b2e3-974f2130a68a 3:31:01 PM: debug Executing ‘setMediaPlayback’; mediaType: audio/mp3 mediaUrl: http://173.193.205.96:9016 mediaStreamType: null mediaTitle: Kol Beramah mediaSubtitle: NY Jewish Music mediaImageUrl:
82f0c76d-53f3-4b7f-b2e3-974f2130a68a 3:31:01 PM: debug Executing ‘playPreset’: 3
82f0c76d-53f3-4b7f-b2e3-974f2130a68a 3:31:01 PM: debug Executing ‘preset3’:

So they all basically are getting a HTTP 400 error. Did I do something wrong?