Get value from JSON http

Trying to get the data of the string “Label1”: [{“text”: “Water level -147.21”, I need to get the value 147.21

JSON response:

{"url":"http://gidrouzel-pnz.ru/monitoring/","result":{"extractorData":{"url":"http://gidrouzel-pnz.ru/monitoring/", "data": [{"group": [ {"Custom": [{"text":"06 апреля 2021 г.","xpath":"/html/body/div[2]/div[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/article[1]/div[1]/div[1]/div[1]/strong[1]/div[1]/div[1]/div[1]/h2[1]"}], "Label 1":[{"text":"Уровень воды -147.21м","xpath":"/html/body/div[2]/div[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/article[1]/div[1]/div[1]/div[2]/strong[1]/div[1]/div[1]/div[1]/div[1]/small[1]"}], "Label 2":[{"text":"Объем воды - 273.36млн. куб. м","xpath":"/html/body/div[2]/div[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/article[1]/div[1]/div[1]/div[2]/strong[1]/div[1]/div[1]/div[1]/div[2]/small[1]"}], "Label 3":[{"text":"Сброс воды - 19.0 куб. м/с","xpath":"/html/body/div[2]/div[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/article[1]/div[1]/div[1]/div[2]/strong[1]/div[1]/div[1]/div[1]/div[3]/small[1]"}], "Label 4":[{"text":"Приточность -126.0 куб. м/с","xpath":"/html/body/div[2]/div[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/article[1]/div[1]/div[1]/div[2]/strong[1]/div[1]/div[1]/div[1]/div[4]/small[1]"}],

I know I need to use the value_template option, but I can’t work out how to parse the JSON correctly.

If I try this:

value_template: "{{ value_json.Custom.Label[1].text }}"

How do I get it to return just the numeric value?

Thanks!

This:

value_template: "{{ value_json.result.extractorData.data[0].group[0]["Label 1"][0].text }}"

Should return:

Уровень воды -147.21м

If you only want the number and the text does not change, try this:

value_template: "{{ value_json.result.extractorData.data[0].group[0]["Label 1"][0].text | replace('Уровень воды ',''}}"

Thank you very much, everything works fine.