Blackymas / NSPanel_HA_Blueprint

This allows you to configure your complete NSPanel via Blueprint with UI and without changing anything in the code
1.4k stars 254 forks source link

`Feature request` Media Player: Some customizable buttons for choosing playlists, radiochannels or similar would be cool. #1082

Open edwardtfn opened 1 year ago

edwardtfn commented 1 year ago

Based on #1080 by @quenthal

Some customizable buttons for choosing playlists, radio channels or similar would be cool.

There could be, let's say 3-9 buttons with either icons, numbers or customizable strings available for user with customizable media_content_Ids as values.. I think those could fit there quite nicely.

There might be some nice arrangement also for example if timeline and volume bar were replaced with buttons.

_Originally posted by @quenthal in https://github.com/Blackymas/NSPanel_HA_Blueprint/discussions/1080_

Doughboy68 commented 1 year ago

I think this depends on the media player. I only have experience with Apple Music and there is no way to direclty call a playlist to the homepod media player in HA. It would requires maybe using an input boolean helper, expose to homekit via integration and then make a HomeKit automation to do this... triggered by HA.

Maybe I will dust off an Alexa and try it out and see how it works in comparison.

edwardtfn commented 1 year ago

The challenge here is to create a componente to show/select the playlist/radio/etc. in the Nextion display used on those panels. More advanced versions of Nextion displays supports drop down components, but that isn't the case for the use selected by Sonoff. It's feasible, but requires UI work.

quenthal commented 1 year ago

Do you think simple service call buttons are feasible? For example, when using Sonos choosing radio channels or Spotify playlists are as simple as calling play_media -service with customizable media_content_id:

service: media_player.play_media target: entity_id: media_player.sonos data: media_content_type: "playlist" media_content_id: "spotify:playlist:abcdefghij0123456789XY" enqueue: true

media_content_id can be spotify-playlists, URLs etc. (https://www.home-assistant.io/integrations/sonos/) If there was simply, for example 3-6 buttons where user could customize the title on the button and the media_content_id string (which could be one of the aforementioned URLs, playlists, Plex-links or radio-channels).

What is common for all media players, is that media_content_id is available for (almost) all of them. There is naturally limits what kind of URLs or ids work with them, but they could be dependant of the user.

Same could be for entity_id's, if groups were to be available here in future. entity_id 'all' points to all media_players.

edwardtfn commented 1 year ago

It would be quite easy to have custom buttons that you can freely assign to a light or a script, then in your script you call the service you want. Then challend in this case is onky to find a place for those buttons. That page is quite full right now, specially in the US model.

quenthal commented 1 year ago

Maybe even smaller mdi-icon buttons, wher one could customize either numbers or some other icons with service calls? But I understand there is not much space.

edwardtfn commented 1 year ago

The icon size isn't the biggest problem. The touchable area is the issue. If we make it too small, gets harder to press the right button and sometime you can press a button in the side instead.

quenthal commented 1 year ago

Maybe something like this?

First picture is from 4.0.1: image

Then we could drop the second line from song title (if we can either just cut predefined first characters out of it) and maybe use smaller font as well.

Then I would drop the volume controls and play/pause etc to bottom of screen. Below them we could still have volume and progression bar, but I wouldn't mind if we would lose draggability from them and use only buttons. With this kind of layout one could use hardware buttons for play/pause, mute or whatnot (but I'm not that sure about that personally, but just an idea based on other ongoing discussions).

After all this there is quite a lot of space for buttons?

image

Doughboy68 commented 1 year ago

How about a popup screen containing the presets like how the keypad or notification works? Issue with these presets is if controlling multiple players they would probably share the same screen with these presets (eg. how sensors/buttons are set in climate screen). But ideally one would have a panel for each room/player so not an issue.

edwardtfn commented 1 year ago

You are right. Buttons are globals, so a pop up screen makes more sense, but still needing development of components to support the different controls.

edwardtfn commented 1 year ago

By the way, do you have those playlists in some of the attributes of your media_player entity?

quenthal commented 1 year ago

By the way, do you have those playlists in some of the attributes of your media_player entity?

No. I'm mostly using Spotify playlists, copied from Spotify itself as urls.

EDIT: Just checked, that atleast Sonos provides Sonos' app's own favorites with predefined ways to address them thry media_content_id, but never used those. There seems to be even sensor for favorites one could point to. But I prefer to manage my music in spotify, Tidal, Soundcloud etc., I think it would be more media_player agnostic this way also.

luckyzor commented 11 months ago

hello all, is this media player feature working? as I see some screenshots I would like to test it.

thanks

edwardtfn commented 10 months ago

Yest, média player is working. Try it, and let us know if you have any issue,

luckyzor commented 10 months ago

I have 2 NS Panels (ordered more 6) and wondering the firmware I will use. Started by install the nspanel manager (its really great to manage multiple nspanels, but is very limited), flashed the nspanel lovelace and I will install this one today or tomorrow and test both side by side with media player.

Doughboy68 commented 10 months ago

NSPanel Lovelace seemed nice looking but I did not like the performance vs. Blueprint.