Think ESP-01 which can be programmed with Arduino IDE. Search on the forum for Sonoff Tasmota. I use this sw with self build ESP-01 dimmers controlled by Openhab. You will find more info in forementioned thread including my example.
—>> https://community.openhab.org/t/sonoff-own-build-and-javascript/35862