Don't buy that unknown Amazon crap. First choice, of a fully self controlled home automation system are alway the devices from Sonoff. https://sonoff.itead.cc/en/
There is a well documentaded API and it's also possible to flash your own Tasmota firmware. The devices are all based on ESP8266 hardware plattorm. https://github.com/arendst/Sonoff-Tasmota.
Alternative firmware for ESP8266 based devices like iTeadSonoff with web UI, rules and timers, OTA updates, custome device templates and sensors support. Allows control over MQTT, HTTP, Serial and KNX for integrations with smart home systems. Written for Arduino IDE and PlatformIO.