khoih
20
Your application is similar to :
Have a look at this and see if you can apply according to your purpose.
Another thing is pin 13 (GPIO13)
#define PUMP_PIN 13 // PUMP RELAY
in your code for NodeMCU or Wemos D1 is actually pin D7 / GPIO13 and I guess you connect the relay to the wrong pin.
#define PIN_D7 13 // Pin D7 mapped to pin GPIO13/RXD2/HMOSI of ESP8266