User avatar
By RichardS
#42989 User

Looking to get started with home automation I’ve built a web based light and fan control system. This system is using a NodeMCU board programmed with the ESP8266 Arduino IDE. The NodeMCU serves the web page via Wifi to any device on the network. It also sends commands to a Wifi Milight controller which in turn switches on and off the lights, slowly fading in and out. Unfortunately it seems not possible to turn on the lights (which are in different groups) at the same time, but it adds a nice slow motion effect so it’s not too bad. And last but not least it has an IR LED connected to control a Hatari brand fan. The IR signal was learned earlier in a separate project with an Arduino, also using the same IR library. With help of some of the members in this forum and (via their suggestions) some added resistors to give GPIO0 and GPIO2 a high signal when booting the NodeMCU is now capable of starting up standalone from a USB charger, not needing a computer anymore.

In the future, there’s a lot of potential extending this project, I still have a PIR sensor lying around, it would be nice to automatically turn on the lights when someone enters the room. Except in the middle of the night then, but using the Wifi to get the current time off the internet it should be possible to make it work correctly in most cases. Also I’ve ordered a few smart sockets to connect more ‘dumb’ lights to the system, but this contest will be done by the time they arrive. Also I’ll still need to make an enclosure, but as it’s quite small and sitting in the dark anyway it’s not very urgent.

1x NodeMCU V3
2x 10K Ohm resistors
3x Milight RGBW light bulb
1x Hatari fan with IR receiver