You can also accomplish the same task not using a function node.
![image](https://community-assets.home-assistant.io/original/3X/4/d/4da774f6180ddab2a8d9f0eec9150707a532d610.png)
[{"id":"59a9621d.f0c55c","type":"inject","z":"ffbd7f06.4a014","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[{\"entity_id\":\"one\",\"attributes\":{\"battery_level\":50}},{\"entity_id\":\"two\",\"attributes\":{\"battery_level\":75}},{\"entity_id\":\"three\",\"attributes\":{\"battery_level\":100}}]","payloadType":"json","x":290,"y":1024,"wires":[["16318761.8172c9"]]},{"id":"69f19c55.0cdf34","type":"debug","z":"ffbd7f06.4a014","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":710,"y":1024,"wires":[]},{"id":"16318761.8172c9","type":"split","z":"ffbd7f06.4a014","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":418,"y":1024,"wires":[["1751ba9e.088bd5"]]},{"id":"1751ba9e.088bd5","type":"template","z":"ffbd7f06.4a014","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{\n \"type\": \"message\",\n \"content\": \"{{payload.entity_id}} = {{payload.attributes.battery_level}} %\"\n}","output":"json","x":556,"y":1024,"wires":[["69f19c55.0cdf34"]]}]