[OBSOLETE] Sonoff, Sonoff TH, S20, Dual, 4CH, POW, & Touch Device Handler & SmartApp ($5 & $10 Smart Switches)

Since @erocm1231 has never released his source code, you may want to consider another alternative which provides total control of how you use every pin on your Wemos D1 Mini board.

Take a look at ST_Anything as an open source alternative