Extract String from Text as result from http-request

I'm pretty new to node red and after accessing my hue devices I want to integrate a myStrom switch which delivers also a temperature value.
Instead of using some palett (node-red-contrib-mystrom
) I also could adress my the switch via http:///temp and therefore I use a http-request and a text output.

In the end it doesn't matter which way I go as the result is the same.

The result looks like this: {"measured":37.62,"compensation":19,"compensated":18.62,"offset":0}

As I want to display the result in a gauge im only interested in the value 19 - everything else needs to be deleted.

How can I achieve that ? Thanks for some hints

You don't need to delete anything. Just use the value of interest in the UI element (or move the property you need to payload using a change node)

If you don't know how to get the correct path to the value of interest - there’s a great page in the docs that will explain how to use the debug panel to find the right path to any data item.

https://nodered.org/docs/user-guide/messages

Is that coloured all red in the debug widow?

If so in the http request node at bottom, set it to return a json object, not a utf8 string. Then use msg.payload.compensation to access the value

though I suspect the actual temp is the compensated property

thanks a lot - that helped

also thanks to the others who replied

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