I’m fighting this looong time already seems like truenas team is not interested to fix this at all. I have APC Back UPS 525 and here’s my long listed thread about this problem:
UPS is not powering off on command - TrueNAS General - TrueNAS Community Forums