Smartthings 2019 power outlet - acting on current_power_w

Hi there - I have a 2019 Smartthings socket outlet paired with a Smarthings V2 hub. I run Node Red on a Raspberry Pi and HomeAssistant.

The socket device has built in energy monitoring - I can toggle it on and off via the app and obviously in homeassistant from flows in Node Red.

In the past I've found acting on power usage from devices like the Aeotec home energy monitor (Gen5) really easy in Node Red, as they pick up the power output as its main parameter, probably because the device is "simpler" than a mains socket.

So it seems impossible to do the same with this similar feature in the smart-plug.

The smartthings app reports the power usage, and I've managed to get a program called Grafana to display the data from its "property"... called "current_power_w". So it is possible to get data out of the device. However I can't understand how to do it in Node Red.

I obviously want to act on the power usage at various levels using node red logic. I have tried to do this, but unlike energy monitors like the aeotec, Its not so easy.

After trying several methods - I just can't directly access the "attribute" in many node "parameters" drop down boxes to do anything with it - same goes for the function node - I can't seem to access the parameter or find any documentation or Youtube videos of how to do it either.

I've used a "current state node". - I can tell if its "on or off" but not its current power level (current_power_w) - So How do I get to an attribute value and how do I:

  1. access a value and use it in a function and assign it to a variable... like this:
    power = switch.car.attribute.current_power_w;

or

  1. Put it into a "path" in a flow node -
    e.g. to make use of it in a function or in a node process, a switch etc - nothing ever seems to work, one of the only node parameters that showed anything up which gave me a drop down option of the "attributes" in the "wait until" node, I still don't see the value of the wattage passed into the subsequent node which is a debug output which is wired from the current state node.

I did see an answer to this here...

However, when I try to reproduce this - But when I do this, the output going through to the debug isn't an "object" with parameters, its just is a string without a collapsed object output in the debug window....

Many thanks!

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.