Willing to share your code for this?
I love your conditional card-spotify picker and swipe card with the blurred background (browser mod)
The only thing i question left is, how do i integrate my sonos speakers with it (have sonos and google homes) . And can i browse spotify too?
Hi, the code is already posted here. It’s the same base code as the first post of this thread, but changed the script part to work with spotcast instead of radio stream: Chromecast Radio with station and player selection
So you can re-create this by following the steps of the first step and use the codes I provided. I don’t use Sonos, so I can’t say what will or will not work.
sidenote: in this case I used stack-in-card instead of vertical-stack card. That one can disable margin etc, which gives the look that the separate cards are one.
I tried…
Some questions though…
I’m not sure the script works…
I click the cast the radio (and/or cast spotify) and then somethings starts playing but i get the idea its not 100% what i ask to do…
Is there a way i can check whats playing?
I dont see a cover either, the google hub is showing : default media receiver
and not the radio channel cover or not the spotify playlist cover…
Radio doesn’t show artwork because it’s a simple mp3 stream that you cast to Chromecast. It can’t show artwork because it’s not there to begin with. There is no metadata with the stream url.
I use spotcast to cast Spotify playlists I predefined using the matching URI link, which does send metadata and show artwork and media info. Which is why it shows. If you don’t have artwork with Spotify and you use spotcast, then some of your code isn’t correct.
If it plays something else than you want, then most likely your script is not correct. If you switch URI codes then a different playlist wil play then you think.
This isn’t something I can really help you with, because all code is available and I have no idea what issues you’re having and what you expect it to do. If you explain that and post all your codes, maybe I can try and help, but that’s hard to say.
Many thanks for this approach. I have been using this for years, but it no longer works with HA versions after 0.115. Is anyone else having issues? Problem Solved: Somehow my formatting of the script was jumbled up but still passed the configuration check. I cleaned up the formatting to how I remember I originally created it and the script is now working on 0.117.6.
See https://github.com/home-assistant/core/issues/40466
Your issue has to do with mdp if I read your ticket. So it has nothing to do with the script itself. I think your issue will be solved faster if you post your problems in threads about mdp player.
Regarding radio: there is no TuneIn integration in Home Assistant. And there is no way to cast TuneIn to Chromecast, unless someone creates that component (just like spotcast).
Regarding Spotify:
I still don’t know what your issue is… like I explained, I want to help and you can post code but you still haven’t explained that the issue is. You said:
I click the cast the radio (and/or cast spotify) and then somethings starts playing but i get the idea its not 100% what i ask to do…
I have no idea what it is you ask it to do (or you think you’re doing) and what is does then. So what is the issue?
radio gets no cover but you explained so thats “ok”
It takes long too to start playing the mp3 , is that normal?
spotify problem: he doenst play my playlist, yesterday i started a playlist… and stopped it, i just tried to start playing the top 50 but the hub shows the playlist from yesterday and doesnt play anything so it doesnt start correct playlist…
It takes long too to start playing the mp3 , is that normal?
This depeneds on the stream. Some work instantly, other might take longer to buffer. This is handled by the core Chromecast integration in the end. So if you think it’s a bug, you can create a ticket at HA github → Issues · home-assistant/core · GitHub
spotify problem: he doenst play my playlist, yesterday i started a playlist… and stopped it, i just tried to start playing the top 50 but the hub shows the playlist from yesterday and doesnt play anything so it doesnt start correct playlist…
Then your code is not right in the script and/or input_select. All the script does is execute the spotcast service and use the speaker and playlist combination you wrote under input_select and the script.
One thing I do notice, is that you also have group.cast_player as one of he speaker options. I don’t know if that’s supported by spotcast. I created Chromecast group speakers within Google Home app, and then used that as a media_player entity, not group. For example, I have media_player.sony_cast, media_player.badkamer_cast and media_player.multispeakers_cast. The Multispeaker mediaplayer consists of Sony and Badkamer, but that’s handled by Google Home. I don’t group them using Home Assistant.
I can’t really help you with this myself. I just edited the code that this thread provided and used my own Spotify playlist URI’s. And created the UI card and mixed stuff to create something for myself.
So if you’re issue is: it plays, but not the playlist I asked it to play. Then you need to check your Spotify URI’s and make sure the input_select is correct. I advise to first test the playlist URI codes and make sure it’s the correct one. Use developer tools for that to execture service calls. If it fails you can pinpoint what the issue is, by trying a different Chromecast media player and URI playlist. If still fails, mention it over at the spotcast thread if it’s related to spotcast.
Just paste the code inside the service tab. This is located -> https://ur-of-your-ha:8123/developer-tools/service. There just use the service_data (or paste below code in there) and press the button to call the service.
Change the entity_id and uri based on the one you want to test and use different Spotify uri’s to see if it’s the correct one. If you have any errors or if the issue is with spotcast, make sure to visit that thread I linked above so people can help you.
Glad you finally found the issue! Don’t need to apologize mate. In the end you now know what to do different next time and you learned some more about HA . That’s a win to me !