LOL sorry. On mobile and my eyes are 46 years old. 38 years coding so they deserve a break…
Babyshark is a great song
Regarding sonos, it shouldn’t be hard if home assistant has APIs for them. I know spotify APIs don’t work.all that well with sonos which makes it harder because with chromecast they appear as spotify connect devices after spotify is playing on them.
Can you walk me thru sonos scenarios wet to ha and other apis quickly?
regarding the sonos devices, it maybe easier to just surface all media_players or simply have the user list the entities that you expose in the card, i’m not sure what would be easier? (example below):
Or now that sonos is an ‘integration’ within Home Assistant you could pull from that directly?
With sonos they are surfaced as a single media_player but in fact could be a group of speakers. For example in my living room i have media_player.living_room but it is made up of a playbar, sub and 2 x rear sonos one speakers.
As per the link above there is the ability to link devices together (group) and after that restore them to the previous set up, but for a card like this I don’t think that is necessary as can be easily implemented with a button card alongside.
There is a mini-media-player card that works to control sonos, but doesn’t have any way to access spotify playlists. My plan was to use the sonos code from here
hi, using this card for a long time now, works good
but sometimes you see the whole page refreshing where this card is loaded
is that a normal behaviour? seems it needs to authenticate again or something
Hello,
I come from a web development background rather than python etc, but could you do the redirect to auth in an hidden iframe so that the user doesnt experience a redirect?
Im fine either way as it has little effect on my experience of using the app, i just wondered if this would help?
Cheers
playback is done through media_player. Example I could find. So rather than spotify connect, the users playlists are a source of the media_player (currently at work, but will check when i’m home)
If you come from a webdev background it would be great if you propose the change in a PR! I already spend a considerable amount of my time with open source software on a non-paid basis. The repo says that contributions are more than welcome.
That said, I like the iframe approach but I think it goes against the OATH security approach and a bunch of other things like what URL to redirect to (the same HA url as the one the card is on?). Unless someone could walk me through a flow I’m afraid it will stay on an idea stage.
What would be interesting though is for the spotify media player built in to HA to be upgraded with a maintained spotify library and have the functionality that is required for this card. By virtue of being a server side implementation it.doesnt need any redirects to refresh the token because it has the client secret.
Been talking with balloob about that but time is limited for everybody
I looked into the code and cany find anything sonos specific. At least not at a glance. The mini media player can’t start spotify on a device, only control playback, which makes me wonder about your use case
I don’t believe it is sonos specific, it should be specific to media_player.
The use case would be to take the playlist and UI elements you created And select a playlist, and then pass that off to a local media_player
To play (that media_player being a sonos device in HA)
Hello,
When I say “background”, its been 6 years since I was actively involved in any sort of development and then it was just PHP, MySQL and HTML so im not familiar with anything that HA is built upon sorry, and neither have I any experience with Github sorry to propose a PR. Im not even sure if what I was suggesting is possible, its just a way that I would have tried to botch it 6+ years ago!!
Thanks
Using media_player.play_media and the media_content_id being an normal spotify uri such as “spotify:playlist:37i9dQZF1DX3yvAYDslnv8”? Is there a way to distinguish which media_players are sonos devices?
Hi there, thanks for this very nice card!
Not sure someone already requested, but, would be possible to be able to select all the available playlist and define how many to show as “static” while still be able to “scroll down the list” to see the rest?
i don’t think so, but would the user be able to specify that in the config of the custom-card? it seems its not possible to play direct from spotify to a sonos device, hence the need to go through HA.
thing is, i dont think you need an actual sonos. An actually the changes you make wont be beneficial for sonos users, it will benefit anyone who has media_player set up that isnt spotcast etc
if the user specifies in the card config the entities of the media_player(s) then those appear in the list in your card. If they are sonos great, but could also be other media_player devices
I’m afraid that is over simplifying things.
Every entity in the list is a spotify connect entity and are controlled using the spotify web api. At the bottom of the list are chromecast devices which can be started using spotcast HA custom component and when started they appear as spotify connect devices and can be controlled using the spotify web api.
If I for example add my Samsung media player entity in the list it will not work because there is no api to start spotify on it. Same goes with pretty much every other media player entity in HA.