I am new to Node Red. I can pull the state of an entity, but I still don’t know how to pull different attributes. For example, my debug node shows the TV’s source attribute
is set to “CC”. What do I need in my flow to react based on whether media_player.lg_tv’s “source” is “CC”? How do I pass that data around, read it, and then react to it?
You probably have to listen to the msg.data.source
You can always copy the correct path with the little button i highlighted in the image below
You can then employ this in a switch node like Codec303 advised or even use a function node or any other node that lets you specify a specific message.
A function node allows you to do anything you want with the data. A switch node literally just passes the data based on the switch settings.
You can use function nodes to add information to the message object or create the notification message all in one node without having to create an entire long flow just to pass a notification to a service (telegram for instance)
I want the attributes element “fet temperature F” to be output on the first output of the switch node.
Where do I put the path of that element in the switch node?
Incase you need it again… You can get an attribute right from the Event State node without using a switch node or doing extra steps and you can compare it as well.