Using ESP8266 to read digital input pin to be notified when motion is detected from 24VDC source device
Thanks Caleb Reiser, I luckily had a 4N35 optocoupler lying around and I was able to get it up and running! I wasn't aware of their function before. Super cool! I can see it being useful in many cases.

One other gotcha was to add a pull-down resistor from the signal wire, to pull D1 to 0 when motion wasn't being detected, as it was staying high otherwise.