Media Player Template (like fan and switch and other templates)

Right now we can create fan, switch, cover, and a few other useful entity templates. One template I was surprised to find is missing is a media_player template. Some dumb media players that integrate with HA indirectly (say through Logitech Harmony or an IR blaster) are very difficult to control because it requires using the remote entity and looking up what commands to send to the remote to control secondary devices.

It would be really useful if there was a way to quickly generate any kind of media_player entity using a template. This might solve multiple problems for a lot of different scenarios. Feature-limited players (such as speakers) which have input selection, volume control, and other settings can still benefit, dumb TVs, or just any device that can leverage a subset of whatā€™s traditionally found in a media player device remote.

This would allow me to store a combination of IR remote commands together into a virtual entity, and allow me to make multiple virtual entities from one IR remote. This may sound like an obscure case but it feels like there would very easily be a lot of benefit to others if this sort of template was available.

I totally agree. I also missed such a component when I wanted to integrate a control for the omxplayer. The universal media_player is to limited for such scenarios.

1 Like

Any news on this?

Would be interested in this as well, especially to support the Broadlink component

1 Like

yea it would be great

I would like to integrate AIMP Media Player, it already have web control with alternative web interface but cant integrate with HA yet

Would be really awesome! I was thinking about my own case, where having this type of integration for more complex systems (e.g. smart TV, AVR, BD Player, Apple TV, etc) being treated as single media player would be greatā€¦

Iā€™d like this too. currently, I am using input_boolean entities for power and input_numbers for volume. If I could somehow create a ā€œmedia_playerā€ from those, I could group them better with the custom mini-media-player card.
Then Iā€™d be able to go from this, to this:

mmp

1 Like

So I started to create this myself. Iā€™ve started with the development of the media player template but itā€™s my first real try for creating my own component.

Iā€™m first creating it for my own. So it wonā€™t have all the features but maybe in time I will update it so it can be a complete component.
One off the first problems I get in my situation(using ir remote to create this entity) is what is the state of the media player (off, idle, playing)

I will try to create a custom component that you can test as soon as possible

1 Like

Hereā€™s my first try: https://github.com/Sennevds/media_player.template
I will expand the readme. If you donā€™t know how to work with custom_components wait a little bit before you try this until I have written a explantion how to implement this.

Itā€™s a first implementation so not everything is implemented and probably not everything is implemented the ā€˜rightā€™ way

4 Likes

Okay so maybe Iā€™m dumb but is this pretty much the same thing? https://www.home-assistant.io/integrations/universal/

This requires a existing media_player entity. Iā€™ve created a component that creates a media_player from other entities or services.

1 Like

Universal does not allow you to assign commands for play/pause etc, which is a large limitation if you are trying to use something like a Logitech Harmony hub to control devices.

This is exactly what I was looking for, I was surprised nothing like this existed yet in HA. I need it to integrate my Logitech Harmony hub with some disparate devices, which I can then expose to Alexa via HA Cloud as a media_player.

Have fun with it and if there are any problems or things missing create a issue on github!

2 Likes

Please, add more commands for universal media player