Finding media_content_id to cast to chromecast

Hi.

I want to be able to cast a specific Chromecast app. The problem is that I don’t know what data the app needs to cast specific content.

I know the app_id and the internal id of the content for this app, but trying to cast it does only result in the app opening, but no media playing.

  media_content_type: cast
  media_content_id: "{ \"app_id\": \"9C60F407\", \"media_id\": \"56d59c9f236b224052e6\" }"

I tried to inspect what might be sent when I cast from my PC with:

  1. mitmproxy with add root-CA. But I can’t see any HTTP(s) requests for the cast
  2. wireshark, but I can see no data that should contain some of the info I’m looking for.

I assume this is because the cast is encrypted but does not use HTTPs.

Has anyone successfully reverse-engineered what to send an arbitrary Chromecast app? In that case how?

What does Developer Tools > State say when you’re playing whatever content you want to be playing? Also look at the documentation for whatever integration your Chromecast is connected through I suppose. But submitting a media_content_id which in actuality contains a JSON-encoded string does not seem like the “Home Assistant way” to do things.