I did not have any luck with OpenSprinkler running on a Raspberry Pi. I had bought the OSPi board and set up everything in my workshop. It worked as intended. After putting it up in its final place in the garage, not any more. Something on the board had given up the ghost. So I set up a kind of replacement with a 74HC595 shift register as on the OSPi board but using a 4x relay board instead of the triacs. That worked.
However, While I was on summer holiday, for no discernible reason it stopped working. The pi could not be pinged any more. Neither the pi nor the wifi router had been moved. Resetting did not help. this was during the hottest weeks this summer and some of our plants didn't like it that they were not watered for more than a week.
Putting it back into the workshop everything was fine again but I had lost confidence in this solution.
Therefore, I decided to replace the pi with an ESP8266 which has enough GPIOs for 4 relays (of which I anyway only used 2). As I have home assistant running (in docker), I gave ESPhome (command line version on my laptop) a try. It was pretty easy to set it up. Now I have to provide the programming of the watering by myself. But with my soil moisture sensors and measurement of the outside temperature this is no big deal. I should have done this right from the beginning. It would have saved me a lot of trouble and some money, too.
The above file was mostly generated using the esphome wizard. Only the switches and the sensor had to be added manually.
I don't find the documentation very clear with respect to the !secret. But it is as simple as generating the file secrets.yaml in the same directory as the above yaml file and making there the definitions for ssid and password.