Help turning my custom TV streaming PWA into a Home Assistant media player

Hello everyone,

I’m looking for some technical advice and hoping someone here has tackled something similar before.

For my own home use, I’ve built a small Progressive Web App (PWA) that streams live TV channels. It’s just a bunch of HTML/JS, with a simple interface to switch channels and adjust volume – nothing fancy, no public API, just a personal tool I use on my devices.

What I’d really love to do is connect it to Home Assistant so that I can launch channels and control playback through HA automations (e.g., start the morning news with my alarm, or stop playback when I leave the house). I’ve been reading up on custom integrations and the media_player entity, but I’m a bit stuck on how to actually send commands from HA to a plain frontend PWA.

Since there’s no API, I’m guessing I would need to expose some kind of local REST endpoint from within the PWA, or perhaps use WebSocket communication. I’ve also seen mentions of using Fully Kiosk Browser’s “send command” feature or Browser Mod’s javascript injection – could either of those be a practical bridge for this?

I’m not trying to promote anything here, just genuinely want to make my own smart home setup more convenient. If anyone has built something like this before or has a GitHub repo of a similar custom component, I’d be incredibly grateful for a push in the right direction.

Thanks a lot for reading, and I really appreciate any hints!

Disclaimer: I know next to nothing about all this, but I'm aware of another possibility.

The companion app uses Android intents for this type of control. Maybe you could use that for your project?

The Sendspin browser based audio player used by Music Assistant can be targeted in Home Assistant automations. E.g. you can have automations start playback on your phones browser since it is registered as a Music Assistant player.

Maybe you could build Sendspin into the PWA or use similar methods to allow the PWA to be targeted.

Or perhaps the code you've written is half way to a TV plugin for Music Assistant.