ESPHome Sprinkler - run "off" signal on startup

Hello.

I am going to use the sprinkler function on a main valve that fills my water tank using mains water when the tank falls to a certain level so that there is always water in the tank to run irrigation equipment.

I am using 9v DC latching valves and have all the code at an okay place. Doing a risk assessment in my head though i was thinking: what happens if the system has energised with the “ON” signal, latching the valve open and the power is interrupted to the ESP - I assume it would reboot but think it was off. It needs the OFF signal (reverse polarity) to close the valve.

In the esphome - boot section i have this:

  - sprinkler.shutdown: $devicename 

I am not sure that will work though if it thinks it is already off. Any otherway to manually power the relay pins on startup for 250ms?

TiA, Terrence