Extract multiple variables from a JSON object

Hi,

Please could someone help me to extract a number of variable values from a JSON object returned by my home automation controller - please see screen shot attached

To start with I’m looking to extract the values you can see opened, I’ve tried a functions with variations of msg.payload[0][0][0] but I only get errors. A kick in the right direction would be appreciated (many thanks)

Extract of JSON below.

{ "Device_Num_22": { "states": [ { "id": 167, "service": "urn:upnp-org:serviceId:SwitchPower1", "variable": "Status", "value": "0" }, { "id": 168, "service": "urn:upnp-org:serviceId:Dimming1", "variable": "LoadLevelStatus", "value": "0" }, { "id": 169, "service": "urn:upnp-org:serviceId:Dimming1", "variable": "LoadLevelTarget", "value": "0" }, { "id": 170, "service": "urn:micasaverde-com:serviceId:HaDevice1", "variable": "Configured", "value": "1" }, { "id": 171, "service": "urn:micasaverde-com:serviceId:HaDevice1", "variable": "LastUpdate", "value": "1455968462" }, { "id": 172, "service": "urn:micasaverde-com:serviceId:HaDevice1", "variable": "FirstConfigured", "value": "1341655010" }, { "id": 173, "service": "urn:micasaverde-com:serviceId:HaDevice1", "variable": "CommFailure", "value": "1" }, { "id": 174, "service": "urn:micasaverde-com:serviceId:ZWaveDevice1", "variable": "Capabilities", "value": "211,156,0,4,17,1,L,R,B,RS,|38:1,39,112,114,115,133,134,142," }, { "id": 175, "service": "urn:micasaverde-com:serviceId:ZWaveDevice1", "variable": "ManufacturerInfo", "value": "271,256,262" }, { "id": 176, "service": "urn:micasaverde-com:serviceId:ZWaveDevice1", "variable": "VersionInfo", "value": "3,3,34,1,6" }, { "id": 177, "service": "urn:micasaverde-com:serviceId:ZWaveDevice1", "variable": "NodeInfo", "value": "26,27,70,72,73,85,86,8e," }, { "id": 178, "service": "urn:micasaverde-com:serviceId:ZWaveDevice1", "variable": "ConfiguredAssoc", "value": "" }, { "id": 179, "service": "urn:micasaverde-com:serviceId:ZWaveDevice1", "variable": "PollSettings", "value": "60" }, { "id": 180, "service": "urn:micasaverde-com:serviceId:ZWaveDevice1", "variable": "Neighbors", "value": "1,10,37,41," }, { "id": 181, "service": "urn:micasaverde-com:serviceId:ZWaveDevice1", "variable": "LastReset", "value": "1455968460" }, { "id": 182, "service": "urn:micasaverde-com:serviceId:ZWaveDevice1", "variable": "AssociationNum", "value": "3" }, { "id": 183, "service": "urn:micasaverde-com:serviceId:ZWaveDevice1", "variable": "PollOk", "value": "9" }, { "id": 184, "service": "urn:micasaverde-com:serviceId:ZWaveDevice1", "variable": "LastRouteUpdate", "value": "1538138819" }, { "id": 185, "service": "urn:micasaverde-com:serviceId:ZWaveDevice1", "variable": "VariablesSet", "value": "14,1d,1" }, { "id": 186, "service": "urn:micasaverde-com:serviceId:ZWaveDevice1", "variable": "VariablesGet", "value": "14,1," }, { "id": 187, "service": "urn:micasaverde-com:serviceId:ZWaveDevice1", "variable": "SensorMlType", "value": "" }, { "id": 188, "service": "urn:micasaverde-com:serviceId:ZWaveDevice1", "variable": "SensorMlScale", "value": "" }, { "id": 189, "service": "urn:micasaverde-com:serviceId:ZWaveDevice1", "variable": "NeighborsInverse", "value": "" }, { "id": 190, "service": "urn:micasaverde-com:serviceId:ZWaveDevice1", "variable": "Health", "value": "" }, { "id": 191, "service": "urn:micasaverde-com:serviceId:ZWaveDevice1", "variable": "AutoRoute", "value": "0-5x,10-15,26-15,20-16" }, { "id": 192, "service": "urn:micasaverde-com:serviceId:ZWaveDevice1", "variable": "AllRoutesFailed", "value": "0" }, { "id": 193, "service": "urn:micasaverde-com:serviceId:ZWaveDevice1", "variable": "MultiChEndpoint", "value": "" }, { "id": 194, "service": "urn:micasaverde-com:serviceId:ZWaveDevice1", "variable": "MultiChCapabilities", "value": "" }, { "id": 195, "service": "urn:micasaverde-com:serviceId:ZWaveDevice1", "variable": "ConfiguredName", "value": "" }, { "id": 196, "service": "urn:micasaverde-com:serviceId:ZWaveDevice1", "variable": "MeterType", "value": "" }, { "id": 197, "service": "urn:micasaverde-com:serviceId:ZWaveDevice1", "variable": "MeterScale", "value": "" }, { "id": 198, "service": "urn:micasaverde-com:serviceId:ZWaveDevice1", "variable": "SetPointInfo", "value": "" }, { "id": 199, "service": "urn:micasaverde-com:serviceId:ZWaveDevice1", "variable": "PollTxFail", "value": "" }, { "id": 200, "service": "urn:micasaverde-com:serviceId:ZWaveDevice1", "variable": "HealthDate", "value": "1443490454" }, { "id": 201, "service": "urn:micasaverde-com:serviceId:ZWaveDevice1", "variable": "ConfiguredVariable", "value": "14,1d,1" }, { "id": 202, "service": "urn:micasaverde-com:serviceId:ZWaveDevice1", "variable": "PollNoReply", "value": "15" }, { "id": 203, "service": "urn:micasaverde-com:serviceId:ZWaveDevice1", "variable": "LastWakeup", "value": "1491467301" }, { "id": 204, "service": "urn:upnp-org:serviceId:TemperatureSetpoint1_Heat", "variable": "CurrentSetpoint", "value": "21" } ], "Jobs": [ ], "tooltip": { "display": 0 }, "status": -1 }, "LoadTime": 1537623966, "DataVersion": 624293835, "UserData_DataVersion": 623966640, "TimeStamp": 1538157549, "ZWaveStatus": 1, "LocalTime": "2018-09-28 18:59:09 N" }

