Raspberry Pi herunterfahren (shutdown)

That's what I mean: You have to change the Arduino-SW and you need a USB listening SW to shut down the PI.

I prefer to have a independent solution using P16 + P17 to automatically shutdown and start the PI independent of the ApplicationSW running on the PI.
This works, too, if the power is switched off by the start/stop button. And no change in sunray is needed.
 
Oben