This is an old thread, but I thought I'ld throw in my 2cents. I have not found any decent specifications for the USB port on the COMM board (PCB 530.SK00035XX) of the Growatt SPF5000 ES, there is a service manual though: https://www.amosplanet.org/wp-content/uploads/2022/04/SPF-5000-ES维修手册.pdf
The RPi takes up to 3.5Ah depending on accessories and load, so I guess the SPF's USB port will not supply sufficient energy. Also choose the DC-DC converter wisely or you might have current drops. The RPi needs stable 5.0-5.1 Volt.
The safest way to power your PI would probably be to attach a DC-DC converter to the battery cables and use a simple step down 5V converter like those:
https://de.aliexpress.com/item/2012773152.htm
https://de.aliexpress.com/item/1005005816566694.html