I’m working on an idea that I could extract specific variables from calls made to my HA controler and then use them in some text to speech flows i’m working on too.

The docs have a guide on understanding the structure of a message: https://nodered.org/docs/user-guide/messages#understanding-the-structure-of-a-message

In particular, it explains how the debug sidebar can be used to get the full path to any message element copied straight to your clipboard.

Nick

1 Like

Thanks Nick

I recall looking at this now,

One point of feedback, on the above feature is that these buttons do not seem to work on my iPad with Safari, I’ve tried numerous times but it would not appear in the clipboard.

Ok, the above works for one value, but I missed a key point in my question above, in that I will be calling different devices, so the example above is device 22, is there a wild card that can be used for the first part, so I can run different JSON calls via the same function ?

if you google “javascript wildcard” you’ll find loads of tutorials that will help you

What do you get as output if you inject your msg.payload to this change node ?

r-01

[{"id":"c28f4e65.7b03f","type":"tab","label":"Flow 7","disabled":false,"info":""},{"id":"78dc82cc.d458bc","type":"change","z":"c28f4e65.7b03f","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"**.states[18].value","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":340,"y":160,"wires":[[]]}]

Unfortunately, Safari is a long way behind current standards I think. Also security is different on mobile devices.

Many thanks @Andrei, that looks good and seems to do the trick nicely :grin:.

I had looked up various things online about how to do javascript wildcards; but as I’m not a programmer - it talked about regex and other things, which I struggle with to apply - I had hoped it would be as simple as an asterix ‘ * ‘ - If I see working examples of how things are done in the area I’m looking to use them - I find I work out and build on things best that way ..

Thanks again

Taking it one step further, I had hoped this would work so I could start dissecting the JSON into individual values I could then work with .. is there a way to do this within a single node ? (I looked at the split node but that does not look like it will help.)

Or is the only way via separate Change nodes?

image

Perhaps it is possible to build another jsonata expression (a little bit more complex). I will give it a try.

Well, just changing the expression as below may achieve both goals: a) use only one node and b) extract the values...

