How to get ceratin valus out of a string and use them for logic

Hi, I would like to use the forecast of an entity in home assistant that is using a public weather service.

What I want to do is use the templow values to define if it will go below 0 degrees to send me a message that it will “freeze” so I can act to protect the water pipes in the garden from freezing.

Is there any example of how to “filter” or “get” these values out of the string?

The output looks like:
{"topic":"weather.city","payload":"cloudy","data":{"entity_id":"weather.city","old_state":{"entity_id":"weather.city","state":"cloudy","attributes":{"temperature":7.1,"humidity":82,"pressure":1013.8,"wind_bearing":301,"wind_speed":22.3,"visibility":23.9,"attribution":"Data provided by buienradar.nl","forecast":[{"datetime":"2021-03-16T00:00:00+01:00","condition":"pouring","templow":4,"temperature":8,"precipitation":5,"wind_bearing":315,"wind_speed":13},{"datetime":"2021-03-17T00:00:00+01:00","condition":"rainy","templow":2,"temperature":8,"precipitation":1,"wind_bearing":0,"wind_speed":13},{"datetime":"2021-03-18T00:00:00+01:00","condition":"pouring","templow":1,"temperature":7,"precipitation":3.5,"wind_bearing":0,"wind_speed":29.6},{"datetime":"2021-03-19T00:00:00+01:00","condition":"partlycloudy","templow":0,"temperature":7,"precipitation":0.5,"wind_bearing":45,"wind_speed":20.4},{"datetime":"2021-03-20T00:00:00+01:00","condition":"partlycloudy","templow":-4,"temperature":7,"precipitation":0,"wind_bearing":45,"wind_speed":13}],"friendly_name":"city"},"last_changed":"2021-03-15T08:21:00.246188+00:00","last_updated":"2021-03-15T08:31:00.271914+00:00","context":{"id":"032f1cf0dde9c6e430b2c237c9995224","parent_id":null,"user_id":null},"original_state":"cloudy","timeSinceChangedMs":1040199},"new_state":{"entity_id":"weather.city","state":"cloudy","attributes":{"temperature":7.1,"humidity":82,"pressure":1013.8,"wind_bearing":301,"wind_speed":22.3,"visibility":23.9,"attribution":"Data provided by buienradar.nl","forecast":[{"datetime":"2021-03-16T00:00:00+01:00","condition":"pouring","templow":4,"temperature":8,"precipitation":5,"wind_bearing":315,"wind_speed":13},{"datetime":"2021-03-17T00:00:00+01:00","condition":"rainy","templow":2,"temperature":8,"precipitation":1,"wind_bearing":0,"wind_speed":13},{"datetime":"2021-03-18T00:00:00+01:00","condition":"pouring","templow":1,"temperature":7,"precipitation":3.5,"wind_bearing":0,"wind_speed":29.6},{"datetime":"2021-03-19T00:00:00+01:00","condition":"partlycloudy","templow":0,"temperature":7,"precipitation":0.5,"wind_bearing":45,"wind_speed":20.4},{"datetime":"2021-03-20T00:00:00+01:00","condition":"partlycloudy","templow":-4,"temperature":7,"precipitation":0,"wind_bearing":45,"wind_speed":13}],"friendly_name":"city"},"last_changed":"2021-03-15T08:21:00.246188+00:00","last_updated":"2021-03-15T08:31:00.271914+00:00","context":{"id":"032f1cf0dde9c6e430b2c237c9995224","parent_id":null,"user_id":null},"original_state":"cloudy","timeSinceChangedMs":1040199}},"_msgid":"f84cfb06.3ddb98"}

I had to hardcode the json, but you just need to replace the JSON.parse(str) with the actual entity.

