How to read type of media playing?

Is there a way to get the media type/source from the media player and use this as a condition in automations?

My use case is this: I wanted to build an automation that dims the lights when i start playing something on Netflix, and turn them on again when the movie is done. So I built an automation that triggers on my media player (chromecast) changing state to/from “playing”. But this is also triggered when I stream Spotify to it, causing the lights to flash between songs, which I’d like to avoid. Dinner guests are not impressed.

While you playing Netflix, what is the media_content_id resp. media_title ? ( Dev Tools —> states —> your media_player)

Even better, there’s an attribute app_name which worked great! :slight_smile:

  - condition: not
      - condition: state
        entity_id: media_player.living_room_tv
        state: Spotify
        attribute: app_name