Get reason for HA reboot

I have HAOS running in a VM.
For various reasons I’d like to know on HA boot, whether the reason for reboot was user initiated, or not (ideally, was power lost).
I have an automation to set an input boolean to true, triggered by HA shutdown trigger, but I’d love to have a way to determine on boot if it was booting due to a power loss.
I’m guessing some kind of query to the host (Proxmox VM) for an uptime would get me part way there (restarting the VM for some config reason would cause a false positive here), but it would be nice if there were some internal state that HA keeps for what the circumstances of the shutdown were, that I could refer to.

1 Like