I think that might be difficult as the Raspberry Pi can have multiple interfaces. In my case I use both Ethernet and USB Wireless connections and there is no way that I know of that OSPi can determine which one is used for OpenSprinkler traffic.
If you only use one interface it shouldn’t be too hard to get. What I did in a previous project was to search the routing table for the default gateway and which interface is associated to it. This gave me the ‘Main’ interface IP as the other was used for more specific stuff.