Automation to change my AMP settings when the TV app changes

I have a Sony TV that is running Android and I what I want to do is when I start a particular App on the TV I want my AMP to change some settings to match it.

Changing the settings on the AMP is easy enough, I am just not sure how to automate working out what App the TV is using.

What trigger do I use, do I use the Device or the Entity, and then what after that?

That is the part that is really confusing.

Thanks

I had a bit of play tonight and got it working.

For some reason my Android TV Remote wasn't updating the app names or ids. Looking at the intergration the MAC address of the TV is just wrong. I deleted the device and it was automatically discovered. Reauthenticated with the PIN and it was then updating the details correctly.

The MAC address is still wrong though.

Anyway with this key piece of the puzzle fixed I found that I use this as my trigger and now I can do what I need to do to change the settings on my AMP.

trigger: state
entity_id:
  - media_player.lounge_tv
attribute: app_name
to:
  - com.netflix.ninja