Valve command with 4 relays

Hello, I want to command the valve for the input water in your home.
so I buy the motorised accessorie. Basicaly it’s a DC motor and it’s possible to open and close the valve with powering the motor with 12 V and reverse the polarity for the other sens.

I buy also a 4 relays ESP 8266. I will do a H bridge with relays and I will be able to power the DC motor by the way of two relays, the other send is by the way of other two relays.

My question is just for the ESPHome config.
How can I do the config ? For the Home Assistant I just would like to have on or off for the valve.
This order in esphom must be converted to supply the corresponding two relays.
In addition, there must be un small overlocking time to not power the 4 relays in the same time ! short circuit…
Thanks you for any help,
Regards