Simple on/off 5V esp8266 Sensor?

I’m looking for a simple esp8266 powered by 5V that can detect a closed circuit (on/off) and do nothing else. Should be able to be flashed with Tasmota or Espurna. Does anyone have any recommendations?

NodeMCU or D1mini. Either one will work. I have both types doing various things with ESP Home including one doing exactly what you want.