• 1
    Step 1

    BRIDGE INSTALLATION:

    Hue Bridge emulator was rewrite in python and now require just to install nmap package and execute the python script with sudo. For startup you can create systemd service with a simple config file or you can add it directly to /etc/rc.local


    debian/raspbian distributions:

    $sudo apt install nmap
    $sudo ./HueEmulator.py
    connect to bridge

    Open official smartphone applicatio

    GitHub project page:

    https://github.com/mariusmotea/diyHue

    Installation and demo video (outdated):

  • 2
    Step 2

    LIGHTS:

    IKEA TRADFRI:

    Open http://{bridgeIP}/tradfri, type Ikea bridge ip and security key in form and then click "Save". If everything was fine you will see all lights paired with Tradfri bridge in Hue applications. Important: coap-client-linux binary is compiled for arm devices like raspberry pi. If you will use an x86 computer then you will need to recompile this.

    MI-LIGHT:

    esp8266_milight_hub is required https://github.com/sidoh/esp8266_milight_hub. Open http://{bridgeIP}/milight, complete the form and click Save. You need to repet this step for every light as there is no way to retrive the list of lights from milight hub.

    LIGHT STRIPS:

    Supported neopixel led are WS2812B and SK6812 (rgbw).
    Data in pin of the leds must be connected to dedicated harware pin of the esp8266 platforms (rx pin on wemos d1 mini and esp-12e)
    Compilation require Makuna/NeoPixelBus and WiFiManager libraries that can be very easy downloaded from Arduino library manager.

    Options in skeches:

    • lightsCount x //number of emulated lights per strip
    • pixelCount xx // number of leds in stri
    • IPAddress strip_ip ( xxx, xxx, xxx, xxx); //if you want to use static ip uncommented with gateway_ip, subnet_mask and WiFi.config(strip_ip, gateway_ip, subnet_mask); lights can be controlled with any browser. example url:
    "http://{light ip}/set?light=1&r=0&g=60&b=255&transitiontime=2000"
     "http://{light ip}/discover" 
    

    list of arguments that can be passed in url for lights direct control:

    • "on": 1 to set light on, 0 to set the light off.
    • "r", "g", "b", "w": setup light color using rbg values between 0 and 255.
    • "x" and "y": values between 0.0 and 1.0 to setup light color in CIE chart.
    • "ct": value between 153 (max warm white) and 500 (max could white) http://en.wikipedia.org/wiki/Mired
    • hue: value between 0 and 65535, represent the hue of the light.
    • sat: saturation of the light. 255 is the most saturated and 0 is the least saturated.
    • bri: brightness of the light, 255 is the maximum brightness, 1 is the minimum, 0 will turn the light on to previews state
    • transitiontime: duration of the transition from the light’s current state to the new stat. default 4 represent 0.4 seconds.
    • bri_inc: increase of decrease the brightness with specified value


    COLOR DREAM RGBW BULBS:

    I found these bulbs are esp8266 based devices that can be adapted to work with this bridge. Despite the low price these bulbs feels solid, are more heavy than regular bulbs and i expect to be modium to long life. I was not able to flash the memory by connecting vdd, gnd, rx, tx, rst and gpio0 pins to a nodemcu dev board, but was very easy for me to replace the SPI flash chip from an already programmed epb8266 board. This operation took me about 30 seconds, while soldering the small wires took me more than 5 minutes. Future firmware updates will be easy to perform via Arduino OTA (wifi). Sketch for these bulbs can be found in RgbwHueBulb folder, the gpio pins defined (12, 13, 14 and 5) are the correct ones connected to leds. Bulbs where buyed from here:https://www.aliexpress.com/item/AC85-240V-5W-7W-9W-RGBW-WIFI-LED-Bulb-Light-Colorful-Dimmable-LED-Light-Support-IOS/32785628736.html?spm=2114.13010608.0.0.B8FcLh

  • 3
    Step 3

    SENSORS:

    DIMMER SWITCH and TAP SWITCH

    Require basic knowlege of electronics, in order to build the circuit from picture!

    If is used an ESP-12E module, then must connect pin gpio15 with a 10k resitor to ground and pin CH_PD with a 10k resistor to VDD.

    If everything is ok on first power on you will be able to see and configure a new switch in application. Is important to use static ip's because dhcp require extra time to perform the action. Switch will stay alive just 5 seconds, then will enter in deep sleep mode and will consume just 17uA. Once a button is pressed there will be a short negative pulse on RST pin that will wake up the module. This operation will take about 0.5 seconds. If the button is released in this period the chip will be unable to detect what button was pressed and will not send any requests to bridge.