You could try array.reduce().
e.g
[{"id":"7e035f31.28645","type":"inject","z":"30af2d3e.d94ea2","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[{\"entity_id\":\"sensor.mobile_quizzical_mobile_data_consumed_since_reboot\",\"state\":\"0.05\",\"attributes\":{\"state_class\":\"total_increasing\",\"unit_of_measurement\":\"GB\",\"friendly_name\":\"Mobile quizzical mobile data consumed since reboot\"},\"last_changed\":\"2022-07-31T16:09:24.574000+00:00\",\"last_updated\":\"2022-07-31T16:09:24.574000+00:00\"},{\"entity_id\":\"sensor.mobile_quizzical_mobile_data_consumed_since_reboot\",\"state\":\"0.051\",\"attributes\":{\"state_class\":\"total_increasing\",\"unit_of_measurement\":\"GB\",\"friendly_name\":\"Mobile quizzical mobile data consumed since reboot\"},\"last_changed\":\"2022-07-31T16:27:45.603872+00:00\",\"last_updated\":\"2022-07-31T16:27:45.603872+00:00\"},{\"entity_id\":\"sensor.mobile_quizzical_mobile_data_consumed_since_reboot\",\"state\":\"0.0\",\"attributes\":{\"state_class\":\"total_increasing\",\"unit_of_measurement\":\"GB\",\"friendly_name\":\"Mobile quizzical mobile data consumed since reboot\"},\"last_changed\":\"2022-07-31T16:31:41.465519+00:00\",\"last_updated\":\"2022-07-31T16:31:41.465519+00:00\"},{\"entity_id\":\"sensor.mobile_quizzical_mobile_data_consumed_since_reboot\",\"state\":\"0.008\",\"attributes\":{\"state_class\":\"total_increasing\",\"unit_of_measurement\":\"GB\",\"friendly_name\":\"Mobile quizzical mobile data consumed since reboot\"},\"last_changed\":\"2022-07-31T17:07:51.227835+00:00\",\"last_updated\":\"2022-07-31T17:07:51.227835+00:00\"}]","payloadType":"json","x":140,"y":80,"wires":[["b74c19f4.89b1c8"]]},{"id":"b74c19f4.89b1c8","type":"function","z":"30af2d3e.d94ea2","name":"","func":"msg.payload = msg.payload.reduce((acc, obj) => {\n let value = Number(obj.state);\n if(value < acc.total){\n acc = {total:0,arr:[obj]};\n }else{\n acc.total = value;\n acc.arr.push(obj);\n }\n return acc;\n},{total:0,arr:[]}).arr\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":290,"y":80,"wires":[["80ffef4f.bd11"]]},{"id":"80ffef4f.bd11","type":"debug","z":"30af2d3e.d94ea2","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":590,"y":200,"wires":[]}]
msg.payload = msg.payload.reduce((acc, obj) => { // iterates through
//payload array setting each element in turn to obj
// acc will be the output
let value = Number(obj.state); // changes obj.state to a number
if(value < acc.total){ // check to see if new state is lower than last
acc = {total:0,arr:[obj]}; // sets acc to object, wiping values
}else{ // otherwise
acc.total = value; // sets acc.total to save last value
acc.arr.push(obj); // pushes obj to acc
}
return acc; // returns acc ready for next array element
},{total:0,arr:[]} // initialises acc to an object with 2 properties
).arr // output just the array from the object returned
return msg;
Every time the state drops below the previous the previous are deleted.