Use Chromecast as trigger depending on what's casting

I want to create an automation that’s triggered when one of my Chromecasts is playing Spotify. It should not be triggered when i for example cast Netflix. Is there any way to do this?

Go to Developer Tools → States.

Look at the attributes of your Chromecast media player when playing Spotify and when playing Netflix. Do any of the attributes change (“source” for example).

Yes, when using Spotify, i do have this attribute:
app_name: Spotify

Managed to solve it though turns out LG C8 model can’t be controlled in this way but works fine for my C1 where i don’t need it.
If anyone find this thread looking for a similar solution, here’s what worked:

- id: '1675713563052'
  alias: Spotify - Turn off LG WebOS display
  description: ''
  - platform: state
    entity_id: media_player.vardagsrum
    attribute: app_name
    to: Spotify
      hours: 0
      minutes: 2
      seconds: 0
  - condition: device
    device_id: 1b03cf3fa81779f3b5e5c91b22002d01
    domain: media_player
    entity_id: media_player.oled65c8pla
    type: is_on
  - service: webostv.command
      entity_id: media_player.oled65c8pla
      command: com.webos.service.tvpower/power/turnOffScreen
  mode: single