How to trigger an automation on "power on" but not reboot

I have a hard drive array that does not support auto start on power on. Instead, I have to press a start button. To solve this problem, I want to use ESPHome on ESP32 + a relay to simulate the action of pressing the button. Apparently it shall only happen once when the power is on, not on any of the reboot(firmware upgrade, etc) because that’ll shut down the hard drive array. However, the on_boot: triggers regardless.
Can I get some idea how to only trigger an ESPHome automation only for the first boot after powering on? Thanks!

I don’t know the answer to your question but is there a way you can determine the state of the hard drive array? Such as adding power monitoring somewhere or monitoring an led etc?

Then you can add a condition to only turn it on if it is off?

If it is a network drive, you could ping it, which is the easiest.
Otherwise you could also do a file check to determine wether or not the drive is active :thinking:

And then, if the drive is not present, push the button?

I guess the safest way is to find a 5V on the hard drive array and use it as a GPIO input on ESPHome? But just want to see if this is something that ESPHome natively supports.

Unfortunately it’s just a USB hard drive array and I need it to start before the OS starts. Otherwise the VMs won’t be able to run.

That sound like a crooked harddrive to me…brrr

Maybe you can alter the electronics just to power up when mains is up? That push button must go to somewhere where the power is switches on.
If you can bridge that, there is no need to push anything anymore :thinking: