Ok I finally have some type of solution
- Icecast2
- Mopidy
- HASS (iframe)
I created a separate VM in ESXI that is running another instance of ubuntu. The only packages installed on this VM are Icecast2, PIP, Mopidy, mopidy-musicbox-webclient, Mopidy-TuneIn
Icecast:
Once you install icecast I had to change the config from “localhost” to 127.0.0.1 for anything to be able to see this server. I left all other settings default because im lazy. Once we have this server instance we make one more by installing mopidy.
Mopidy:
Mopidy is essentially going to do most of the work. This houses my tunein radio, all local media files, (google music and pandora are both possible too) and the search engine is pretty quick in the app.
Uncomment the MPD Section (change hostname to 0.0.0.0)
Uncomment the HTTP Section (change hostname to 0.0.0.0)
Uncomment the AUDIO Section and change OUTPUT to “output = lamemp3enc ! shout2send mount=mopidy.mp3 ip=127.0.0.1 port=8000”
Add Icecast2 password to this section (default is hackme)
This is your MP3 stream that can be used by multiple clients because of icecast.
After this you need to add you web clients and/or plugins (mopidy-musicbox-webclient, Mopidy-TuneIn)
Chromecast:
Basically you just need to set up Mopidy to send a stream to your Icecast server (which allows multiple streams) I did this by creating a template switch that plays the icecast server stream.
media_content_id: "http://192.168.1.192:8000/mopidy.mp3"
media_content_type: "audio/mpeg"
Iframe:
Now that you have a webclient for Mopidy we need to add it to Iframe in HASS. Now your iframe will be on the left side of HASS, You can now play from this section. Once you play music from this section you will need to tell it which speakers to go to by activating one of your switches.
This is the best way that I have found to do this so far. It may not be ideal for everyone but it seems to be working relatively well. I am currently working on a custom panel to see if I can get the chromecast stream switches right above the WebApp. Lets hope it works lol.