An aerial torpedo attack on the German fleet had first been suggested by Lt. Commander de Courcy Ireland in December 1915. Unfortunately, Ireland was killed in February 1916 while testing an experimental airship, along with Wing Commander N.F Usborne, an airship pioneer.
After his death, the idea continued to be pushed forward by a number of officers, in particular Murray Sueter, former head of the RNAS under Churchill. Sueter put forward a number of proposals for torpedo attacks on Kiel, Wilhelmshaven and Pola. Unfortunately, the technology was not yet available and the leadership was not totally supportive. Arthur Balfour's Ministry suspected Sueter (not entirely without cause) of being a “unified Airforce fifth columnist” when the Admiralty was trying to integrate the RNAS more closely into the Navy. While he was in charge of Supply however, Sueter, along with Arthur Longmore, worked with Sopwith to begin the development of a torpedo bomber. This came about with the Sopwith T.1 in Summer 1917. However, by that point aircraft procurement had been moved to the Ministry of Supply and Sueter, out of a job, had been transferred to Taranto to set up a seaplane base. He did keep working to get enough RNAS assets in theatre to use in torpedo or bombing strikes against Pola and Fiume but was never able to get enough.
In general, a torpedo strike on a harbour first need to have the assets in place. You need to have aircraft that can carry an 18” or 21” torpedo, and enough of them to launch a significant strike. Either Ireland surviving or Sueter being less on the outs with the Balfour/Jackson administration might get you that before wars end. But then you also need someone high up to push the idea. For Wilhelmshaven that was Beatty. I am not sure who that would be for Pola.
On the technical side, to carry the 1000 lbs of torpedo, you probably need a reliable engine of at least 200 hp. And you need to have them in large enough numbers to outfit a significant strike force. The best options are probably the Hispano-Souza or the RR Eagle. The problem is that these are hard to source in volume and widely sought after. A number of British aircraft were designed around either one but were then built around Arab Sunbeams or similar. The Cuckoo itself had this issue. Unreliability of the Sunbeam was a major reason why they were delayed past the end of the war.
So, you are probably waiting until at least 1917, but more likely 1918 until you have enough engines and airframes of high enough power. Could be pretty tight to get it done before the end of the war.