How to use current_power_w attribute in node red?

I have a switch (switch.centralite_outlet_1) that has power monitoring and I want to use its value in a nodered automation. How can I retrieve the “current_power_w” attribute inside a switch node?

image

Thanks in advance

1 Like

This is a really beginner question.

Here you can see I am posting the output of a HA Current State Node to a Debug Node.

If you expand the Debug node, and click the arrows, you can expand to find attributes.

Find the attribute you want and click on the little “terminal operator” icon on the right to copy the path.

Paste that path at the top of the Switch Node.

2 Likes

I’ve just tried this with my smartthings outlet.
All I get from the output of the state node is a string in the debug window - no “object” to unfold as you show.

1 Like

Hi Derek, did you ever workout how to do this? I’m in the same situation. I can read the “state” of HA sensors etc just fine. I can’t work out how to read the numeric values of power sensors so I can include in a notification. I’ve spent hours searching and just can’t get a straight answer.

UPDATE: Managed to sort it out. I used a Function Node with the following content:

var energy = global.get('homeassistant.homeAssistant.states["sensor.tasmota_energy_today"].state');

msg.energy = energy;

return msg;

This allowed me to use “msg.energy” later on in my flow to insert the energy used into a Pushover notification.