chimera:ubergeeknz:
Let me further elucidate my answer:
9v high - 5.5v low
If you use a 6v zener + 100k pulldown
Would a Schottky diode suffice or does it need to be a zener diode because of the reverse biasing?
Has to be a zener, because you want to drop the voltage by a set amount. Apologies as "reverse bias" I think is the wrong term. What we want is "reverse breakdown voltage" which is the voltage at which a diode will allow current to flow "backwards".
Reverse breakdown voltage on a schottky is going to be somewhere around 100 volts and forward is about 0.2 - neither are useful to you here.
A zener has a specified reverse breakdown voltage of your choosing, so the voltage differential (across the zener) remains effectively constant once that voltage is exceeded. This gives you the voltage drop required want to drive your input high without overloading it, and means it will not conduct at all when the input is "low"
https://www.jaycar.co.nz/active-components/discrete/zener-diodes/c/211F here is a range, you would pick the best value to bring the "high" level between 2.5 and 3.3v (high as per http://henrysbench.capnfatz.com/henrys-bench/arduino-projects-tips-and-more/esp8266ex-gpio-high-and-low-input-thresholds/)
If you want to protect against overvoltage on the GPIO pin, you could also use a 3.3v zener across the pulldown and put a relatively small resistor (10k or so) in the path. But this complicates things further and is probably not needed. From what I read the ESP8266 will withstand some overvoltage on the GPIO pins.
excuse the abysmal diagram
6.2v 10k 100k
in ---Z<---/\/\/--gpio--+--\/\/\---+--gnd
9v ~2.7v +---Z<---+
3.3v (for protection)