How to get state of attribute for a Card

Hey there,

I’m working on my dashboard, and I’m trying to set up icon colors, depending on the output of my LG tv’s source, but I can’t really figure out how to get that state.

So far I’ve only been able to get the state of the TV itself, so On, or Off or whatever. But I can’t get the state of the Source.

I’ve got two tiles, so far, they’re orange if my AppleTV is not in Standby, and my Streamer is not Off. But I want to change that to where if the AppleTV is the source, it turns orange, and my media streamer (called ROON Music) turns grey, and if it’s showing artist info, I want the AppleTV icon to turn gray, and ROON Music icon to turn orange.

How do I go about this?

To get the value of an attribute use state_attr() not states().

HA Doc - Building Templates - States - Attributes