Automation condition from Sonos Input

I’ve got a Sonos sound bar and am trying to get a pico remote to do different things depending on whether Sonos is playing or the tv is on. Theres a sensor that displays the input format that I’m trying to use as the condition but I can’t figure out how to use it. Would it be state with the sensor entity or is there something under Device that I’m missing?

Thanks for any recommendations.

Hard to comment without seeing the yaml, but as a general rule you should always use entity states if you can.

I don’t have any yaml yet, I was sure where to start. I have the below sensor how would I write a conditional where the sensor state is PCM 2.0? Also, sensor state is not PCM 2.0.

You probably want to use the source attribute of the media_player entity. so a condition looking at the source would be something like:

- condition: state
  entity_id: media_player.living_room
  attribute: source
  state: 'TV'

That is what I am looking for thank you for the help.