[{"id":"7e15ad8.98c8c54","type":"function","z":"caebef34.4abf3","name":"","func":"var str = '{\"topic\":\"weather.city\",\"payload\":\"cloudy\",\"data\":{\"entity_id\":\"weather.city\",\"old_state\":{\"entity_id\":\"weather.city\",\"state\":\"cloudy\",\"attributes\":{\"temperature\":7.1,\"humidity\":82,\"pressure\":1013.8,\"wind_bearing\":301,\"wind_speed\":22.3,\"visibility\":23.9,\"attribution\":\"Data provided by buienradar.nl\",\"forecast\":[{\"datetime\":\"2021-03-16T00:00:00+01:00\",\"condition\":\"pouring\",\"templow\":4,\"temperature\":8,\"precipitation\":5,\"wind_bearing\":315,\"wind_speed\":13},{\"datetime\":\"2021-03-17T00:00:00+01:00\",\"condition\":\"rainy\",\"templow\":2,\"temperature\":8,\"precipitation\":1,\"wind_bearing\":0,\"wind_speed\":13},{\"datetime\":\"2021-03-18T00:00:00+01:00\",\"condition\":\"pouring\",\"templow\":1,\"temperature\":7,\"precipitation\":3.5,\"wind_bearing\":0,\"wind_speed\":29.6},{\"datetime\":\"2021-03-19T00:00:00+01:00\",\"condition\":\"partlycloudy\",\"templow\":0,\"temperature\":7,\"precipitation\":0.5,\"wind_bearing\":45,\"wind_speed\":20.4},{\"datetime\":\"2021-03-20T00:00:00+01:00\",\"condition\":\"partlycloudy\",\"templow\":-4,\"temperature\":7,\"precipitation\":0,\"wind_bearing\":45,\"wind_speed\":13}],\"friendly_name\":\"city\"},\"last_changed\":\"2021-03-15T08:21:00.246188+00:00\",\"last_updated\":\"2021-03-15T08:31:00.271914+00:00\",\"context\":{\"id\":\"032f1cf0dde9c6e430b2c237c9995224\",\"parent_id\":null,\"user_id\":null},\"original_state\":\"cloudy\",\"timeSinceChangedMs\":1040199},\"new_state\":{\"entity_id\":\"weather.city\",\"state\":\"cloudy\",\"attributes\":{\"temperature\":7.1,\"humidity\":82,\"pressure\":1013.8,\"wind_bearing\":301,\"wind_speed\":22.3,\"visibility\":23.9,\"attribution\":\"Data provided by buienradar.nl\",\"forecast\":[{\"datetime\":\"2021-03-16T00:00:00+01:00\",\"condition\":\"pouring\",\"templow\":4,\"temperature\":8,\"precipitation\":5,\"wind_bearing\":315,\"wind_speed\":13},{\"datetime\":\"2021-03-17T00:00:00+01:00\",\"condition\":\"rainy\",\"templow\":2,\"temperature\":8,\"precipitation\":1,\"wind_bearing\":0,\"wind_speed\":13},{\"datetime\":\"2021-03-18T00:00:00+01:00\",\"condition\":\"pouring\",\"templow\":1,\"temperature\":7,\"precipitation\":3.5,\"wind_bearing\":0,\"wind_speed\":29.6},{\"datetime\":\"2021-03-19T00:00:00+01:00\",\"condition\":\"partlycloudy\",\"templow\":0,\"temperature\":7,\"precipitation\":0.5,\"wind_bearing\":45,\"wind_speed\":20.4},{\"datetime\":\"2021-03-20T00:00:00+01:00\",\"condition\":\"partlycloudy\",\"templow\":-4,\"temperature\":7,\"precipitation\":0,\"wind_bearing\":45,\"wind_speed\":13}],\"friendly_name\":\"city\"},\"last_changed\":\"2021-03-15T08:21:00.246188+00:00\",\"last_updated\":\"2021-03-15T08:31:00.271914+00:00\",\"context\":{\"id\":\"032f1cf0dde9c6e430b2c237c9995224\",\"parent_id\":null,\"user_id\":null},\"original_state\":\"cloudy\",\"timeSinceChangedMs\":1040199}},\"_msgid\":\"f84cfb06.3ddb98\"} '; \n\nvar json = JSON.parse(str);\nmsg.forecast = json.data.old_state.attributes.forecast;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":310,"y":760,"wires":[["ad860cfe.2a2cd"]]},{"id":"4af4812a.1c35c","type":"inject","z":"caebef34.4abf3","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":110,"y":760,"wires":[["7e15ad8.98c8c54"]]},{"id":"ad860cfe.2a2cd","type":"debug","z":"caebef34.4abf3","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":460,"y":760,"wires":[]}]