So I know these switches use ESP8266 and they can be reprogrammed. The thing I don't know if it is possible to make a WiFi communication between this chip and an ESP32. I haven't really worked with ESPs before, only Arduinos with Atmega.
The main idea is that the ESP32 has a touchscreen and from there I would be able to turn on-of the Sonoff switch. There would be more ESP8266 devices in the network if it is possible.