Poor Man's Hue Switch




Introduction: Poor Man's Hue Switch

In this instructable i'll show you how to build a very inexpensive wireless switch for Phillips Hue Lights.

The problem:

These lights needs permanent power supply, wall switches have to be always on.

If you go to bed and turn off the wall switch the light will never shine again if the hue bridge try to switch on the light, for example in the morning to wake up you softly with a "warm light".

You have to buy the Hue Tap or dimmer switches, which are very expensive, especially if you need one for each room.

The solution is the using of an ESP8266. These tiny controllers with inbuild usb adapter are available for less than 3$. For the power supply you only need 2 pcs. AAA battery, by using the DeepSleep modus of the Esp8266 the battery work for a long time.

Everytime you press the reset button the ESP wake up, connect with your WLAN, get the status of the lamp, if it is on it switches off or vice versa, after this command it falls into deep sleep

Step 1: What You Need

There are two different PCBs with Esp8266 and inbuild usb-adapter for simple programming:


  • NodeMCU, not so small, with USB
  • Holder for 2 Micro cells (AAA), solder tags

  • 2 pcs. AAA cell alkaline
  • wires
  • small screw 2x8mm, see picture

for housing:

  • 3D printed case(see STL files next step)


  • a housing from an old remote control (see picture)


  • place the Esp and battery behind a wall switch button

Step 2: Housing

If you an owner of a 3D Printer, then simply use the attached STLs, you even don't need an extra button, we use the onboard reset button with a 3D printed cap.

Another solution is an old remote control.

If you want to replace the wall switch with a button switch and the Esp you have to shortcut the 2 wires and ISOLATE them so that the Lamp got continous current.


Step 3: Coding the Esp8266

First you need the Arduino IDE.

Then you have to install the library for Esp8266. You'll find several tutorials here on instructables how to program these magic tiny things :-)

After opening the attached sketch with the Arduino IDE you have to do some settings depending to you local WIFI.

For a faster connecting/switching we use a static ip adress.

IPAddress gateway(192,168,178,1);

ip adress of you local wifi router where the hue bridge is connected

IPAddress ip(192, 168, 178, 216);

Ip adress of your switch, be aware of using a high adress in the range of 200-250 that is not used for other devices

IPAddress subnet(255,255,255,0);

int light = 2; //

the number of your light that is switched

const char hueHubIP[] = "";

the ip adress of the hue bridge

const char hueUsername[] = "hue bridge username"

you have to create an authorized username in the hue bridge, look at this tutorial

const int hueHubPort = 80;

always "80"

const char ssid[] = "SSID"; // network SSID (name)

const char pass[] = "password"; // network password

finally SSID and password of your wifi

After changing these settings you are ready for upload !

Step 4: Schematic

The schematic is very simple, you only have to connect the battery holder to GND and 3V3.

The use of an external button is optional.

Step 5: Additional Infos

To reduce the power consumption it is necessary to remove the voltage regulator.

Measure the current before and after removing, the current in deepsleep has to be less than 0,1mA.

Sometimes you also have to remove the supply pin from the UART chip. See here for more infos.

LED Contest 2017

Participated in the
LED Contest 2017

Wireless Contest

Participated in the
Wireless Contest

Be the First to Share


    • Make it Glow Contest

      Make it Glow Contest
    • First Time Author Contest

      First Time Author Contest
    • PCB Challenge

      PCB Challenge

    4 Discussions


    1 year ago

    If you change lights with groups and task with action you can control a group of light bulbs with this.


    3 years ago

    I’ve got this sort of working. I’ve noticed the following

    First the response time is slow. I assume after a reset from deep sleep it has to reconnect with the router. Do you have the same delayed response?

    Second, I’m controlling 3 lights at once. When I turn them on they return to the same brightness as they were before I turned them off. Oddly if one was already off before I used this switch to turn them all off, when I turn them on, that light turns on but in a very dim state. Is there something I can add to the code to turn them all on at full brightness?




    Reply 3 years ago

    1. Yes, delay is about 2 seconds for the starting wifi connection.

    2. in ' void loop() ' replace ' String command = "{\"on\": true}"; '
    by ' String command = "{\"on\": true, \"bri\":254}"; '

    this starts the light with full brightness


    Reply 3 years ago

    Thank you, that works.

    For some odd reason the reset switch on my D1 mini doesn’t work. I was planning on wiring in a separate push button anyway so it’s not a show stopper.

    Great instructable.