**.states[[18..19]].value

However I am not sure if this will help you at the end of the day. The above will produce an array with the extracted values but you will not know to which Device_Num and state the values are associated.

As a matter of fact there are other possible solutions but the best one will ultimately depend on how you will process the information downstream. Also I am not sure that you will always want to extract the values from status[18] and status[19]. If you change this requirement you will need to come up with a new jsonata expression. Perhaps if you restate your requirements in a broader way (by saying all that you may ever need to extract and how you will process it later on) then we may realize how to transform the original dataset to easy the solution.

Thanks again for your help on this @Andrei

What I’m trying to do is create a (human understandable) device report / health message, one that can either be sent out via email, or a notification (Prowl) or spoken (via text to speech).

So on demand I can then request (or schedule) a specific device name/number to be called - and the flow would then extract the required variable values to populate key parts of the health message.

Hi - resurfacing an old one of mine to ask the question if it's possible (based on the JSON being returned (see first post) to search for "variables" by name, and have its associated "value" returned ?

Example; lets say I want to know the value associated with for the "LastWakeUp" variable ?

(Due to the different types of devices available, the object numbers that are assigned to the JSON that's returned in NR could be different, but the variable name seems to be consistant - so searching by names could be better - if possible to do ?)

Quick bodge way of doing it
Scan the JSON to find mention of LastWakeup and then output the next item

[{"id":"66476e1b.c9162","type":"inject","z":"58f97b48.255ef4","name":"","topic":"","payload":"{ \"Device_Num_22\": { \"states\": [ { \"id\": 167, \"service\": \"urn:upnp-org:serviceId:SwitchPower1\", \"variable\": \"Status\", \"value\": \"0\" }, { \"id\": 168, \"service\": \"urn:upnp-org:serviceId:Dimming1\", \"variable\": \"LoadLevelStatus\", \"value\": \"0\" }, { \"id\": 169, \"service\": \"urn:upnp-org:serviceId:Dimming1\", \"variable\": \"LoadLevelTarget\", \"value\": \"0\" }, { \"id\": 170, \"service\": \"urn:micasaverde-com:serviceId:HaDevice1\", \"variable\": \"Configured\", \"value\": \"1\" }, { \"id\": 171, \"service\": \"urn:micasaverde-com:serviceId:HaDevice1\", \"variable\": \"LastUpdate\", \"value\": \"1455968462\" }, { \"id\": 172, \"service\": \"urn:micasaverde-com:serviceId:HaDevice1\", \"variable\": \"FirstConfigured\", \"value\": \"1341655010\" }, { \"id\": 173, \"service\": \"urn:micasaverde-com:serviceId:HaDevice1\", \"variable\": \"CommFailure\", \"value\": \"1\" }, { \"id\": 174, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"Capabilities\", \"value\": \"211,156,0,4,17,1,L,R,B,RS,|38:1,39,112,114,115,133,134,142,\" }, { \"id\": 175, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"ManufacturerInfo\", \"value\": \"271,256,262\" }, { \"id\": 176, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"VersionInfo\", \"value\": \"3,3,34,1,6\" }, { \"id\": 177, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"NodeInfo\", \"value\": \"26,27,70,72,73,85,86,8e,\" }, { \"id\": 178, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"ConfiguredAssoc\", \"value\": \"\" }, { \"id\": 179, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"PollSettings\", \"value\": \"60\" }, { \"id\": 180, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"Neighbors\", \"value\": \"1,10,37,41,\" }, { \"id\": 181, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"LastReset\", \"value\": \"1455968460\" }, { \"id\": 182, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"AssociationNum\", \"value\": \"3\" }, { \"id\": 183, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"PollOk\", \"value\": \"9\" }, { \"id\": 184, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"LastRouteUpdate\", \"value\": \"1538138819\" }, { \"id\": 185, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"VariablesSet\", \"value\": \"14,1d,1\" }, { \"id\": 186, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"VariablesGet\", \"value\": \"14,1,\" }, { \"id\": 187, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"SensorMlType\", \"value\": \"\" }, { \"id\": 188, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"SensorMlScale\", \"value\": \"\" }, { \"id\": 189, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"NeighborsInverse\", \"value\": \"\" }, { \"id\": 190, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"Health\", \"value\": \"\" }, { \"id\": 191, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"AutoRoute\", \"value\": \"0-5x,10-15,26-15,20-16\" }, { \"id\": 192, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"AllRoutesFailed\", \"value\": \"0\" }, { \"id\": 193, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"MultiChEndpoint\", \"value\": \"\" }, { \"id\": 194, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"MultiChCapabilities\", \"value\": \"\" }, { \"id\": 195, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"ConfiguredName\", \"value\": \"\" }, { \"id\": 196, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"MeterType\", \"value\": \"\" }, { \"id\": 197, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"MeterScale\", \"value\": \"\" }, { \"id\": 198, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"SetPointInfo\", \"value\": \"\" }, { \"id\": 199, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"PollTxFail\", \"value\": \"\" }, { \"id\": 200, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"HealthDate\", \"value\": \"1443490454\" }, { \"id\": 201, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"ConfiguredVariable\", \"value\": \"14,1d,1\" }, { \"id\": 202, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"PollNoReply\", \"value\": \"15\" }, { \"id\": 203, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"LastWakeup\", \"value\": \"1491467301\" }, { \"id\": 204, \"service\": \"urn:upnp-org:serviceId:TemperatureSetpoint1_Heat\", \"variable\": \"CurrentSetpoint\", \"value\": \"21\" } ], \"Jobs\": [ ], \"tooltip\": { \"display\": 0 }, \"status\": -1 }, \"LoadTime\": 1537623966, \"DataVersion\": 624293835, \"UserData_DataVersion\": 623966640, \"TimeStamp\": 1538157549, \"ZWaveStatus\": 1, \"LocalTime\": \"2018-09-28 18:59:09 N\" }","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":100,"wires":[["8dda075f.df1c38"]]},{"id":"529f7bd2.e07384","type":"debug","z":"58f97b48.255ef4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":870,"y":100,"wires":[]},{"id":"8dda075f.df1c38","type":"json","z":"58f97b48.255ef4","name":"","property":"payload","action":"str","pretty":false,"x":290,"y":100,"wires":[["bb5ea8d3.c3fa28"]]},{"id":"bb5ea8d3.c3fa28","type":"csv","z":"58f97b48.255ef4","name":"","sep":",","hdrin":"","hdrout":"","multi":"one","ret":"\\n","temp":"","skip":"0","x":430,"y":100,"wires":[["c2fbbd39.1352c"]]},{"id":"a6a2796e.564c58","type":"switch","z":"58f97b48.255ef4","name":"","property":"last","propertyType":"flow","rules":[{"t":"eq","v":"variable:LastWakeup","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":730,"y":100,"wires":[["529f7bd2.e07384"]]},{"id":"c2fbbd39.1352c","type":"function","z":"58f97b48.255ef4","name":"","func":"var j, newmsg;\n\n\nvar j_list = (msg['payload']);\nfor (var j_index in j_list) {\n  j = j_list[j_index];\n  newmsg={};\n  newmsg['payload'] = j;\n  flow.set('last', (flow.get('current')));\n  flow.set('current', (newmsg['payload']));\n  node.send([newmsg]);\n}\n","outputs":1,"noerr":0,"x":570,"y":100,"wires":[["a6a2796e.564c58"]]}]

Well, your original data didn't have that property (which is the correct term for what you are calling "variable").

However, if you wanted to get all of the variable properties :wink: from Device_Num_22, you could use:

Device_Num_22.*.variable

Or if you want that property from ALL devices as a single list:

*.*.variable
1 Like

Updated my bodge to use payload.*.*.* to produce a clean array of the data instead of the csv and split nodes

[{"id":"66476e1b.c9162","type":"inject","z":"58f97b48.255ef4","name":"","topic":"","payload":"{ \"Device_Num_22\": { \"states\": [ { \"id\": 167, \"service\": \"urn:upnp-org:serviceId:SwitchPower1\", \"variable\": \"Status\", \"value\": \"0\" }, { \"id\": 168, \"service\": \"urn:upnp-org:serviceId:Dimming1\", \"variable\": \"LoadLevelStatus\", \"value\": \"0\" }, { \"id\": 169, \"service\": \"urn:upnp-org:serviceId:Dimming1\", \"variable\": \"LoadLevelTarget\", \"value\": \"0\" }, { \"id\": 170, \"service\": \"urn:micasaverde-com:serviceId:HaDevice1\", \"variable\": \"Configured\", \"value\": \"1\" }, { \"id\": 171, \"service\": \"urn:micasaverde-com:serviceId:HaDevice1\", \"variable\": \"LastUpdate\", \"value\": \"1455968462\" }, { \"id\": 172, \"service\": \"urn:micasaverde-com:serviceId:HaDevice1\", \"variable\": \"FirstConfigured\", \"value\": \"1341655010\" }, { \"id\": 173, \"service\": \"urn:micasaverde-com:serviceId:HaDevice1\", \"variable\": \"CommFailure\", \"value\": \"1\" }, { \"id\": 174, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"Capabilities\", \"value\": \"211,156,0,4,17,1,L,R,B,RS,|38:1,39,112,114,115,133,134,142,\" }, { \"id\": 175, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"ManufacturerInfo\", \"value\": \"271,256,262\" }, { \"id\": 176, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"VersionInfo\", \"value\": \"3,3,34,1,6\" }, { \"id\": 177, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"NodeInfo\", \"value\": \"26,27,70,72,73,85,86,8e,\" }, { \"id\": 178, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"ConfiguredAssoc\", \"value\": \"\" }, { \"id\": 179, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"PollSettings\", \"value\": \"60\" }, { \"id\": 180, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"Neighbors\", \"value\": \"1,10,37,41,\" }, { \"id\": 181, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"LastReset\", \"value\": \"1455968460\" }, { \"id\": 182, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"AssociationNum\", \"value\": \"3\" }, { \"id\": 183, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"PollOk\", \"value\": \"9\" }, { \"id\": 184, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"LastRouteUpdate\", \"value\": \"1538138819\" }, { \"id\": 185, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"VariablesSet\", \"value\": \"14,1d,1\" }, { \"id\": 186, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"VariablesGet\", \"value\": \"14,1,\" }, { \"id\": 187, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"SensorMlType\", \"value\": \"\" }, { \"id\": 188, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"SensorMlScale\", \"value\": \"\" }, { \"id\": 189, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"NeighborsInverse\", \"value\": \"\" }, { \"id\": 190, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"Health\", \"value\": \"\" }, { \"id\": 191, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"AutoRoute\", \"value\": \"0-5x,10-15,26-15,20-16\" }, { \"id\": 192, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"AllRoutesFailed\", \"value\": \"0\" }, { \"id\": 193, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"MultiChEndpoint\", \"value\": \"\" }, { \"id\": 194, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"MultiChCapabilities\", \"value\": \"\" }, { \"id\": 195, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"ConfiguredName\", \"value\": \"\" }, { \"id\": 196, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"MeterType\", \"value\": \"\" }, { \"id\": 197, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"MeterScale\", \"value\": \"\" }, { \"id\": 198, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"SetPointInfo\", \"value\": \"\" }, { \"id\": 199, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"PollTxFail\", \"value\": \"\" }, { \"id\": 200, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"HealthDate\", \"value\": \"1443490454\" }, { \"id\": 201, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"ConfiguredVariable\", \"value\": \"14,1d,1\" }, { \"id\": 202, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"PollNoReply\", \"value\": \"15\" }, { \"id\": 203, \"service\": \"urn:micasaverde-com:serviceId:ZWaveDevice1\", \"variable\": \"LastWakeup\", \"value\": \"1491467301\" }, { \"id\": 204, \"service\": \"urn:upnp-org:serviceId:TemperatureSetpoint1_Heat\", \"variable\": \"CurrentSetpoint\", \"value\": \"21\" } ], \"Jobs\": [ ], \"tooltip\": { \"display\": 0 }, \"status\": -1 }, \"LoadTime\": 1537623966, \"DataVersion\": 624293835, \"UserData_DataVersion\": 623966640, \"TimeStamp\": 1538157549, \"ZWaveStatus\": 1, \"LocalTime\": \"2018-09-28 18:59:09 N\" }","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":100,"wires":[["1297fe8a.84eac1"]]},{"id":"529f7bd2.e07384","type":"debug","z":"58f97b48.255ef4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":770,"y":100,"wires":[]},{"id":"a6a2796e.564c58","type":"switch","z":"58f97b48.255ef4","name":"","property":"last","propertyType":"flow","rules":[{"t":"eq","v":"LastWakeup","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":630,"y":100,"wires":[["529f7bd2.e07384"]]},{"id":"c2fbbd39.1352c","type":"function","z":"58f97b48.255ef4","name":"","func":"var j, newmsg;\n\n\nvar j_list = (msg['payload']);\nfor (var j_index in j_list) {\n  j = j_list[j_index];\n  newmsg={};\n  newmsg['payload'] = j;\n  flow.set('last', (flow.get('current')));\n  flow.set('current', (newmsg['payload']));\n  node.send([newmsg]);\n}\n","outputs":1,"noerr":0,"x":490,"y":100,"wires":[["a6a2796e.564c58"]]},{"id":"1297fe8a.84eac1","type":"change","z":"58f97b48.255ef4","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.*.*.*","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":100,"wires":[["c2fbbd39.1352c"]]}]

Thanks @cymplecy

Hi, I have a similar problem. Can you help me please how can I extract "teplota" to graph? my json file looks like this:

({"teplota":7.85159,"vlhkost":73.5749,"oblacnost":0,"vietor":0,"tlak":1029.28,"smer":"JZ","pocitovo":6.32,"pocasie":"01d","vychod":"06:37","zapad":"17:15","cas":"Pondelok 22.2. 17:09","zrazky24":0});

Is your data actually in parenthesizes? Where did you get that data from?
If that is from a debug node, can you show the entire output.

here is my debug:
{"topic":"meteostanica","payload":"({\"teplota\":2.10504,\"vlhkost\":91.7815,\"oblacnost\":0,\"vietor\":0,\"tlak\":1032.47,\"smer\":\"JZ\",\"pocitovo\":0.12,\"pocasie\":\"01n\",\"vychod\":\"06:37\",\"zapad\":\"17:15\",\"cas\":\"Pondelok 22.2. 21:37\",\"zrazky24\":0});","statusCode":200,"headers":{"server":"nginx","date":"Mon, 22 Feb 2021 20:37:27 GMT","content-type":"application/json","transfer-encoding":"chunked","connection":"close","x-powered-by":"PHP/7.3.17","x-node-red-request-node":"35516f00"},"responseUrl":"http://meteosasova.sk/bbo_api.php","redirectList":[],"parts":{"id":"f493c65f.a65c48","type":"string","ch":"\n","index":2,"count":3},"_msgid":"9eca6895.a904f8","label":"sasova"}

and here is my complete flow:

[{"id":"1a2d781c.46fa4","type":"tab","label":"Weather","disabled":false,"info":""},{"id":"e275a8a5.6029b8","type":"inject","z":"1a2d781c.46fa4","name":"make request","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":"","x":100,"y":80,"wires":[["aaf7ab1c.57a3e"]]},{"id":"25dd6728.b352c8","type":"debug","z":"1a2d781c.46fa4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":880,"y":120,"wires":[]},{"id":"aaf7ab1c.57a3e","type":"http request","z":"1a2d781c.46fa4","name":"","method":"GET","ret":"txt","paytoqs":false,"url":"http://meteosasova.sk/bbo_api.php","tls":"","persist":false,"proxy":"","authType":"","x":190,"y":30,"wires":[["da84b8a7.59e13"]]},{"id":"71a1ee05.00e1f","type":"json","z":"1a2d781c.46fa4","name":"","property":"payload","action":"str","pretty":true,"x":340,"y":120,"wires":[["429836e1.7d4568"]]},{"id":"429836e1.7d4568","type":"file","z":"1a2d781c.46fa4","name":"chart","filename":"homie/homey-5ac5f38e42b2c4296e150d77/tester","appendNewline":false,"createDir":true,"overwriteFile":"true","x":460,"y":130,"wires":[["af7ad592.ac9f18"]]},{"id":"2f80eb1c.584794","type":"file in","z":"1a2d781c.46fa4","name":"chart","filename":"homie/homey-5ac5f38e42b2c4296e150d77/tester","format":"utf8","chunk":false,"sendError":false,"encoding":"none","x":590,"y":70,"wires":[["a5e9bc66.d78a7"]]},{"id":"714e54e1.d9d134","type":"inject","z":"1a2d781c.46fa4","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":590,"y":20,"wires":[["2f80eb1c.584794"]]},{"id":"af7ad592.ac9f18","type":"debug","z":"1a2d781c.46fa4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":470,"y":180,"wires":[]},{"id":"ed17743.b16b308","type":"ui_chart","z":"1a2d781c.46fa4","name":"","group":"8ac23c9c.86f8a8","order":13,"width":0,"height":0,"label":"chart","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":880,"y":50,"wires":[[]]},{"id":"44e5ee4.4aba71","type":"change","z":"1a2d781c.46fa4","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"meteostanica","tot":"str"},{"t":"set","p":"label","pt":"msg","to":"sasova","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":80,"wires":[["71a1ee05.00e1f"]]},{"id":"a5e9bc66.d78a7","type":"change","z":"1a2d781c.46fa4","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"meteostanica","tot":"str"},{"t":"set","p":"label","pt":"msg","to":"sasova","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":740,"y":80,"wires":[["ed17743.b16b308","25dd6728.b352c8"]]},{"id":"da84b8a7.59e13","type":"split","z":"1a2d781c.46fa4","name":"","splt":"\\n","spltType":"str","arraySplt":"1","arraySpltType":"len","stream":false,"addname":"payload","x":350,"y":30,"wires":[["44e5ee4.4aba71"]]},{"id":"8ac23c9c.86f8a8","type":"ui_group","z":"","name":"Outside weather","tab":"98a2ef12.9e1df","order":1,"disp":false,"width":21,"collapse":false},{"id":"98a2ef12.9e1df","type":"ui_tab","z":"","name":"Weather","icon":"fa-sun-o","order":5,"disabled":false,"hidden":false}]

Please don't open another thread when you have already started a thread about this. I am closing this thread as it is two years old.