I modified the PIR to work on 3.3V, check out this webpage http://lowpowerlab.com/motionmote/#pirsensor on how to do that.
I also used an ATTiny45 to have more control over the logic of the input and output signals.
So, PIR connected to ATTiny, ATTiny connected to ESP-12.
Both ATTiny and ESP-12 are in a state op deep sleep.
The PIR detects motion and sends a positive pulse to the ATTiny.
The ATTiny wakes up and resets the ESP-12.
It also brings a second line high for the ESP-12 to see that is reset by the ATTiny and not by anything else.
The ESP-12 sends the motion detection to a web server and sends a signal back to the ATTiny indicating it has finished its task and is going back to deep sleep.
ATTiny receives the signal and also goes back to deep sleep.
In this state it is ready to receive triggers from the PIR again.
Source code follows later, but here is a drawing.