I wrote my own firmware for ESP-8266 IoT devices to connect them to Home Assistant. There are many like it, but this one is mine: https://github.com/thedanbob/mqtt_light
https://github.com/thedanbob/mqtt_garage_door
https://github.com/thedanbob/mqtt_power_cycle