The book ESP8266 Home Automation Projects contains code files for all the chapters.