Hi, This is Sharat. I serve as an SME and a trainer for cloudthat.
Please look into my previous reviews. I have worked on similar projects earlier.
I can make your first ESP8266 connected to the sensor, while the second one connected to the relay on to your motor.
I can give you the entire configuration information along with documentation giving you details of all the connections that you need to make at your end.
If required I can also make you a small android interface through which you'll be having similar control.
Please do get in touch if interested.