How did Holmes know there would be a ventilator in the room in "The Adventure of the Speckled Band?"
I would argue that Holmes did not know there would be a ventilator in the room when he first started to formulate his idea about what had happened to Julia Stoner. Before he comes to Stoke Moran, Holmes has already decided that something has been smuggled into Julia's room to kill her. But he does not know how that could have been achieved. We know this because he examines the outside of Julia's room carefully. He even tugs on the shutters and examines them with his magnifying glass. At that point,
"Hum!" said he, scratching his chin in some perplexity, "my theory certainly presents some difficulties. No one could pass these shutters if they were bolted.
Clearly, at that point, Holmes did not know about the ventilator. He had thought there would be some more obvious way of getting something in to the room. He then goes in to the room and examines it all very carefully. Only after a long time does he notice the ventilator and even then, he only notices it because the rope for the bell-pull is attached to something near the ventilator.
So, it is not as if Holmes knew in advance that there would be a ventilator there. Instead, he only found out about that ventilator after doing a great deal of searching.