I worked on the same topic for Zigbee devices. I add a sort the sensor by battery level.
[{"id":"8ca4e8d2.84ae3","type":"inject","z":"a9c3b74b.7a3168","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"86400","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":210,"y":160,"wires":[["51bb149.aa40a6c"]]},{"id":"57dcc0ab.32cfd8","type":"api-call-service","z":"a9c3b74b.7a3168","name":"Notification: Low battery Warning","server":"31f480d3.0e3b28","version":1,"debugenabled":false,"service_domain":"notify","service":"mobile_app_phone","entityId":"","data":"{}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1740,"y":100,"wires":[[]]},{"id":"e42f9b8e.45e3a","type":"function","z":"a9c3b74b.7a3168","name":"Prep Notification","func":"msg.payload = \n{\n \"data\": \n {\n \"title\": \"Low battery Warning\", \n \"message\": msg.payload\n }\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1470,"y":100,"wires":[["57dcc0ab.32cfd8"]]},{"id":"5eb6b271.52402c","type":"debug","z":"a9c3b74b.7a3168","name":"Low battery Warning","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1480,"y":220,"wires":[]},{"id":"f667d0b2.2f4b18","type":"sort","z":"a9c3b74b.7a3168","name":"Sort by battery level","order":"ascending","as_num":false,"target":"","targetType":"seq","msgKey":"","msgKeyType":"elem","seqKey":"payload.state","seqKeyType":"msg","x":860,"y":160,"wires":[["ce46c9e.8e8ac38"]]},{"id":"a57739fe.7143a","type":"split","z":"a9c3b74b.7a3168","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":670,"y":160,"wires":[["f667d0b2.2f4b18"]]},{"id":"51bb149.aa40a6c","type":"ha-get-entities","z":"a9c3b74b.7a3168","server":"31f480d3.0e3b28","name":"Sensors battery lower than 20%","rules":[{"property":"attributes.device_class","logic":"is","value":"battery","valueType":"str"},{"property":"attributes.battery","logic":"lte","value":"20","valueType":"num"},{"property":"entity_id","logic":"is_not","value":".+(_battery_level)$","valueType":"re"}],"output_type":"array","output_empty_results":false,"output_location_type":"msg","output_location":"payload","output_results_count":1,"x":450,"y":160,"wires":[["a57739fe.7143a"]]},{"id":"f6ba2a6b.4dfa3","type":"join","z":"a9c3b74b.7a3168","name":"","mode":"custom","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1250,"y":160,"wires":[["5eb6b271.52402c","e42f9b8e.45e3a"]]},{"id":"ce46c9e.8e8ac38","type":"function","z":"a9c3b74b.7a3168","name":"Prep message","func":"var sensor = msg.payload.attributes.friendly_name.replace(\" Battery\",\"\");\nmsg.payload = msg.payload.state + \"% for \" + sensor;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1080,"y":160,"wires":[["f6ba2a6b.4dfa3"]]},{"id":"31f480d3.0e3b28","type":"server","z":"","name":"Home Assistant","legacy":false,"hassio":false,"rejectUnauthorizedCerts":false,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]
There is my code on GitHub if it’s interest someone: