Take this simple c++ program, upload it to ESP8266EX and you will be able to switch on and off relay from Home Assistant.
opdelta/esp8266_relay
Take this simple c++ program, upload it to ESP8266EX and you will be able to switch on and off relay from Home Assistant.
C++