Checking attribute of an unrelated entity [SOLVED]

Hi!
I’m trying to create a simple automation with Node Red, but I can’t figure out the right logic to use. On a purely logical format, it should look like this:

Detecting the Shield’s state is easy, as is using the Harmony remote. But how do I import an attribute of an entity to check its status? I have it correctly displaying on a dashboard (media_player.onkyo_receiver, attribute = source), but I can only seem to surface the entity in Node Red.

TIA.

The way your doing it is correct, but you need to find out the correct path to your source. To do that, just connect a debug node to the current_state check. Set that debug node to show complete message and the investigate the message and copy the correct path into your switch node.

1 Like

Thanks very much, Marcus! I’ll give it a go.

here is an example. You can copy the path directly from the debug window. In my case its:
msg.data.attributes.source

That worked perfectly. And, ironically, it was exactly the same attribute name: msg.data.attributes.source.

Thanks again for your help.

Glad to hear! That the message is the same, is to be expected, as the media_players in HA all have the same layout :). On thing to note: Depending if you use the current_state node or the entity_state node you might see some additional messages: new_state and old_state. Then the path will be different.