It would really depend on how you're doing the shutdown. If the USB cable from the UPS is plugged into your NUC (ESXi host), then that obviously wouldn't work. But if it's plugged into your Pi (which is your automation station), then you could run all the logic there and call out to the ESXi host to gracefully shutdown all VMs. From there, two branches of logic would apply:
Either of these ensures that regardless of what happens after the UPS triggers an outage, your automation functions and keeps your VMs online. This is just how I would approach it myself in case it isn't what you're doing.
I have the same problem with a NUC8i7BEH model. Did anyone find a workaround on this problem?
No. Very, very disappointed.