├── .cli-config.yml ├── .github ├── contributing.md ├── stale.yml ├── test.yml └── workflows │ └── test.yml ├── .gitignore ├── .gitmodules ├── ATMega ├── Generic_Dimmable_Light_mega_ether │ └── Generic_Dimmable_Light_mega_ether.ino └── Generic_WS2812_Strip_mega_ether │ └── Generic_WS2812_Strip_mega_ether.ino ├── Arduino └── bin │ ├── Generic_CCT_Light.bin │ ├── Generic_Dimmable_Light.bin │ ├── Generic_ON_OFF.bin │ ├── Generic_RGBW_Light.bin │ ├── Generic_RGB_CCT_Light.bin │ ├── Generic_RGB_Light.bin │ ├── Generic_SK6812_Strip.bin │ ├── Generic_WS2812_Strip.bin │ ├── Gradient_TV_Strip_WS2812.bin │ ├── Hue_Gradient_Lightstrip.bin │ ├── Hue_Signe_Gradient.bin │ ├── SonoffTXT3US1C.bin │ ├── SonoffTXT3US2C.bin │ ├── SonoffTXT3US3C.bin │ └── placeholder ├── ESP32 ├── ESP-C3_Controller_Board │ ├── 3DPrintedCase.png │ ├── 3D_render.png │ ├── Base.stl │ ├── Cover.stl │ ├── README.md │ ├── gerbers.zip │ └── schematic.pdf ├── ESP32_C3_Dimmable │ └── ESP32_C3_Dimmable.ino ├── ESP32_C3_Generic_Strip │ └── ESP32_C3_Generic_Strip.ino ├── ESP32_C3_Gradient_Strip │ ├── ESP32_C3_Gradient_Strip.ino │ └── ESP32_C3_Gradient_Strip.ino.esp32c3.bin ├── ESP32_C3_SK6812_Gradient_Strip │ ├── ESP32_C3_SK6812_Gradient_Strip.ino │ └── ESP32_C3_SK6812_Gradient_Strip.ino.esp32c3.bin ├── ESP32_SK9822_FastLED_Strip │ └── ESP32_SK9822_FastLED_Strip.ino ├── ESP32_TM1829_Strip │ └── ESP32_TM1829_Strip.ino └── Luma │ └── Firmware │ └── luma-gradient.bin ├── ESP8266 ├── EspLight-fridgefire │ └── EspLight-fridgefire.ino ├── Generic_CCT_Light │ └── Generic_CCT_Light.ino ├── Generic_Dimmable_Light │ ├── Generic_Dimmable_Light.ino │ ├── README.md │ └── images │ │ ├── Over.jpg │ │ └── Under.jpg ├── Generic_FW1906_Strip │ └── Generic_FW1906_Strip.ino ├── Generic_ON_OFF_device │ └── Generic_ON_OFF_device.ino ├── Generic_ON_OFF_device_433Mhz │ ├── Generic_ON_OFF_device_433Mhz.ino │ ├── images │ │ ├── Fritzing.JPG │ │ ├── PCB1.jpg │ │ ├── PCB2.jpg │ │ └── Schematic.JPG │ └── readme.md ├── Generic_RGBW_Light │ ├── Generic_RGBW_Light.ino │ ├── README.md │ └── images │ │ ├── Over.jpg │ │ ├── Under.jpg │ │ └── schematic.JPG ├── Generic_RGB_CCT_Light │ └── Generic_RGB_CCT_Light.ino ├── Generic_RGB_Light │ └── Generic_RGB_Light.ino ├── Generic_SK6812_Strip │ └── Generic_SK6812_Strip.ino ├── Generic_WS2812_Strip │ └── Generic_WS2812_Strip.ino ├── Gradient_TV_Strip_WS2812 │ └── Gradient_TV_Strip_WS2812.ino ├── Hue_Gradient_Lightstrip_SK6812 │ └── Hue_Gradient_Lightstrip_SK6812.ino ├── Hue_Gradient_Lightstrip_WS2812 │ └── Hue_Gradient_Lightstrip_WS2812.ino ├── Hue_Signe_Gradient │ └── Hue_Signe_Gradient.ino ├── IRremote │ └── IRremote.ino ├── P9813_ledstrip_chainable │ └── P9813_ledstrip_chainable.ino ├── Sonoff_TX_T3 │ ├── SonoffTXT3US1C-May292020.ino │ ├── SonoffTXT3US2C-May292020.ino │ └── SonoffTXT3US3C-May292020.ino ├── WS2812BHueRing │ └── WS2812BHueRing.ino ├── esp8266-lighting-controllers │ └── README.md ├── fastLED_SM16726_RGBW_Bulb │ ├── README.md │ └── fastLED_SM16726_RGBW_Bulb.ino └── sk6812_wwa │ └── sk6812_wwa.ino ├── ESPHome ├── AsyncUDP │ ├── diyhueasyncudp-rgbww.h │ └── diyhueasyncudp.h ├── WiFiUDP │ └── diyhueudp.h ├── alertswitch.h └── rgb-cct-fastled.yaml ├── HTML ├── diyhue.js ├── generic_rgb.html ├── generic_ws2812_strip.html ├── iro.js ├── nouislider.css └── nouislider.js ├── PCB_Files └── ESP8266-01_4Channels │ ├── LED_Controller_4Channels.PcbDoc │ ├── LED_Controller_4Channels.PrjPcb │ ├── LED_Controller_4Channels.PrjPcbStructure │ ├── LED_Controller_4Channels.SchDoc │ ├── LED_Controller_4Channels.cam │ ├── Project Outputs for LED_Controller_4Channels │ ├── LED_Controller_4Channels-macro.APR_LIB │ ├── LED_Controller_4Channels.EXTREP │ ├── LED_Controller_4Channels.GBL │ ├── LED_Controller_4Channels.GBO │ ├── LED_Controller_4Channels.GBP │ ├── LED_Controller_4Channels.GBS │ ├── LED_Controller_4Channels.GD1 │ ├── LED_Controller_4Channels.GG1 │ ├── LED_Controller_4Channels.GTL │ ├── LED_Controller_4Channels.GTO │ ├── LED_Controller_4Channels.GTP │ ├── LED_Controller_4Channels.GTS │ ├── LED_Controller_4Channels.REP │ ├── LED_Controller_4Channels.RUL │ ├── LED_Controller_4Channels.apr │ └── Status Report.Txt │ └── __Previews │ ├── LED_Controller_4Channels.PcbDocPreview │ └── LED_Controller_4Channels.SchDocPreview ├── README.md └── catalog.json /.cli-config.yml: -------------------------------------------------------------------------------- 1 | board_manager: 2 | additional_urls: 3 | - http://arduino.esp8266.com/stable/package_esp8266com_index.json 4 | -------------------------------------------------------------------------------- /.github/contributing.md: -------------------------------------------------------------------------------- 1 | # Contributing to diyHue Lights 2 | 3 | :+1::tada: First off, thanks for taking the time to contribute! :tada::+1: 4 | 5 | The following is a set of guidelines for contributing to diyHue Lights. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request. 6 | 7 | ### Building with travis 8 | In order for your sketch to be built with travis, please upload only the `sketch.ino` file in a folder within the Arduino dir. Please make sure that the folder and sketch name are exactly the same, ignoring the extension. For example the sketch would be saved in `Lights/Arudino/Generic_Fun_Light/` and called `Generic_Fun_Light.ino`. 9 | 10 | Also within you PR, please create a commit to `.travis.yml`, adding a line in the matrix section. This should be in the format `- SKETCH="YOUR_SKETCH_NAME_HERE"`. Following the above example, `.travis.yml` would look like: 11 | 12 | ``` 13 | ... 14 | matrix: 15 | - SKETCH="Generic_RGBW_Light" 16 | - SKETCH="Generic_RGB_Light" 17 | - SKETCH="Generic_CCT_Light" 18 | - SKETCH="Generic_RGB_CCT_Light" 19 | - SKETCH="Generic_WS2812_Strip" 20 | - SKETCH="Generic_SK6812_Strip" 21 | - SKETCH="Generic_Fun_Strip" 22 | ... 23 | ``` 24 | 25 | Finaly, if your sketch requires any of the libraries not installed on [this](https://github.com/diyhue/Lights/blob/675d2693afdb5f38fd9e61fdcf21aa042a7817b4/install.sh#L94) line of `install.sh`, then please add a commit adding them. 26 | -------------------------------------------------------------------------------- /.github/stale.yml: -------------------------------------------------------------------------------- 1 | # Number of days of inactivity before an issue becomes stale 2 | daysUntilStale: 7 3 | # Number of days of inactivity before a stale issue is closed 4 | daysUntilClose: 2 5 | # Issues with these labels will never be considered stale 6 | exemptLabels: 7 | - pinned 8 | - security 9 | - in progress 10 | - enhancement 11 | # Label to use when marking an issue as stale 12 | staleLabel: stale 13 | # Comment to post when marking an issue as stale. Set to `false` to disable 14 | markComment: > 15 | This issue has been automatically marked as stale because it has not had 16 | recent activity. It will be closed in 2 days if no further activity occurs. Thank you 17 | for your contributions. 18 | # Comment to post when closing a stale issue. Set to `false` to disable 19 | closeComment: > 20 | This issue has been automatically closed as it has not had any recent activity. 21 | Thank you for your contributions. 22 | -------------------------------------------------------------------------------- /.github/test.yml: -------------------------------------------------------------------------------- 1 | # This is a basic workflow to help you get started with Actions 2 | 3 | name: Arduino Build 4 | 5 | # Controls when the action will run. 6 | on: 7 | # Triggers the workflow on push or pull request events but only for the master branch 8 | push: 9 | branches: [ master ] 10 | pull_request: 11 | branches: [ master ] 12 | 13 | # Allows you to run this workflow manually from the Actions tab 14 | workflow_dispatch: 15 | 16 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 17 | jobs: 18 | # This workflow contains a single job called "build" 19 | build: 20 | # The type of runner that the job will run on 21 | runs-on: ubuntu-latest 22 | 23 | # Steps represent a sequence of tasks that will be executed as part of the job 24 | steps: 25 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it 26 | - uses: actions/checkout@v2 27 | 28 | # Runs a single command using the runners shell 29 | - name: Run a one-line script 30 | run: echo Hello, world! 31 | 32 | # Runs a set of commands using the runners shell 33 | - name: Run a multi-line script 34 | run: | 35 | echo Add other actions to build, 36 | echo test, and deploy your project. 37 | - name: Compile Arduino Sketches 38 | uses: arduino/compile-sketches@v1.0.0 39 | 40 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | # This is a basic workflow to help you get started with Actions 2 | 3 | name: Arduino Build 4 | 5 | # Controls when the action will run. 6 | on: 7 | # Triggers the workflow on push or pull request events but only for the master branch 8 | push: 9 | branches: [ master ] 10 | pull_request: 11 | branches: [ master ] 12 | 13 | # Allows you to run this workflow manually from the Actions tab 14 | workflow_dispatch: 15 | 16 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 17 | jobs: 18 | # This workflow contains a single job called "build" 19 | build: 20 | # The type of runner that the job will run on 21 | runs-on: ubuntu-latest 22 | 23 | # Steps represent a sequence of tasks that will be executed as part of the job 24 | steps: 25 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it 26 | - uses: actions/checkout@v2 27 | 28 | # Runs a single command using the runners shell 29 | - name: Run a one-line script 30 | run: echo Hello, world! 31 | 32 | # Runs a set of commands using the runners shell 33 | - name: Run a multi-line script 34 | run: | 35 | echo Add other actions to build, 36 | echo test, and deploy your project. 37 | - name: Compile Arduino Sketches 38 | - uses: arduino/compile-sketches@v1 39 | with: 40 | fqbn: 'esp8266:esp8266' 41 | libraries: | 42 | - name: Servo 43 | - name: Stepper 44 | version: 1.1.3 45 | platform: | 46 | - source-path: "https://github.com/esp8266/Arduino.git" 47 | name: "esp8266:esp8266" 48 | sketch-paths: | 49 | - examples 50 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.elf 2 | .DS_Store 3 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "Arduino/WLED"] 2 | path = Arduino/WLED 3 | url = https://github.com/juanesf/WLED 4 | -------------------------------------------------------------------------------- /Arduino/bin/Generic_CCT_Light.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diyhue/Lights/5c7d5816f07d55b7df05a53115db783ecb733042/Arduino/bin/Generic_CCT_Light.bin -------------------------------------------------------------------------------- /Arduino/bin/Generic_Dimmable_Light.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diyhue/Lights/5c7d5816f07d55b7df05a53115db783ecb733042/Arduino/bin/Generic_Dimmable_Light.bin -------------------------------------------------------------------------------- /Arduino/bin/Generic_ON_OFF.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diyhue/Lights/5c7d5816f07d55b7df05a53115db783ecb733042/Arduino/bin/Generic_ON_OFF.bin -------------------------------------------------------------------------------- /Arduino/bin/Generic_RGBW_Light.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diyhue/Lights/5c7d5816f07d55b7df05a53115db783ecb733042/Arduino/bin/Generic_RGBW_Light.bin -------------------------------------------------------------------------------- /Arduino/bin/Generic_RGB_CCT_Light.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diyhue/Lights/5c7d5816f07d55b7df05a53115db783ecb733042/Arduino/bin/Generic_RGB_CCT_Light.bin -------------------------------------------------------------------------------- /Arduino/bin/Generic_RGB_Light.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diyhue/Lights/5c7d5816f07d55b7df05a53115db783ecb733042/Arduino/bin/Generic_RGB_Light.bin -------------------------------------------------------------------------------- /Arduino/bin/Generic_SK6812_Strip.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diyhue/Lights/5c7d5816f07d55b7df05a53115db783ecb733042/Arduino/bin/Generic_SK6812_Strip.bin -------------------------------------------------------------------------------- /Arduino/bin/Generic_WS2812_Strip.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diyhue/Lights/5c7d5816f07d55b7df05a53115db783ecb733042/Arduino/bin/Generic_WS2812_Strip.bin -------------------------------------------------------------------------------- /Arduino/bin/Gradient_TV_Strip_WS2812.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diyhue/Lights/5c7d5816f07d55b7df05a53115db783ecb733042/Arduino/bin/Gradient_TV_Strip_WS2812.bin -------------------------------------------------------------------------------- /Arduino/bin/Hue_Gradient_Lightstrip.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diyhue/Lights/5c7d5816f07d55b7df05a53115db783ecb733042/Arduino/bin/Hue_Gradient_Lightstrip.bin -------------------------------------------------------------------------------- /Arduino/bin/Hue_Signe_Gradient.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diyhue/Lights/5c7d5816f07d55b7df05a53115db783ecb733042/Arduino/bin/Hue_Signe_Gradient.bin -------------------------------------------------------------------------------- /Arduino/bin/SonoffTXT3US1C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diyhue/Lights/5c7d5816f07d55b7df05a53115db783ecb733042/Arduino/bin/SonoffTXT3US1C.bin -------------------------------------------------------------------------------- /Arduino/bin/SonoffTXT3US2C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diyhue/Lights/5c7d5816f07d55b7df05a53115db783ecb733042/Arduino/bin/SonoffTXT3US2C.bin -------------------------------------------------------------------------------- /Arduino/bin/SonoffTXT3US3C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diyhue/Lights/5c7d5816f07d55b7df05a53115db783ecb733042/Arduino/bin/SonoffTXT3US3C.bin -------------------------------------------------------------------------------- /Arduino/bin/placeholder: -------------------------------------------------------------------------------- 1 | Empty file to keep bin folder present 2 | -------------------------------------------------------------------------------- /ESP32/ESP-C3_Controller_Board/3DPrintedCase.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diyhue/Lights/5c7d5816f07d55b7df05a53115db783ecb733042/ESP32/ESP-C3_Controller_Board/3DPrintedCase.png -------------------------------------------------------------------------------- /ESP32/ESP-C3_Controller_Board/3D_render.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diyhue/Lights/5c7d5816f07d55b7df05a53115db783ecb733042/ESP32/ESP-C3_Controller_Board/3D_render.png -------------------------------------------------------------------------------- /ESP32/ESP-C3_Controller_Board/Base.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diyhue/Lights/5c7d5816f07d55b7df05a53115db783ecb733042/ESP32/ESP-C3_Controller_Board/Base.stl -------------------------------------------------------------------------------- /ESP32/ESP-C3_Controller_Board/Cover.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diyhue/Lights/5c7d5816f07d55b7df05a53115db783ecb733042/ESP32/ESP-C3_Controller_Board/Cover.stl -------------------------------------------------------------------------------- /ESP32/ESP-C3_Controller_Board/README.md: -------------------------------------------------------------------------------- 1 | This is a board specially made for DiyHue and WS2812/WS2815 strips based on the new ESP32-C3 controller (RISC-V CPU). 2 | 3 | ![3D Rencer](https://raw.githubusercontent.com/diyhue/Lights/master/ESP32/ESP-C3_Controller_Board/3D_render.png) 4 | ## Features 5 | - P-Channel mosfet that cut the power to the strip when all leds are soft off in order to save the energy (WS2812 leds draw ~1mA / led while off). 6 | - Two buttons that allow to control the power (short press) , brightness (long press), factory reset (both buttons pressed) and to enter FLASH MODE at boot. 7 | - Led indicator for WiFi connectivity (the led turn off once wifi connection is established and will blink when connection is lost). 8 | - 2.4GHz Chip Antenna. 9 | 10 | STL files for 3D printed case provided 11 | ![3D Case](https://github.com/diyhue/Lights/raw/master/ESP32/ESP-C3_Controller_Board/3DPrintedCase.png) 12 | 13 | This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported (CC BY-NC 3.0) International License. 14 | -------------------------------------------------------------------------------- /ESP32/ESP-C3_Controller_Board/gerbers.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diyhue/Lights/5c7d5816f07d55b7df05a53115db783ecb733042/ESP32/ESP-C3_Controller_Board/gerbers.zip -------------------------------------------------------------------------------- /ESP32/ESP-C3_Controller_Board/schematic.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diyhue/Lights/5c7d5816f07d55b7df05a53115db783ecb733042/ESP32/ESP-C3_Controller_Board/schematic.pdf -------------------------------------------------------------------------------- /ESP32/ESP32_C3_Dimmable/ESP32_C3_Dimmable.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #define light_name "Dimmable Hue Light" //default light name 11 | #define LIGHT_VERSION 2.1 12 | 13 | #define use_hardware_switch false // To control on/off state and brightness using GPIO/Pushbutton, set this value to true. 14 | //For GPIO based on/off and brightness control, it is mandatory to connect the following GPIO pins to ground using 10k resistor 15 | #define button1_pin 4 // on and brightness up 16 | #define button2_pin 5 // off and brightness down 17 | 18 | //define pins 19 | #define LIGHTS_COUNT 1 20 | #define ledGPIO 7 21 | 22 | #define LED_PIN 4 23 | 24 | #define LEDC_CHANNEL_0 0 25 | 26 | // use 12 bit precission for LEDC timer 27 | #define LEDC_TIMER_12_BIT 12 28 | 29 | // use 5000 Hz as a LEDC base frequency 30 | #define LEDC_BASE_FREQ 5000 31 | 32 | // fade LED PIN (replace with LED_BUILTIN constant for built-in LED) 33 | 34 | //#define USE_STATIC_IP //! uncomment to enable Static IP Adress 35 | #ifdef USE_STATIC_IP 36 | IPAddress strip_ip ( 192, 168, 0, 95); // choose an unique IP Adress 37 | IPAddress gateway_ip ( 192, 168, 0, 1); // Router IP 38 | IPAddress subnet_mask(255, 255, 255, 0); 39 | #endif 40 | 41 | uint8_t scene; 42 | bool light_state[LIGHTS_COUNT], in_transition; 43 | int transitiontime[LIGHTS_COUNT], bri[LIGHTS_COUNT]; 44 | float step_level[LIGHTS_COUNT], current_bri[LIGHTS_COUNT]; 45 | byte mac[6]; 46 | 47 | WebServer server(80); 48 | HTTPUpdateServer httpUpdateServer; 49 | WiFiManager wm; 50 | 51 | 52 | void blinkLed(uint8_t count, uint16_t interval = 200) { 53 | for (uint8_t i = 0; i < count; i++) { 54 | digitalWrite(ledGPIO, LOW); 55 | delay(interval); 56 | digitalWrite(ledGPIO, HIGH); 57 | delay(interval); 58 | } 59 | } 60 | 61 | void ledcAnalogWrite(uint8_t channel, uint32_t value, uint32_t valueMax = 255) { 62 | // calculate duty, 4095 from 2 ^ 12 - 1 63 | uint32_t duty = (4095 / valueMax) * min(value, valueMax); 64 | 65 | // write duty to LEDC 66 | ledcWrite(channel, duty); 67 | } 68 | 69 | 70 | void factoryReset() { 71 | digitalWrite(ledGPIO, HIGH); 72 | LittleFS.format(); 73 | WiFi.disconnect(false, true); 74 | blinkLed(8, 100); 75 | ESP.restart(); 76 | } 77 | 78 | void handleNotFound() { 79 | String message = "File Not Found\n\n"; 80 | message += "URI: "; 81 | message += server.uri(); 82 | message += "\nMethod: "; 83 | message += (server.method() == HTTP_GET) ? "GET" : "POST"; 84 | message += "\nArguments: "; 85 | message += server.args(); 86 | message += "\n"; 87 | for (uint8_t i = 0; i < server.args(); i++) { 88 | message += " " + server.argName(i) + ": " + server.arg(i) + "\n"; 89 | } 90 | server.send(404, "text/plain", message); 91 | } 92 | 93 | 94 | void apply_scene(uint8_t new_scene, uint8_t light) { 95 | if ( new_scene == 0) { 96 | bri[light] = 144; 97 | } else if ( new_scene == 1) { 98 | bri[light] = 254; 99 | } else if ( new_scene == 2) { 100 | bri[light] = 1; 101 | } 102 | } 103 | 104 | void process_lightdata(uint8_t light, float transitiontime) { 105 | transitiontime *= 33; 106 | if (light_state[light]) { 107 | step_level[light] = (bri[light] - current_bri[light]) / transitiontime; 108 | } else { 109 | step_level[light] = current_bri[light] / transitiontime; 110 | } 111 | } 112 | 113 | 114 | void lightEngine() { 115 | for (int i = 0; i < LIGHTS_COUNT; i++) { 116 | if (light_state[i]) { 117 | if (bri[i] != current_bri[i]) { 118 | in_transition = true; 119 | current_bri[i] += step_level[i]; 120 | if ((step_level[i] > 0.0 && current_bri[i] > bri[i]) || (step_level[i] < 0.0 && current_bri[i] < bri[i])) { 121 | current_bri[i] = bri[i]; 122 | } 123 | ledcWrite(LEDC_CHANNEL_0, (int)(current_bri[i] * 16)); 124 | // ledcAnalogWrite(LEDC_CHANNEL_0, (int)(current_bri[i])); 125 | } 126 | } else { 127 | if (current_bri[i] != 0 ) { 128 | in_transition = true; 129 | current_bri[i] -= step_level[i]; 130 | if (current_bri[i] < 0) { 131 | current_bri[i] = 0; 132 | } 133 | //ledcAnalogWrite(LEDC_CHANNEL_0, (int)(current_bri[i])); 134 | ledcWrite(LEDC_CHANNEL_0, (int)(current_bri[i] * 16)); 135 | 136 | } 137 | } 138 | } 139 | if (in_transition) { 140 | delay(2); 141 | in_transition = false; 142 | } else if (use_hardware_switch == true) { 143 | if (digitalRead(button1_pin) == HIGH) { 144 | int i = 0; 145 | while (digitalRead(button1_pin) == HIGH && i < 30) { 146 | delay(20); 147 | i++; 148 | } 149 | for (int light = 0; light < LIGHTS_COUNT; light++) { 150 | if (i < 30) { 151 | // there was a short press 152 | light_state[light] = true; 153 | } 154 | else { 155 | // there was a long press 156 | bri[light] += 56; 157 | if (bri[light] > 254) { 158 | // don't increase the brightness more then maximum value 159 | bri[light] = 254; 160 | } 161 | } 162 | process_lightdata(light, 4); 163 | } 164 | } else if (digitalRead(button2_pin) == HIGH) { 165 | int i = 0; 166 | while (digitalRead(button2_pin) == HIGH && i < 30) { 167 | delay(20); 168 | i++; 169 | } 170 | for (int light = 0; light < LIGHTS_COUNT; light++) { 171 | if (i < 30) { 172 | // there was a short press 173 | light_state[light] = false; 174 | } 175 | else { 176 | // there was a long press 177 | bri[light] -= 56; 178 | if (bri[light] < 1) { 179 | // don't decrease the brightness less than minimum value. 180 | bri[light] = 1; 181 | } 182 | } 183 | process_lightdata(light, 4); 184 | } 185 | } 186 | } 187 | } 188 | 189 | 190 | void setup() { 191 | EEPROM.begin(512); 192 | ledcSetup(LEDC_CHANNEL_0, LEDC_BASE_FREQ, LEDC_TIMER_12_BIT); 193 | ledcAttachPin(LED_PIN, LEDC_CHANNEL_0); 194 | pinMode(ledGPIO, OUTPUT); 195 | blinkLed(1); 196 | ledcAnalogWrite(LEDC_CHANNEL_0, 50); 197 | 198 | #ifdef USE_STATIC_IP 199 | WiFi.config(strip_ip, gateway_ip, subnet_mask); 200 | #endif 201 | 202 | for (uint8_t light = 0; light < LIGHTS_COUNT; light++) { 203 | apply_scene(EEPROM.read(2), light); 204 | step_level[light] = bri[light] / 150.0; 205 | } 206 | 207 | if (EEPROM.read(1) == 1 || (EEPROM.read(1) == 0 && EEPROM.read(0) == 1)) { 208 | for (int i = 0; i < LIGHTS_COUNT; i++) { 209 | light_state[i] = true; 210 | } 211 | for (int j = 0; j < 200; j++) { 212 | lightEngine(); 213 | } 214 | } 215 | WiFi.mode(WIFI_STA); 216 | wm.setDebugOutput(false); 217 | wm.setConfigPortalTimeout(120); 218 | 219 | 220 | bool res; 221 | res = wm.autoConnect(light_name); 222 | 223 | if (!res) { 224 | ESP.restart(); 225 | } 226 | 227 | if (! light_state[0]) { 228 | // Show that we are connected 229 | ledcAnalogWrite(LEDC_CHANNEL_0, 50); 230 | delay(500); 231 | ledcAnalogWrite(LEDC_CHANNEL_0, 0); 232 | } 233 | 234 | WiFi.macAddress(mac); 235 | 236 | 237 | httpUpdateServer.setup(&server); // start http server 238 | 239 | if (use_hardware_switch == true) { 240 | pinMode(button1_pin, INPUT); 241 | pinMode(button2_pin, INPUT); 242 | } 243 | 244 | 245 | server.on("/state", HTTP_PUT, []() { // HTTP PUT request used to set a new light state 246 | DynamicJsonDocument root(1024); 247 | DeserializationError error = deserializeJson(root, server.arg("plain")); 248 | 249 | if (error) { 250 | server.send(404, "text/plain", "FAIL. " + server.arg("plain")); 251 | } else { 252 | for (JsonPair state : root.as()) { 253 | const char* key = state.key().c_str(); 254 | int light = atoi(key) - 1; 255 | JsonObject values = state.value(); 256 | int transitiontime = 4; 257 | 258 | if (values.containsKey("on")) { 259 | if (values["on"]) { 260 | light_state[light] = true; 261 | if (EEPROM.read(1) == 0 && EEPROM.read(0) == 0) { 262 | EEPROM.write(0, 1); 263 | } 264 | } else { 265 | light_state[light] = false; 266 | if (EEPROM.read(1) == 0 && EEPROM.read(0) == 1) { 267 | EEPROM.write(0, 0); 268 | } 269 | } 270 | } 271 | 272 | if (values.containsKey("bri")) { 273 | bri[light] = values["bri"]; 274 | } 275 | 276 | if (values.containsKey("bri_inc")) { 277 | bri[light] += (int) values["bri_inc"]; 278 | if (bri[light] > 255) bri[light] = 255; 279 | else if (bri[light] < 1) bri[light] = 1; 280 | } 281 | 282 | if (values.containsKey("transitiontime")) { 283 | transitiontime = values["transitiontime"]; 284 | } 285 | process_lightdata(light, transitiontime); 286 | } 287 | String output; 288 | serializeJson(root, output); 289 | server.send(200, "text/plain", output); 290 | } 291 | }); 292 | 293 | server.on("/state", HTTP_GET, []() { // HTTP GET request used to fetch current light state 294 | uint8_t light = server.arg("light").toInt() - 1; 295 | DynamicJsonDocument root(1024); 296 | root["on"] = light_state[light]; 297 | root["bri"] = bri[light]; 298 | String output; 299 | serializeJson(root, output); 300 | server.send(200, "text/plain", output); 301 | }); 302 | 303 | 304 | server.on("/detect", []() { // HTTP GET request used to discover the light type 305 | char macString[32] = {0}; 306 | sprintf(macString, "%02X:%02X:%02X:%02X:%02X:%02X", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); 307 | DynamicJsonDocument root(1024); 308 | root["name"] = light_name; 309 | root["lights"] = LIGHTS_COUNT; 310 | root["protocol"] = "native_multi"; 311 | root["modelid"] = "LWB010"; 312 | root["type"] = "dimmable_light"; 313 | root["mac"] = String(macString); 314 | root["version"] = LIGHT_VERSION; 315 | String output; 316 | serializeJson(root, output); 317 | server.send(200, "text/plain", output); 318 | }); 319 | 320 | server.on("/", []() { 321 | float transitiontime = 4; 322 | if (server.hasArg("startup")) { 323 | if ( EEPROM.read(1) != server.arg("startup").toInt()) { 324 | EEPROM.write(1, server.arg("startup").toInt()); 325 | EEPROM.commit(); 326 | } 327 | } 328 | 329 | for (int light = 0; light < LIGHTS_COUNT; light++) { 330 | if (server.hasArg("scene")) { 331 | if (server.arg("bri") == "" && server.arg("hue") == "" && server.arg("ct") == "" && server.arg("sat") == "") { 332 | if ( EEPROM.read(2) != server.arg("scene").toInt()) { 333 | EEPROM.write(2, server.arg("scene").toInt()); 334 | EEPROM.commit(); 335 | } 336 | apply_scene(server.arg("scene").toInt(), light); 337 | } else { 338 | if (server.arg("bri") != "") { 339 | bri[light] = server.arg("bri").toInt(); 340 | } 341 | } 342 | } else if (server.hasArg("on")) { 343 | if (server.arg("on") == "true") { 344 | light_state[light] = true; { 345 | if (EEPROM.read(1) == 0 && EEPROM.read(0) == 0) { 346 | EEPROM.write(0, 1); 347 | } 348 | } 349 | } else { 350 | light_state[light] = false; 351 | if (EEPROM.read(1) == 0 && EEPROM.read(0) == 1) { 352 | EEPROM.write(0, 0); 353 | } 354 | } 355 | EEPROM.commit(); 356 | } else if (server.hasArg("alert")) { 357 | if (light_state[light]) { 358 | current_bri[light] = 0; 359 | } else { 360 | current_bri[light] = 255; 361 | } 362 | } 363 | if (light_state[light]) { 364 | step_level[light] = ((float)bri[light] - current_bri[light]) / transitiontime; 365 | } else { 366 | step_level[light] = current_bri[light] / transitiontime; 367 | } 368 | } 369 | if (server.hasArg("reset")) { 370 | ESP.restart(); 371 | } 372 | 373 | 374 | String http_content = ""; 375 | http_content += ""; 376 | http_content += ""; 377 | http_content += ""; 378 | http_content += ""; 379 | http_content += "Light Setup"; 380 | http_content += ""; 381 | http_content += ""; 382 | http_content += ""; 383 | http_content += "
"; 384 | http_content += "

Light Setup

"; 385 | http_content += "
"; 386 | http_content += "
"; 387 | http_content += ""; 388 | http_content += "ON"; 389 | http_content += "OFF"; 390 | http_content += "
"; 391 | http_content += "
"; 392 | http_content += ""; 393 | http_content += ""; 398 | http_content += "
"; 399 | http_content += "
"; 400 | http_content += ""; 401 | http_content += ""; 406 | http_content += "
"; 407 | http_content += "
"; 408 | http_content += "
"; 409 | http_content += ""; 410 | http_content += "
"; 411 | http_content += "
"; 412 | http_content += ""; 413 | http_content += ""; 414 | http_content += "
"; 415 | 416 | http_content += "
"; 417 | http_content += "alert or reset"; 418 | http_content += ""; 420 | http_content += ""; 421 | http_content += "
"; 422 | http_content += "
"; 423 | http_content += ""; 424 | http_content += ""; 425 | http_content += ""; 426 | 427 | 428 | server.send(200, "text/html", http_content); 429 | 430 | }); 431 | 432 | server.on("/reset", []() { // trigger manual reset 433 | server.send(200, "text/html", "reset"); 434 | delay(1000); 435 | ESP.restart(); 436 | }); 437 | 438 | 439 | server.on("/factory", []() { // trigger manual reset 440 | server.send(200, "text/html", "factory reset"); 441 | factoryReset(); 442 | }); 443 | 444 | server.onNotFound(handleNotFound); 445 | 446 | server.begin(); 447 | digitalWrite(ledGPIO, LOW); 448 | } 449 | 450 | void loop() { 451 | server.handleClient(); 452 | lightEngine(); 453 | } -------------------------------------------------------------------------------- /ESP32/ESP32_C3_Gradient_Strip/ESP32_C3_Gradient_Strip.ino.esp32c3.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diyhue/Lights/5c7d5816f07d55b7df05a53115db783ecb733042/ESP32/ESP32_C3_Gradient_Strip/ESP32_C3_Gradient_Strip.ino.esp32c3.bin -------------------------------------------------------------------------------- /ESP32/ESP32_C3_SK6812_Gradient_Strip/ESP32_C3_SK6812_Gradient_Strip.ino.esp32c3.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diyhue/Lights/5c7d5816f07d55b7df05a53115db783ecb733042/ESP32/ESP32_C3_SK6812_Gradient_Strip/ESP32_C3_SK6812_Gradient_Strip.ino.esp32c3.bin -------------------------------------------------------------------------------- /ESP32/Luma/Firmware/luma-gradient.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diyhue/Lights/5c7d5816f07d55b7df05a53115db783ecb733042/ESP32/Luma/Firmware/luma-gradient.bin -------------------------------------------------------------------------------- /ESP8266/Generic_Dimmable_Light/Generic_Dimmable_Light.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #define light_name "Dimmable Hue Light" //default light name 10 | #define LIGHT_VERSION 2.1 11 | 12 | #define use_hardware_switch false // To control on/off state and brightness using GPIO/Pushbutton, set this value to true. 13 | //For GPIO based on/off and brightness control, it is mandatory to connect the following GPIO pins to ground using 10k resistor 14 | #define button1_pin 4 // on and brightness up 15 | #define button2_pin 5 // off and brightness down 16 | 17 | //define pins 18 | #define LIGHTS_COUNT 4 19 | uint8_t pins[LIGHTS_COUNT] = {12, 15, 13, 14}; 20 | 21 | //#define USE_STATIC_IP //! uncomment to enable Static IP Adress 22 | #ifdef USE_STATIC_IP 23 | IPAddress strip_ip ( 192, 168, 0, 95); // choose an unique IP Adress 24 | IPAddress gateway_ip ( 192, 168, 0, 1); // Router IP 25 | IPAddress subnet_mask(255, 255, 255, 0); 26 | #endif 27 | 28 | uint8_t scene; 29 | bool light_state[LIGHTS_COUNT], in_transition; 30 | int transitiontime[LIGHTS_COUNT], bri[LIGHTS_COUNT]; 31 | float step_level[LIGHTS_COUNT], current_bri[LIGHTS_COUNT]; 32 | byte mac[6]; 33 | 34 | ESP8266WebServer server(80); 35 | ESP8266HTTPUpdateServer httpUpdateServer; 36 | 37 | void handleNotFound() { 38 | String message = "File Not Found\n\n"; 39 | message += "URI: "; 40 | message += server.uri(); 41 | message += "\nMethod: "; 42 | message += (server.method() == HTTP_GET) ? "GET" : "POST"; 43 | message += "\nArguments: "; 44 | message += server.args(); 45 | message += "\n"; 46 | for (uint8_t i = 0; i < server.args(); i++) { 47 | message += " " + server.argName(i) + ": " + server.arg(i) + "\n"; 48 | } 49 | server.send(404, "text/plain", message); 50 | } 51 | 52 | 53 | void apply_scene(uint8_t new_scene, uint8_t light) { 54 | if ( new_scene == 0) { 55 | bri[light] = 144; 56 | } else if ( new_scene == 1) { 57 | bri[light] = 254; 58 | } else if ( new_scene == 2) { 59 | bri[light] = 1; 60 | } 61 | } 62 | 63 | void process_lightdata(uint8_t light, float transitiontime) { 64 | transitiontime *= 16; 65 | if (light_state[light]) { 66 | step_level[light] = (bri[light] - current_bri[light]) / transitiontime; 67 | } else { 68 | step_level[light] = current_bri[light] / transitiontime; 69 | } 70 | } 71 | 72 | 73 | void lightEngine() { 74 | for (int i = 0; i < LIGHTS_COUNT; i++) { 75 | if (light_state[i]) { 76 | if (bri[i] != current_bri[i]) { 77 | in_transition = true; 78 | current_bri[i] += step_level[i]; 79 | if ((step_level[i] > 0.0 && current_bri[i] > bri[i]) || (step_level[i] < 0.0 && current_bri[i] < bri[i])) { 80 | current_bri[i] = bri[i]; 81 | } 82 | analogWrite(pins[i], (int)(current_bri[i] * 4)); 83 | } 84 | } else { 85 | if (current_bri[i] != 0 ) { 86 | in_transition = true; 87 | current_bri[i] -= step_level[i]; 88 | if (current_bri[i] < 0) { 89 | current_bri[i] = 0; 90 | } 91 | analogWrite(pins[i], (int)(current_bri[i] * 4)); 92 | } 93 | } 94 | } 95 | if (in_transition) { 96 | delay(6); 97 | in_transition = false; 98 | } else if (use_hardware_switch == true) { 99 | if (digitalRead(button1_pin) == HIGH) { 100 | int i = 0; 101 | while (digitalRead(button1_pin) == HIGH && i < 30) { 102 | delay(20); 103 | i++; 104 | } 105 | for (int light = 0; light < LIGHTS_COUNT; light++) { 106 | if (i < 30) { 107 | // there was a short press 108 | light_state[light] = true; 109 | } 110 | else { 111 | // there was a long press 112 | bri[light] += 56; 113 | if (bri[light] > 254) { 114 | // don't increase the brightness more then maximum value 115 | bri[light] = 254; 116 | } 117 | } 118 | process_lightdata(light, 4); 119 | } 120 | } else if (digitalRead(button2_pin) == HIGH) { 121 | int i = 0; 122 | while (digitalRead(button2_pin) == HIGH && i < 30) { 123 | delay(20); 124 | i++; 125 | } 126 | for (int light = 0; light < LIGHTS_COUNT; light++) { 127 | if (i < 30) { 128 | // there was a short press 129 | light_state[light] = false; 130 | } 131 | else { 132 | // there was a long press 133 | bri[light] -= 56; 134 | if (bri[light] < 1) { 135 | // don't decrease the brightness less than minimum value. 136 | bri[light] = 1; 137 | } 138 | } 139 | process_lightdata(light, 4); 140 | } 141 | } 142 | } 143 | } 144 | 145 | void setup() { 146 | EEPROM.begin(512); 147 | 148 | #ifdef USE_STATIC_IP 149 | WiFi.config(strip_ip, gateway_ip, subnet_mask); 150 | #endif 151 | 152 | for (uint8_t light = 0; light < LIGHTS_COUNT; light++) { 153 | apply_scene(EEPROM.read(2), light); 154 | step_level[light] = bri[light] / 150.0; 155 | } 156 | 157 | if (EEPROM.read(1) == 1 || (EEPROM.read(1) == 0 && EEPROM.read(0) == 1)) { 158 | for (int i = 0; i < LIGHTS_COUNT; i++) { 159 | light_state[i] = true; 160 | } 161 | for (int j = 0; j < 200; j++) { 162 | lightEngine(); 163 | } 164 | } 165 | WiFi.mode(WIFI_STA); 166 | WiFiManager wifiManager; 167 | wifiManager.setConfigPortalTimeout(120); 168 | wifiManager.autoConnect(light_name); 169 | 170 | if (! light_state[0]) { 171 | // Show that we are connected 172 | analogWrite(pins[0], 100); 173 | delay(500); 174 | analogWrite(pins[0], 0); 175 | } 176 | 177 | WiFi.macAddress(mac); 178 | 179 | pinMode(LED_BUILTIN, OUTPUT); // Initialize the LED_BUILTIN pin as an output 180 | digitalWrite(LED_BUILTIN, HIGH); // Turn the LED off by making the voltage HIGH 181 | 182 | httpUpdateServer.setup(&server); // start http server 183 | 184 | if (use_hardware_switch == true) { 185 | pinMode(button1_pin, INPUT); 186 | pinMode(button2_pin, INPUT); 187 | } 188 | 189 | 190 | server.on("/state", HTTP_PUT, []() { // HTTP PUT request used to set a new light state 191 | DynamicJsonDocument root(1024); 192 | DeserializationError error = deserializeJson(root, server.arg("plain")); 193 | 194 | if (error) { 195 | server.send(404, "text/plain", "FAIL. " + server.arg("plain")); 196 | } else { 197 | for (JsonPair state : root.as()) { 198 | const char* key = state.key().c_str(); 199 | int light = atoi(key) - 1; 200 | JsonObject values = state.value(); 201 | int transitiontime = 4; 202 | 203 | if (values.containsKey("on")) { 204 | if (values["on"]) { 205 | light_state[light] = true; 206 | if (EEPROM.read(1) == 0 && EEPROM.read(0) == 0) { 207 | EEPROM.write(0, 1); 208 | } 209 | } else { 210 | light_state[light] = false; 211 | if (EEPROM.read(1) == 0 && EEPROM.read(0) == 1) { 212 | EEPROM.write(0, 0); 213 | } 214 | } 215 | } 216 | 217 | if (values.containsKey("bri")) { 218 | bri[light] = values["bri"]; 219 | } 220 | 221 | if (values.containsKey("bri_inc")) { 222 | bri[light] += (int) values["bri_inc"]; 223 | if (bri[light] > 255) bri[light] = 255; 224 | else if (bri[light] < 1) bri[light] = 1; 225 | } 226 | 227 | if (values.containsKey("transitiontime")) { 228 | transitiontime = values["transitiontime"]; 229 | } 230 | process_lightdata(light, transitiontime); 231 | } 232 | String output; 233 | serializeJson(root, output); 234 | server.send(200, "text/plain", output); 235 | } 236 | }); 237 | 238 | server.on("/state", HTTP_GET, []() { // HTTP GET request used to fetch current light state 239 | uint8_t light = server.arg("light").toInt() - 1; 240 | DynamicJsonDocument root(1024); 241 | root["on"] = light_state[light]; 242 | root["bri"] = bri[light]; 243 | String output; 244 | serializeJson(root, output); 245 | server.send(200, "text/plain", output); 246 | }); 247 | 248 | 249 | server.on("/detect", []() { // HTTP GET request used to discover the light type 250 | char macString[32] = {0}; 251 | sprintf(macString, "%02X:%02X:%02X:%02X:%02X:%02X", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); 252 | DynamicJsonDocument root(1024); 253 | root["name"] = light_name; 254 | root["lights"] = LIGHTS_COUNT; 255 | root["protocol"] = "native_multi"; 256 | root["modelid"] = "LWB010"; 257 | root["type"] = "dimmable_light"; 258 | root["mac"] = String(macString); 259 | root["version"] = LIGHT_VERSION; 260 | String output; 261 | serializeJson(root, output); 262 | server.send(200, "text/plain", output); 263 | }); 264 | 265 | server.on("/", []() { 266 | float transitiontime = 4; 267 | if (server.hasArg("startup")) { 268 | if ( EEPROM.read(1) != server.arg("startup").toInt()) { 269 | EEPROM.write(1, server.arg("startup").toInt()); 270 | EEPROM.commit(); 271 | } 272 | } 273 | 274 | for (int light = 0; light < LIGHTS_COUNT; light++) { 275 | if (server.hasArg("scene")) { 276 | if (server.arg("bri") == "" && server.arg("hue") == "" && server.arg("ct") == "" && server.arg("sat") == "") { 277 | if ( EEPROM.read(2) != server.arg("scene").toInt()) { 278 | EEPROM.write(2, server.arg("scene").toInt()); 279 | EEPROM.commit(); 280 | } 281 | apply_scene(server.arg("scene").toInt(), light); 282 | } else { 283 | if (server.arg("bri") != "") { 284 | bri[light] = server.arg("bri").toInt(); 285 | } 286 | } 287 | } else if (server.hasArg("on")) { 288 | if (server.arg("on") == "true") { 289 | light_state[light] = true; { 290 | if (EEPROM.read(1) == 0 && EEPROM.read(0) == 0) { 291 | EEPROM.write(0, 1); 292 | } 293 | } 294 | } else { 295 | light_state[light] = false; 296 | if (EEPROM.read(1) == 0 && EEPROM.read(0) == 1) { 297 | EEPROM.write(0, 0); 298 | } 299 | } 300 | EEPROM.commit(); 301 | } else if (server.hasArg("alert")) { 302 | if (light_state[light]) { 303 | current_bri[light] = 0; 304 | } else { 305 | current_bri[light] = 255; 306 | } 307 | } 308 | if (light_state[light]) { 309 | step_level[light] = ((float)bri[light] - current_bri[light]) / transitiontime; 310 | } else { 311 | step_level[light] = current_bri[light] / transitiontime; 312 | } 313 | } 314 | if (server.hasArg("reset")) { 315 | ESP.reset(); 316 | } 317 | 318 | 319 | String http_content = ""; 320 | http_content += ""; 321 | http_content += ""; 322 | http_content += ""; 323 | http_content += ""; 324 | http_content += "Light Setup"; 325 | http_content += ""; 326 | http_content += ""; 327 | http_content += ""; 328 | http_content += "
"; 329 | http_content += "

Light Setup

"; 330 | http_content += "
"; 331 | http_content += "
"; 332 | http_content += ""; 333 | http_content += "ON"; 334 | http_content += "OFF"; 335 | http_content += "
"; 336 | http_content += "
"; 337 | http_content += ""; 338 | http_content += ""; 343 | http_content += "
"; 344 | http_content += "
"; 345 | http_content += ""; 346 | http_content += ""; 351 | http_content += "
"; 352 | http_content += "
"; 353 | http_content += "
"; 354 | http_content += ""; 355 | http_content += "
"; 356 | http_content += "
"; 357 | http_content += ""; 358 | http_content += ""; 359 | http_content += "
"; 360 | 361 | http_content += "
"; 362 | http_content += "alert or reset"; 363 | http_content += ""; 365 | http_content += ""; 366 | http_content += "
"; 367 | http_content += "
"; 368 | http_content += ""; 369 | http_content += ""; 370 | http_content += ""; 371 | 372 | 373 | server.send(200, "text/html", http_content); 374 | 375 | }); 376 | 377 | server.on("/reset", []() { // trigger manual reset 378 | server.send(200, "text/html", "reset"); 379 | delay(1000); 380 | ESP.restart(); 381 | }); 382 | 383 | server.onNotFound(handleNotFound); 384 | 385 | server.begin(); 386 | } 387 | 388 | void loop() { 389 | server.handleClient(); 390 | lightEngine(); 391 | } 392 | -------------------------------------------------------------------------------- /ESP8266/Generic_Dimmable_Light/README.md: -------------------------------------------------------------------------------- 1 | # Custom light instruction 2 | 3 | This build is for: https://github.com/mariusmotea/diyHue/tree/master/Lights/Arduino/Generic_Dimmable_Light 4 | 5 | 1. try out your parts and plan pathways 6 | 7 | 2. solder gnd/- pathway and the 1k OHM resistors in place 8 | 9 | 3. fasten wemos headers, and connect G pin to ground pathway 10 | 11 | 4. Bring a wires from GPIO pins to the paths with resistors 12 | 13 | 5. Fasten the blue cables (these go to the - of your strip(s)) (the board in the picture will have 2 individual controlable lights, you can have multiple strips on each) 14 | 15 | 7. Fasten 3 pin headers for mosfets 16 | 17 | 8. Connect the various paths to 3 pin headers 18 | 19 | 9. Done 20 | 21 | 22 | This build is very simular to the Generic RGBW light build. (didnt take picture with the mosfets and wemos inserted, but i guess this can be imagined) make sure the G pin on the wemos hits the grounded path. 23 | 24 | ![Top](https://github.com/mariusmotea/diyHue/blob/master/Lights/Arduino/Generic_Dimmable_Light/images/Over.jpg?raw=true) 25 | ![Back](https://github.com/mariusmotea/diyHue/blob/master/Lights/Arduino/Generic_Dimmable_Light/images/Under.jpg?raw=true) 26 | 27 | ## Components 28 | [IRLB8721-TO220 MOSFETS (2x)](https://www.aliexpress.com/item/10PCS-IRLB8721-TO220-IRLB8721PBF-TO-220-free-shipping/32714364118.html) 29 | 30 | [Wemos D1 mini (1x)](https://www.aliexpress.com/item/ESP8266-ESP12-ESP-12-WeMos-D1-Mini-WIFI-Dev-Kit-Development-Board-NodeMCU-Lua/32653918483.html) 31 | 32 | [1k OHM resistor (2x)](https://www.aliexpress.com/item/100pcs-1-4W-Metal-Film-Resistor-1K-ohm-1KR-1-Tolerance-Precision-RoHS-Lead-Free-In/1851964338.html) 33 | 34 | [Female Headers (2x)](https://www.aliexpress.com/item/10-10-pcs-Single-Row-Pin-Female-Header-Socket-2-54mm-Pitch-1-10p-12p-20p/32783590196.html) 35 | 36 | [Prototyping board (1x)](https://www.aliexpress.com/item/20pcs-5x7-4x6-3x7-2x8-cm-double-Side-Copper-prototype-pcb-Universal-Board-for-Arduino/1847727667.html) 37 | -------------------------------------------------------------------------------- /ESP8266/Generic_Dimmable_Light/images/Over.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diyhue/Lights/5c7d5816f07d55b7df05a53115db783ecb733042/ESP8266/Generic_Dimmable_Light/images/Over.jpg -------------------------------------------------------------------------------- /ESP8266/Generic_Dimmable_Light/images/Under.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diyhue/Lights/5c7d5816f07d55b7df05a53115db783ecb733042/ESP8266/Generic_Dimmable_Light/images/Under.jpg -------------------------------------------------------------------------------- /ESP8266/Generic_ON_OFF_device/Generic_ON_OFF_device.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #define light_name "Hue Plug" //default light name 10 | #define LIGHT_VERSION 2.1 11 | 12 | //define pins 13 | #define LIGHTS_COUNT 4 14 | uint8_t pins[LIGHTS_COUNT] = {12, 15, 13, 14}; 15 | 16 | 17 | //#define USE_STATIC_IP //! uncomment to enable Static IP Adress 18 | #ifdef USE_STATIC_IP 19 | IPAddress strip_ip ( 192, 168, 0, 95); // choose an unique IP Adress 20 | IPAddress gateway_ip ( 192, 168, 0, 1); // Router IP 21 | IPAddress subnet_mask(255, 255, 255, 0); 22 | #endif 23 | 24 | uint8_t scene; 25 | bool light_state[LIGHTS_COUNT]; 26 | byte mac[6]; 27 | 28 | ESP8266WebServer server(80); 29 | ESP8266HTTPUpdateServer httpUpdateServer; 30 | 31 | void handleNotFound() { 32 | String message = "File Not Found\n\n"; 33 | message += "URI: "; 34 | message += server.uri(); 35 | message += "\nMethod: "; 36 | message += (server.method() == HTTP_GET) ? "GET" : "POST"; 37 | message += "\nArguments: "; 38 | message += server.args(); 39 | message += "\n"; 40 | for (uint8_t i = 0; i < server.args(); i++) { 41 | message += " " + server.argName(i) + ": " + server.arg(i) + "\n"; 42 | } 43 | server.send(404, "text/plain", message); 44 | } 45 | 46 | 47 | void setup() { 48 | EEPROM.begin(512); 49 | 50 | for (uint8_t ch = 0; ch < LIGHTS_COUNT; ch++) { 51 | pinMode(pins[ch], OUTPUT); 52 | } 53 | 54 | #ifdef USE_STATIC_IP 55 | WiFi.config(strip_ip, gateway_ip, subnet_mask); 56 | #endif 57 | 58 | 59 | if (EEPROM.read(1) == 1 || (EEPROM.read(1) == 0 && EEPROM.read(0) == 1)) { 60 | for (uint8_t ch = 0; ch < LIGHTS_COUNT; ch++) { 61 | digitalWrite(pins[ch], OUTPUT); 62 | } 63 | 64 | } 65 | WiFi.mode(WIFI_STA); 66 | WiFiManager wifiManager; 67 | wifiManager.setConfigPortalTimeout(120); 68 | wifiManager.autoConnect(light_name); 69 | 70 | WiFi.macAddress(mac); 71 | 72 | server.on("/state", HTTP_PUT, []() { // HTTP PUT request used to set a new light state 73 | DynamicJsonDocument root(1024); 74 | DeserializationError error = deserializeJson(root, server.arg("plain")); 75 | 76 | if (error) { 77 | server.send(404, "text/plain", "FAIL. " + server.arg("plain")); 78 | } else { 79 | for (JsonPair state : root.as()) { 80 | const char* key = state.key().c_str(); 81 | int light = atoi(key) - 1; 82 | JsonObject values = state.value(); 83 | int transitiontime = 4; 84 | 85 | if (values.containsKey("on")) { 86 | if (values["on"]) { 87 | light_state[light] = true; 88 | digitalWrite(pins[light], HIGH); 89 | if (EEPROM.read(1) == 0 && EEPROM.read(0) == 0) { 90 | EEPROM.write(0, 1); 91 | } 92 | } else { 93 | light_state[light] = false; 94 | digitalWrite(pins[light], LOW); 95 | if (EEPROM.read(1) == 0 && EEPROM.read(0) == 1) { 96 | EEPROM.write(0, 0); 97 | } 98 | } 99 | } 100 | } 101 | String output; 102 | serializeJson(root, output); 103 | server.send(200, "text/plain", output); 104 | } 105 | }); 106 | 107 | server.on("/state", HTTP_GET, []() { // HTTP GET request used to fetch current light state 108 | uint8_t light = server.arg("light").toInt() - 1; 109 | DynamicJsonDocument root(1024); 110 | root["on"] = light_state[light]; 111 | String output; 112 | serializeJson(root, output); 113 | server.send(200, "text/plain", output); 114 | }); 115 | 116 | 117 | server.on("/detect", []() { // HTTP GET request used to discover the light type 118 | char macString[32] = {0}; 119 | sprintf(macString, "%02X:%02X:%02X:%02X:%02X:%02X", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); 120 | DynamicJsonDocument root(1024); 121 | root["name"] = light_name; 122 | root["lights"] = LIGHTS_COUNT; 123 | root["protocol"] = "native_multi"; 124 | root["modelid"] = "LOM001"; 125 | root["type"] = "plug_device"; 126 | root["mac"] = String(macString); 127 | root["version"] = LIGHT_VERSION; 128 | String output; 129 | serializeJson(root, output); 130 | server.send(200, "text/plain", output); 131 | }); 132 | 133 | server.on("/", []() { 134 | float transitiontime = 4; 135 | if (server.hasArg("startup")) { 136 | if ( EEPROM.read(1) != server.arg("startup").toInt()) { 137 | EEPROM.write(1, server.arg("startup").toInt()); 138 | EEPROM.commit(); 139 | } 140 | } 141 | 142 | for (uint8_t device = 0; device < LIGHTS_COUNT; device++) { 143 | 144 | if (server.hasArg("on")) { 145 | if (server.arg("on") == "true") { 146 | light_state[device] = true; 147 | digitalWrite(pins[device], HIGH); 148 | if (EEPROM.read(1) == 0 && EEPROM.read(0) != 1) { 149 | EEPROM.write(0, 1); 150 | EEPROM.commit(); 151 | } 152 | } else { 153 | light_state[device] = false; 154 | digitalWrite(pins[device], LOW); 155 | if (EEPROM.read(1) == 0 && EEPROM.read(0) != 0) { 156 | EEPROM.write(0, 0); 157 | EEPROM.commit(); 158 | } 159 | } 160 | } 161 | } 162 | if (server.hasArg("reset")) { 163 | ESP.reset(); 164 | } 165 | 166 | 167 | String http_content = ""; 168 | http_content += ""; 169 | http_content += ""; 170 | http_content += ""; 171 | http_content += ""; 172 | http_content += "Light Setup"; 173 | http_content += ""; 174 | http_content += ""; 175 | http_content += ""; 176 | http_content += "
"; 177 | http_content += "

Light Setup

"; 178 | http_content += "
"; 179 | http_content += "
"; 180 | http_content += ""; 181 | http_content += "ON"; 182 | http_content += "OFF"; 183 | http_content += "
"; 184 | http_content += "
"; 185 | http_content += ""; 186 | http_content += ""; 187 | http_content += ""; 188 | 189 | server.send(200, "text/html", http_content); 190 | 191 | }); 192 | 193 | server.on("/reset", []() { // trigger manual reset 194 | server.send(200, "text/html", "reset"); 195 | delay(1000); 196 | ESP.restart(); 197 | }); 198 | 199 | server.onNotFound(handleNotFound); 200 | 201 | server.begin(); 202 | } 203 | 204 | void loop() { 205 | server.handleClient(); 206 | } 207 | -------------------------------------------------------------------------------- /ESP8266/Generic_ON_OFF_device_433Mhz/Generic_ON_OFF_device_433Mhz.ino: -------------------------------------------------------------------------------- 1 | 2 | 3 | /* 4 | This can control Generic Power Outlets with Remote Control over 433Mhz. 5 | Maximum 8 Devices. 6 | Simulates 2 Remotes with 4 Items each. 7 | Showing 8 Individual Hue Bulbs 8 | 9 | */ 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | RCSwitch mySwitch = RCSwitch(); 21 | 22 | 23 | //############ CONFIG ############ 24 | 25 | #define light_name "Hue Plug" //default light name 26 | #define LIGHT_VERSION 2.1 27 | #define LIGHTS_COUNT 8 // 4 or 8 --> maximum 8 28 | 29 | char* houseCodeA = "11110"; //Group A --> Remote Code for Socket 1-4 30 | char* houseCodeB = "11100"; //Group B --> Remote Code for Socket 5-8 31 | uint8_t transmitterPin = 4; // What Pin is the Transmitter conected? 32 | uint8_t transmitterDelay = 100; // Delay between sending commands in ms //default 100 33 | uint8_t repeatTransmit = 2; // Number of Transmit attempts //default 2 34 | 35 | //##########END OF CONFIG ############## 36 | 37 | 38 | 39 | uint8_t pins[LIGHTS_COUNT] = {12, 13, 14, 5, 12, 13, 14, 5}; //irrelevant 40 | char* deviceId[] = {"10000", "01000", "00100", "00010", "10000", "01000", "00100", "00010"}; 41 | int c; 42 | 43 | //############ CONFIG ############ 44 | 45 | //#define USE_STATIC_IP //! uncomment to enable Static IP Adress 46 | #ifdef USE_STATIC_IP 47 | IPAddress strip_ip ( 192, 168, 0, 95); // choose an unique IP Adress 48 | IPAddress gateway_ip ( 192, 168, 0, 1); // Router IP 49 | IPAddress subnet_mask(255, 255, 255, 0); 50 | #endif 51 | 52 | bool light_state[LIGHTS_COUNT]; 53 | byte mac[6]; 54 | 55 | ESP8266WebServer server(80); 56 | ESP8266HTTPUpdateServer httpUpdateServer; 57 | 58 | void handleNotFound() { 59 | String message = "File Not Found\n\n"; 60 | message += "URI: "; 61 | message += server.uri(); 62 | message += "\nMethod: "; 63 | message += (server.method() == HTTP_GET) ? "GET" : "POST"; 64 | message += "\nArguments: "; 65 | message += server.args(); 66 | message += "\n"; 67 | for (uint8_t i = 0; i < server.args(); i++) { 68 | message += " " + server.argName(i) + ": " + server.arg(i) + "\n"; 69 | } 70 | server.send(404, "text/plain", message); 71 | } 72 | 73 | void SwitchOn433(uint8_t c) { 74 | 75 | for (int x = 0; x < repeatTransmit; x++) { 76 | 77 | if (c <= 3) { 78 | mySwitch.switchOn(houseCodeA, deviceId[c]); 79 | delay(transmitterDelay); 80 | } 81 | else { 82 | mySwitch.switchOn(houseCodeB, deviceId[c]); 83 | delay(transmitterDelay); 84 | 85 | } 86 | 87 | } 88 | 89 | } 90 | void SwitchOff433(uint8_t c) { 91 | 92 | for (int x = 0; x < repeatTransmit; x++) { 93 | 94 | 95 | if (c <= 3) { 96 | mySwitch.switchOff(houseCodeA, deviceId[c]); 97 | delay(transmitterDelay); 98 | 99 | } else { 100 | 101 | mySwitch.switchOff(houseCodeB, deviceId[c]); 102 | delay(transmitterDelay); 103 | } 104 | 105 | } 106 | } 107 | 108 | void setup() { 109 | EEPROM.begin(512); 110 | Serial.begin(115200); 111 | mySwitch.enableTransmit(transmitterPin); 112 | 113 | for (uint8_t ch = 0; ch < LIGHTS_COUNT; ch++) { 114 | pinMode(pins[ch], OUTPUT); 115 | } 116 | 117 | 118 | #ifdef USE_STATIC_IP 119 | WiFi.config(strip_ip, gateway_ip, subnet_mask); 120 | #endif 121 | 122 | 123 | if (EEPROM.read(1) == 1 || (EEPROM.read(1) == 0 && EEPROM.read(0) == 1)) { 124 | for (uint8_t ch = 0; ch < LIGHTS_COUNT; ch++) { 125 | digitalWrite(pins[ch], OUTPUT); 126 | } 127 | 128 | } 129 | 130 | WiFi.mode(WIFI_STA); 131 | WiFiManager wifiManager; 132 | 133 | wifiManager.setConfigPortalTimeout(120); 134 | wifiManager.autoConnect(light_name); 135 | 136 | WiFi.macAddress(mac); 137 | 138 | 139 | server.on("/state", HTTP_PUT, []() { // HTTP PUT request used to set a new light state 140 | DynamicJsonDocument root(1024); 141 | DeserializationError error = deserializeJson(root, server.arg("plain")); 142 | 143 | if (error) { 144 | server.send(404, "text/plain", "FAIL. " + server.arg("plain")); 145 | } else { 146 | for (JsonPair state : root.as()) { 147 | const char* key = state.key().c_str(); 148 | int light = atoi(key) - 1; 149 | JsonObject values = state.value(); 150 | int transitiontime = 4; 151 | 152 | if (values.containsKey("on")) { 153 | if (values["on"]) { 154 | light_state[light] = true; 155 | digitalWrite(pins[light], HIGH); 156 | SwitchOn433(light); 157 | if (EEPROM.read(1) == 0 && EEPROM.read(0) == 0) { 158 | EEPROM.write(0, 1); 159 | } 160 | } else { 161 | light_state[light] = false; 162 | digitalWrite(pins[light], LOW); 163 | SwitchOff433(light); 164 | if (EEPROM.read(1) == 0 && EEPROM.read(0) == 1) { 165 | EEPROM.write(0, 0); 166 | } 167 | } 168 | } 169 | } 170 | String output; 171 | serializeJson(root, output); 172 | server.send(200, "text/plain", output); 173 | } 174 | }); 175 | 176 | server.on("/state", HTTP_GET, []() { // HTTP GET request used to fetch current light state 177 | uint8_t light = server.arg("light").toInt() - 1; 178 | DynamicJsonDocument root(1024); 179 | root["on"] = light_state[light]; 180 | String output; 181 | serializeJson(root, output); 182 | server.send(200, "text/plain", output); 183 | }); 184 | 185 | 186 | server.on("/detect", []() { // HTTP GET request used to discover the light type 187 | char macString[32] = {0}; 188 | sprintf(macString, "%02X:%02X:%02X:%02X:%02X:%02X", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); 189 | DynamicJsonDocument root(1024); 190 | root["name"] = light_name; 191 | root["lights"] = LIGHTS_COUNT; 192 | root["protocol"] = "native_multi"; 193 | root["modelid"] = "LOM001"; 194 | root["type"] = "plug_device"; 195 | root["mac"] = String(macString); 196 | root["version"] = LIGHT_VERSION; 197 | String output; 198 | serializeJson(root, output); 199 | server.send(200, "text/plain", output); 200 | }); 201 | 202 | server.on("/", []() { 203 | float transitiontime = 4; 204 | if (server.hasArg("startup")) { 205 | if ( EEPROM.read(1) != server.arg("startup").toInt()) { 206 | EEPROM.write(1, server.arg("startup").toInt()); 207 | EEPROM.commit(); 208 | } 209 | } 210 | 211 | for (uint8_t device = 0; device < LIGHTS_COUNT; device++) { 212 | 213 | if (server.hasArg("on")) { 214 | if (server.arg("on") == "true") { 215 | light_state[device] = true; 216 | digitalWrite(pins[device], HIGH); 217 | if (EEPROM.read(1) == 0 && EEPROM.read(0) != 1) { 218 | EEPROM.write(0, 1); 219 | EEPROM.commit(); 220 | } 221 | } else { 222 | light_state[device] = false; 223 | digitalWrite(pins[device], LOW); 224 | SwitchOff433(device); 225 | if (EEPROM.read(1) == 0 && EEPROM.read(0) != 0) { 226 | EEPROM.write(0, 0); 227 | EEPROM.commit(); 228 | } 229 | } 230 | } 231 | } 232 | if (server.hasArg("reset")) { 233 | ESP.reset(); 234 | } 235 | 236 | 237 | String http_content = ""; 238 | http_content += ""; 239 | http_content += ""; 240 | http_content += ""; 241 | http_content += ""; 242 | http_content += "Light Setup"; 243 | http_content += ""; 244 | http_content += ""; 245 | http_content += ""; 246 | http_content += "
"; 247 | http_content += "

Light Setup

"; 248 | http_content += "
"; 249 | http_content += "
"; 250 | http_content += ""; 251 | http_content += "ON"; 252 | http_content += "OFF"; 253 | http_content += "
"; 254 | http_content += "
"; 255 | http_content += ""; 256 | http_content += ""; 257 | http_content += ""; 258 | 259 | server.send(200, "text/html", http_content); 260 | 261 | }); 262 | 263 | server.on("/reset", []() { // trigger manual reset 264 | server.send(200, "text/html", "reset"); 265 | delay(1000); 266 | ESP.restart(); 267 | }); 268 | 269 | server.onNotFound(handleNotFound); 270 | 271 | server.begin(); 272 | } 273 | 274 | void loop() { 275 | server.handleClient(); 276 | } 277 | -------------------------------------------------------------------------------- /ESP8266/Generic_ON_OFF_device_433Mhz/images/Fritzing.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diyhue/Lights/5c7d5816f07d55b7df05a53115db783ecb733042/ESP8266/Generic_ON_OFF_device_433Mhz/images/Fritzing.JPG -------------------------------------------------------------------------------- /ESP8266/Generic_ON_OFF_device_433Mhz/images/PCB1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diyhue/Lights/5c7d5816f07d55b7df05a53115db783ecb733042/ESP8266/Generic_ON_OFF_device_433Mhz/images/PCB1.jpg -------------------------------------------------------------------------------- /ESP8266/Generic_ON_OFF_device_433Mhz/images/PCB2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diyhue/Lights/5c7d5816f07d55b7df05a53115db783ecb733042/ESP8266/Generic_ON_OFF_device_433Mhz/images/PCB2.jpg -------------------------------------------------------------------------------- /ESP8266/Generic_ON_OFF_device_433Mhz/images/Schematic.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diyhue/Lights/5c7d5816f07d55b7df05a53115db783ecb733042/ESP8266/Generic_ON_OFF_device_433Mhz/images/Schematic.JPG -------------------------------------------------------------------------------- /ESP8266/Generic_ON_OFF_device_433Mhz/readme.md: -------------------------------------------------------------------------------- 1 | # 433Mhz Power Socket - Control (Hue Bulb Emulation) 2 | This ESP-8266 Firmware controls generic 433Mhz Power Sockets. 3 | Showing up as regular Hue Bulbs with ON/OFF feature. 4 | 5 | * I used one of those cheap Transmitters. [Ebay-Link](https://www.ebay.com/itm/5pcs-433Mhz-RF-transmitter-and-receiver-kit-for-Arduino/381374427148?epid=2037463354&hash=item58cbaff00c:g:8wEAAOSw6EhUN9s-) 6 | * Controlling cheap 433mhz Power Sockets [Picture below] 7 | 8 | * Directly connected to VCC(+3,3V) GPIO4 (Data) and GND. 9 | * You need to Edit your **"House Code"** in order to control the correct Sockets! 10 | 11 | 12 |
13 | 14 |
15 |
16 | 17 |
18 |
19 | 20 |
21 | 22 |
23 |
24 |
25 |
26 | 27 |
28 |
29 |
30 |
31 | 32 |
33 |
34 |
35 |
36 | 37 |
38 | 39 |
40 | -------------------------------------------------------------------------------- /ESP8266/Generic_RGBW_Light/README.md: -------------------------------------------------------------------------------- 1 | # Custom light instruction 2 | 3 | ![Circuit Diagram](https://github.com/mariusmotea/diyHue/blob/master/Lights/Arduino/Generic_RGBW_Light/images/schematic.JPG) 4 | 5 | Start with placing components on your board to make sure you got room for the paths/wires without soldering yourself into trouble :) 6 | 7 | 1. Solder Wemos headers 8 | 9 | 2. Solder the resistors in correct place. Make sure to leave room for the GPIO wire that will come later 10 | 11 | 3. Solder the path for gnd/negative across the board 12 | 13 | 4. Solder path for resistor <-> ground 14 | 15 | 5. Solder/wire the G pin on Wemos to the ground strip running across the board for common ground 16 | 17 | 6. Solder wires from GPIO pins to correct places: D1 = white, D7 = green, D6 = red, D5 = blue 18 | The wires go between the resistor and the 3 pin header for the mosfets and everything connects to the left leg of the mosfet 19 | 20 | 7. Solder the 3 pin female headers 21 | 22 | 8. Solder wires with correct colors to the middle pin of the header 23 | 24 | 9. Insert Wemos and mosfets 25 | 26 | You can use any 12v RGBW or RGBWW strip that has 5 connectors for this build. I recomend the RGBWW strips from what i have experienced so far, the RGBW ones dont make proper yellow/warm light. 27 | 28 | 29 | ![Top](https://github.com/mariusmotea/diyHue/blob/master/Lights/Arduino/Generic_RGBW_Light/images/Over.jpg) 30 | ![Back](https://github.com/mariusmotea/diyHue/blob/master/Lights/Arduino/Generic_RGBW_Light/images/Under.jpg) 31 | 32 | ## Components 33 | 34 | [IRLB8721-TO220 MOSFETS (4x)](https://www.aliexpress.com/item/10PCS-IRLB8721-TO220-IRLB8721PBF-TO-220-free-shipping/32714364118.html) 35 | 36 | [Wemos D1 mini (1x)](https://www.aliexpress.com/item/ESP8266-ESP12-ESP-12-WeMos-D1-Mini-WIFI-Dev-Kit-Development-Board-NodeMCU-Lua/32653918483.html) 37 | 38 | [1k OHM resistor (4x)](https://www.aliexpress.com/item/100pcs-1-4W-Metal-Film-Resistor-1K-ohm-1KR-1-Tolerance-Precision-RoHS-Lead-Free-In/1851964338.html) 39 | 40 | [Female Headers (4x)](https://www.aliexpress.com/item/10-10-pcs-Single-Row-Pin-Female-Header-Socket-2-54mm-Pitch-1-10p-12p-20p/32783590196.html) 41 | 42 | [Prototyping board (1x)](https://www.aliexpress.com/item/20pcs-5x7-4x6-3x7-2x8-cm-double-Side-Copper-prototype-pcb-Universal-Board-for-Arduino/1847727667.html) 43 | 44 | 45 | # Feican RGBW bulb 46 | 47 | https://raw.githubusercontent.com/mariusmotea/diyHue/master/Images/Color_Dream_bulb_with_flash_replaced.jpg 48 | -------------------------------------------------------------------------------- /ESP8266/Generic_RGBW_Light/images/Over.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diyhue/Lights/5c7d5816f07d55b7df05a53115db783ecb733042/ESP8266/Generic_RGBW_Light/images/Over.jpg -------------------------------------------------------------------------------- /ESP8266/Generic_RGBW_Light/images/Under.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diyhue/Lights/5c7d5816f07d55b7df05a53115db783ecb733042/ESP8266/Generic_RGBW_Light/images/Under.jpg -------------------------------------------------------------------------------- /ESP8266/Generic_RGBW_Light/images/schematic.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diyhue/Lights/5c7d5816f07d55b7df05a53115db783ecb733042/ESP8266/Generic_RGBW_Light/images/schematic.JPG -------------------------------------------------------------------------------- /ESP8266/IRremote/IRremote.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include // replace library based on your AC unit model, check https://github.com/markszabo/IRremoteESP8266 12 | 13 | 14 | // all variables can be set from light WebGUI. Change them here only if you want different defaults. 15 | 16 | IPAddress address ( 192, 168, 0, 95); // choose an unique IP Adress 17 | IPAddress gateway ( 192, 168, 0, 1); // Router IP 18 | IPAddress submask(255, 255, 255, 0); 19 | 20 | const uint16_t kIrLed = D2; // ESP8266 GPIO pin to use. Recommended: 4 (D2). 21 | IRCoolixAC ac(kIrLed); // Set the GPIO to be used to sending the message 22 | 23 | #define minDelay 1000 // millis 24 | unsigned long lastEPMillis; 25 | 26 | struct state { 27 | uint8_t bri = 100; 28 | bool lightState; 29 | int ct = 200; 30 | }; 31 | 32 | //core 33 | 34 | state light; 35 | bool inTransition, useDhcp = true; 36 | byte mac[6], packetBuffer[8]; 37 | 38 | //settings 39 | char *lightName = "IR Remote Control"; 40 | 41 | ESP8266WebServer server(80); 42 | WiFiUDP Udp; 43 | ESP8266HTTPUpdateServer httpUpdateServer; 44 | 45 | 46 | bool saveConfig() { 47 | DynamicJsonDocument json(1024); 48 | json["name"] = lightName; 49 | json["dhcp"] = useDhcp; 50 | JsonArray addr = json.createNestedArray("addr"); 51 | addr.add(address[0]); 52 | addr.add(address[1]); 53 | addr.add(address[2]); 54 | addr.add(address[3]); 55 | JsonArray gw = json.createNestedArray("gw"); 56 | gw.add(gateway[0]); 57 | gw.add(gateway[1]); 58 | gw.add(gateway[2]); 59 | gw.add(gateway[3]); 60 | JsonArray mask = json.createNestedArray("mask"); 61 | mask.add(submask[0]); 62 | mask.add(submask[1]); 63 | mask.add(submask[2]); 64 | mask.add(submask[3]); 65 | File configFile = SPIFFS.open("/config.json", "w"); 66 | if (!configFile) { 67 | //Serial.println("Failed to open config file for writing"); 68 | return false; 69 | } 70 | 71 | serializeJson(json, configFile); 72 | return true; 73 | } 74 | 75 | bool loadConfig() { 76 | File configFile = SPIFFS.open("/config.json", "r"); 77 | if (!configFile) { 78 | //Serial.println("Create new file with default values"); 79 | return saveConfig(); 80 | } 81 | 82 | if (configFile.size() > 1024) { 83 | Serial.println("Config file size is too large"); 84 | return false; 85 | } 86 | 87 | DynamicJsonDocument json(1024); 88 | DeserializationError error = deserializeJson(json, configFile.readString()); 89 | if (error) { 90 | Serial.println("Failed to parse config file"); 91 | return false; 92 | } 93 | 94 | strcpy(lightName, json["name"]); 95 | useDhcp = json["dhcp"]; 96 | address = {json["addr"][0], json["addr"][1], json["addr"][2], json["addr"][3]}; 97 | submask = {json["mask"][0], json["mask"][1], json["mask"][2], json["mask"][3]}; 98 | gateway = {json["gw"][0], json["gw"][1], json["gw"][2], json["gw"][3]}; 99 | return true; 100 | } 101 | 102 | void handleNotFound() { 103 | String message = "File Not Found\n\n"; 104 | message += "URI: "; 105 | message += server.uri(); 106 | message += "\nMethod: "; 107 | message += (server.method() == HTTP_GET) ? "GET" : "POST"; 108 | message += "\nArguments: "; 109 | message += server.args(); 110 | message += "\n"; 111 | for (uint8_t i = 0; i < server.args(); i++) { 112 | message += " " + server.argName(i) + ": " + server.arg(i) + "\n"; 113 | } 114 | server.send(404, "text/plain", message); 115 | } 116 | 117 | void setup() { 118 | //Serial.begin(115200); 119 | //Serial.println(); 120 | ac.begin(); 121 | 122 | 123 | delay(1000); 124 | 125 | //Serial.println("mounting FS..."); 126 | 127 | if (!SPIFFS.begin()) { 128 | //Serial.println("Failed to mount file system"); 129 | return; 130 | } 131 | 132 | if (!loadConfig()) { 133 | //Serial.println("Failed to load config"); 134 | } else { 135 | ////Serial.println("Config loaded"); 136 | } 137 | WiFi.mode(WIFI_STA); 138 | WiFiManager wifiManager; 139 | 140 | if (!useDhcp) { 141 | wifiManager.setSTAStaticIPConfig(address, gateway, submask); 142 | } 143 | 144 | if (!wifiManager.autoConnect(lightName)) { 145 | delay(3000); 146 | ESP.reset(); 147 | delay(5000); 148 | } 149 | 150 | if (useDhcp) { 151 | address = WiFi.localIP(); 152 | gateway = WiFi.gatewayIP(); 153 | submask = WiFi.subnetMask(); 154 | } 155 | 156 | WiFi.macAddress(mac); 157 | 158 | httpUpdateServer.setup(&server); 159 | 160 | Udp.begin(2100); 161 | 162 | 163 | server.on("/state", HTTP_PUT, []() { 164 | DynamicJsonDocument root(1024); 165 | DeserializationError error = deserializeJson(root, server.arg("plain")); 166 | if (error) { 167 | server.send(404, "text/plain", "FAIL. " + server.arg("plain")); 168 | } else { 169 | if (root.containsKey("on")) { 170 | light.lightState = root["on"]; 171 | } 172 | 173 | if (root.containsKey("bri")) { 174 | light.bri = (uint8_t) root["bri"]; 175 | } 176 | 177 | if (root.containsKey("ct")) { 178 | light.ct = (int) root["ct"]; 179 | } 180 | 181 | String output; 182 | serializeJson(root, output); 183 | server.send(200, "text/plain", output); 184 | 185 | if ((millis() - lastEPMillis) >= minDelay) { 186 | delay(500); 187 | 188 | ///perform on action to AC unit 189 | if (light.lightState) { 190 | ac.on(); 191 | ///perform actions based on brightness 192 | ac.setTemp(light.bri / 20 + 17); 193 | 194 | ac.setMode(kCoolixAuto); 195 | ac.setFan(kCoolixFanAuto); 196 | } else { 197 | ac.off(); 198 | } 199 | ac.send(); 200 | lastEPMillis = millis(); 201 | 202 | } 203 | } 204 | }); 205 | 206 | server.on("/state", HTTP_GET, []() { 207 | DynamicJsonDocument root(1024); 208 | root["on"] = light.lightState; 209 | root["bri"] = light.bri; 210 | root["ct"] = light.ct; 211 | root["colormode"] = "ct"; 212 | String output; 213 | serializeJson(root, output); 214 | server.send(200, "text/plain", output); 215 | }); 216 | 217 | server.on("/detect", []() { 218 | char macString[32] = {0}; 219 | sprintf(macString, "%02X:%02X:%02X:%02X:%02X:%02X", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); 220 | DynamicJsonDocument root(1024); 221 | root["name"] = lightName; 222 | root["protocol"] = "native_single"; 223 | root["modelid"] = "LTW001"; 224 | root["type"] = "ir"; 225 | root["mac"] = String(macString); 226 | root["version"] = 2.0; 227 | String output; 228 | serializeJson(root, output); 229 | server.send(200, "text/plain", output); 230 | }); 231 | 232 | server.on("/config", []() { 233 | DynamicJsonDocument root(1024); 234 | root["name"] = lightName; 235 | root["dhcp"] = (int)useDhcp; 236 | root["addr"] = (String)address[0] + "." + (String)address[1] + "." + (String)address[2] + "." + (String)address[3]; 237 | root["gw"] = (String)gateway[0] + "." + (String)gateway[1] + "." + (String)gateway[2] + "." + (String)gateway[3]; 238 | root["sm"] = (String)submask[0] + "." + (String)submask[1] + "." + (String)submask[2] + "." + (String)submask[3]; 239 | String output; 240 | serializeJson(root, output); 241 | server.send(200, "text/plain", output); 242 | }); 243 | 244 | server.on("/", []() { 245 | if (server.hasArg("name")) { 246 | server.arg("name").toCharArray(lightName, server.arg("name").length() + 1); 247 | saveConfig(); 248 | } else if (server.hasArg("dhcp")) { 249 | useDhcp = server.arg("dhcp").toInt(); 250 | address.fromString(server.arg("addr")); 251 | gateway.fromString(server.arg("gw")); 252 | submask.fromString(server.arg("sm")); 253 | saveConfig(); 254 | } 255 | 256 | const char * htmlContent = " Hue Light




"; 257 | server.send(200, "text/html", htmlContent); 258 | if (server.args()) { 259 | delay(100); 260 | ESP.reset(); 261 | } 262 | 263 | }); 264 | 265 | server.on("/reset", []() { 266 | server.send(200, "text/html", "reset"); 267 | delay(100); 268 | ESP.reset(); 269 | }); 270 | 271 | server.onNotFound(handleNotFound); 272 | 273 | server.begin(); 274 | } 275 | 276 | 277 | void loop() { 278 | server.handleClient(); 279 | } 280 | -------------------------------------------------------------------------------- /ESP8266/Sonoff_TX_T3/SonoffTXT3US1C-May292020.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | ////////////////////////////// USER SETTINGS ////////////////////////////// 11 | 12 | #define devicesCount 1 // How many Light attach 13 | #define light_name "SonoffTX1C" // default light name (ArduinoOTA name) 14 | #define LIGHT_VERSION 2.1 15 | 16 | uint8_t devicesPins[devicesCount] = {12}; // the pin that the light is attached to (FOR SonoffTX 1 gang) 17 | //uint8_t devicesPins[devicesCount] = {12,5}; // the pin that the light is attached to (FOR SonoffTX 2 gang) 18 | //uint8_t devicesPins[devicesCount] = {12,5,4}; // the pin that the light is attached to (FOR SonoffTX 3 gang) 19 | 20 | uint8_t ledPin = 13; // the pin that the indicator light is attached to 21 | uint8_t button1Pin = 0; // the pin that the pushbutton1 is attached to 22 | uint8_t button2Pin = 9; // the pin that the pushbutton2 is attached to 23 | uint8_t button3Pin = 10; // the pin that the pushbutton3 is attached to 24 | 25 | //////////////////////////////////////////////////////////////////////// 26 | 27 | uint8_t button1State = digitalRead(button1Pin); 28 | uint8_t button2State = digitalRead(button2Pin); 29 | uint8_t button3State = digitalRead(button3Pin); 30 | uint8_t lastButton1State = button1State; 31 | uint8_t lastButton2State = button2State; 32 | uint8_t lastButton3State = button3State; 33 | unsigned long lastButton1Push = 0; 34 | unsigned long lastButton2Push = 0; 35 | unsigned long lastButton3Push = 0; 36 | uint8_t buttonThreshold = 10; 37 | bool device_state[devicesCount]; 38 | byte mac[6]; 39 | ESP8266WebServer server(80); 40 | ESP8266HTTPUpdateServer httpUpdateServer; 41 | 42 | void handleNotFound() { 43 | String message = "File Not Found\n\n"; 44 | message += "URI: "; 45 | message += server.uri(); 46 | message += "\nMethod: "; 47 | message += (server.method() == HTTP_GET) ? "GET" : "POST"; 48 | message += "\nArguments: "; 49 | message += server.args(); 50 | message += "\n"; 51 | for (uint8_t i = 0; i < server.args(); i++) { 52 | message += " " + server.argName(i) + ": " + server.arg(i) + "\n"; 53 | } 54 | server.send(404, "text/plain", message); 55 | } 56 | 57 | void setup() { 58 | 59 | for (uint8_t ch = 0; ch < devicesCount; ch++) { 60 | pinMode(devicesPins[ch], OUTPUT); 61 | } 62 | 63 | digitalWrite(devicesPins[0], HIGH); 64 | digitalWrite(devicesPins[1], HIGH); 65 | digitalWrite(devicesPins[2], HIGH); 66 | EEPROM.begin(512); 67 | pinMode(ledPin, OUTPUT); 68 | pinMode(button1Pin, INPUT); 69 | pinMode(button2Pin, INPUT); 70 | pinMode(button3Pin, INPUT); 71 | digitalWrite(ledPin, HIGH); 72 | WiFi.mode(WIFI_STA); 73 | WiFiManager wifiManager; 74 | wifiManager.setConfigPortalTimeout(120); 75 | wifiManager.autoConnect(light_name); 76 | 77 | WiFi.macAddress(mac); 78 | 79 | if (EEPROM.read(1) == 1 || (EEPROM.read(1) == 0 && EEPROM.read(0) == 1)) { 80 | for (uint8_t ch = 0; ch < devicesCount; ch++) { 81 | digitalWrite(devicesPins[ch], OUTPUT); 82 | } 83 | } 84 | 85 | delay(10000); 86 | WiFi.macAddress(mac); 87 | 88 | 89 | server.on("/state", HTTP_PUT, []() { // HTTP PUT request used to set a new light state 90 | DynamicJsonDocument root(1024); 91 | DeserializationError error = deserializeJson(root, server.arg("plain")); 92 | 93 | if (error) { 94 | server.send(404, "text/plain", "FAIL. " + server.arg("plain")); 95 | } else { 96 | for (JsonPair state : root.as()) { 97 | const char* key = state.key().c_str(); 98 | int device = atoi(key) - 1; 99 | JsonObject values = state.value(); 100 | 101 | if (values.containsKey("on")) { 102 | if (values["on"]) { 103 | device_state[device] = true; 104 | digitalWrite(devicesPins[device], HIGH); 105 | if (EEPROM.read(1) == 0 && EEPROM.read(0) == 0) { 106 | EEPROM.write(0, 1); 107 | } 108 | } else { 109 | device_state[device] = false; 110 | digitalWrite(devicesPins[device], LOW); 111 | if (EEPROM.read(1) == 0 && EEPROM.read(0) == 1) { 112 | EEPROM.write(0, 0); 113 | } 114 | } 115 | } 116 | } 117 | String output; 118 | serializeJson(root, output); 119 | server.send(200, "text/plain", output); 120 | } 121 | }); 122 | 123 | server.on("/state", HTTP_GET, []() { // HTTP GET request used to fetch current light state 124 | uint8_t light = server.arg("light").toInt() - 1; 125 | DynamicJsonDocument root(1024); 126 | root["on"] = device_state[light]; 127 | String output; 128 | serializeJson(root, output); 129 | server.send(200, "text/plain", output); 130 | }); 131 | 132 | 133 | server.on("/detect", []() { // HTTP GET request used to discover the light type 134 | char macString[32] = {0}; 135 | sprintf(macString, "%02X:%02X:%02X:%02X:%02X:%02X", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); 136 | DynamicJsonDocument root(1024); 137 | root["name"] = light_name; 138 | root["lights"] = devicesCount; 139 | root["protocol"] = "native_multi"; 140 | root["modelid"] = "LOM001"; 141 | root["type"] = "plug_device"; 142 | root["mac"] = String(macString); 143 | root["version"] = LIGHT_VERSION; 144 | String output; 145 | serializeJson(root, output); 146 | server.send(200, "text/plain", output); 147 | }); 148 | 149 | server.on("/", []() { 150 | float transitiontime = 100; 151 | if (server.hasArg("startup")) { 152 | if ( EEPROM.read(1) != server.arg("startup").toInt()) { 153 | EEPROM.write(1, server.arg("startup").toInt()); 154 | EEPROM.commit(); 155 | } 156 | } 157 | for (uint8_t device = 0; device < devicesCount; device++) { 158 | if (server.hasArg("on")) { 159 | if (server.arg("on") == "true") { 160 | device_state[device] = true; 161 | digitalWrite(devicesPins[device], HIGH); 162 | if (EEPROM.read(1) == 0 && EEPROM.read(0) != 1) { 163 | EEPROM.write(0, 1); 164 | EEPROM.commit(); 165 | } 166 | } else { 167 | device_state[device] = false; 168 | digitalWrite(devicesPins[device], LOW); 169 | if (EEPROM.read(1) == 0 && EEPROM.read(0) != 0) { 170 | EEPROM.write(0, 0); 171 | EEPROM.commit(); 172 | } 173 | } 174 | } 175 | } 176 | if (server.hasArg("reset")) { 177 | ESP.reset(); 178 | } 179 | 180 | String http_content = ""; 181 | http_content += ""; 182 | http_content += ""; 183 | http_content += ""; 184 | http_content += ""; 185 | http_content += "Light Setup"; 186 | http_content += ""; 187 | http_content += ""; 188 | http_content += ""; 189 | http_content += "
"; 190 | http_content += "

Light Setup

"; 191 | http_content += "
"; 192 | http_content += "
"; 193 | http_content += ""; 194 | http_content += "ON"; 195 | http_content += "OFF"; 196 | http_content += "
"; 197 | http_content += "
"; 198 | http_content += ""; 199 | http_content += ""; 204 | http_content += "
"; 205 | http_content += "
"; 206 | http_content += "alert or reset"; 207 | http_content += ""; 209 | http_content += ""; 210 | http_content += "
"; 211 | http_content += "
"; 212 | http_content += ""; 213 | http_content += ""; 214 | http_content += ""; 215 | server.send(200, "text/html", http_content); 216 | }); 217 | server.onNotFound(handleNotFound); 218 | server.begin(); 219 | } 220 | 221 | void btn1read () { 222 | 223 | if (millis() < lastButton1Push + buttonThreshold) return; // check button only when the threshold after last push is reached 224 | lastButton1Push = millis(); 225 | button1State = digitalRead(button1Pin); 226 | if (button1State == lastButton1State) return; 227 | if (button1State == HIGH) { 228 | for (uint8_t device = 0; device < devicesCount; device++) { 229 | device_state[device] = !device_state[device]; 230 | if (device_state[0] == true) { 231 | digitalWrite(devicesPins[0], HIGH); 232 | device_state[0] == true; 233 | if (EEPROM.read(1) == 0 && EEPROM.read(0) != 1) { 234 | EEPROM.write(0, 1); 235 | EEPROM.commit(); 236 | } 237 | } else { 238 | digitalWrite(devicesPins[0], LOW); 239 | device_state[0] == false; 240 | 241 | if (EEPROM.read(1) == 0 && EEPROM.read(0) != 0) { 242 | EEPROM.write(0, 0); 243 | EEPROM.commit(); 244 | } 245 | } 246 | } 247 | } 248 | lastButton1State = button1State; 249 | String power_status; 250 | power_status = device_state[0] ? "true" : "false"; 251 | server.send(200, "text/plain", "{\"on\": " + power_status + "}"); 252 | } 253 | 254 | void btn2read () { 255 | 256 | if (millis() < lastButton2Push + buttonThreshold) return; // check button only when the threshold after last push is reached 257 | lastButton2Push = millis(); 258 | button2State = digitalRead(button2Pin); 259 | if (button2State == lastButton2State) return; 260 | if (button2State == HIGH) { 261 | for (uint8_t device = 0; device < devicesCount; device++) { 262 | device_state[device] = !device_state[device]; 263 | if (device_state[1] == true) { 264 | digitalWrite(devicesPins[1], HIGH); 265 | device_state[1] == true; 266 | if (EEPROM.read(1) == 0 && EEPROM.read(0) != 1) { 267 | EEPROM.write(0, 1); 268 | EEPROM.commit(); 269 | } 270 | } else { 271 | digitalWrite(devicesPins[1], LOW); 272 | device_state[1] == false; 273 | 274 | if (EEPROM.read(1) == 0 && EEPROM.read(0) != 0) { 275 | EEPROM.write(0, 0); 276 | EEPROM.commit(); 277 | } 278 | } 279 | } 280 | } 281 | lastButton2State = button2State; 282 | } 283 | 284 | void btn3read () { 285 | 286 | if (millis() < lastButton3Push + buttonThreshold) return; // check button only when the threshold after last push is reached 287 | lastButton3Push = millis(); 288 | button3State = digitalRead(button3Pin); 289 | if (button3State == lastButton3State) return; 290 | if (button3State == HIGH) { 291 | for (uint8_t device = 0; device < devicesCount; device++) { 292 | device_state[device] = !device_state[device]; 293 | if (device_state[2] == true) { 294 | digitalWrite(devicesPins[2], HIGH); 295 | device_state[2] == true; 296 | if (EEPROM.read(1) == 0 && EEPROM.read(0) != 1) { 297 | EEPROM.write(0, 1); 298 | EEPROM.commit(); 299 | } 300 | } else { 301 | digitalWrite(devicesPins[2], LOW); 302 | device_state[2] == false; 303 | 304 | if (EEPROM.read(1) == 0 && EEPROM.read(0) != 0) { 305 | EEPROM.write(0, 0); 306 | EEPROM.commit(); 307 | } 308 | } 309 | } 310 | } 311 | lastButton3State = button3State; 312 | } 313 | 314 | void loop() { 315 | server.handleClient(); 316 | 317 | if (devicesCount == 1) { 318 | btn1read(); 319 | } 320 | 321 | if (devicesCount == 2) { 322 | btn1read(); 323 | btn2read(); 324 | } 325 | 326 | if (devicesCount == 3) { 327 | btn1read(); 328 | btn2read(); 329 | btn3read(); 330 | } 331 | } 332 | -------------------------------------------------------------------------------- /ESP8266/Sonoff_TX_T3/SonoffTXT3US2C-May292020.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | ////////////////////////////// USER SETTINGS ////////////////////////////// 11 | 12 | #define devicesCount 2 // How many Light attach 13 | #define light_name "SonoffTX2C" // default light name (ArduinoOTA name) 14 | #define LIGHT_VERSION 2.1 15 | 16 | //uint8_t devicesPins[devicesCount] = {12}; // the pin that the light is attached to (FOR SonoffTX 1 gang) 17 | uint8_t devicesPins[devicesCount] = {12,5}; // the pin that the light is attached to (FOR SonoffTX 2 gang) 18 | //uint8_t devicesPins[devicesCount] = {12,5,4}; // the pin that the light is attached to (FOR SonoffTX 3 gang) 19 | 20 | uint8_t ledPin = 13; // the pin that the indicator light is attached to 21 | uint8_t button1Pin = 0; // the pin that the pushbutton1 is attached to 22 | uint8_t button2Pin = 9; // the pin that the pushbutton2 is attached to 23 | uint8_t button3Pin = 10; // the pin that the pushbutton3 is attached to 24 | 25 | //////////////////////////////////////////////////////////////////////// 26 | 27 | uint8_t button1State = digitalRead(button1Pin); 28 | uint8_t button2State = digitalRead(button2Pin); 29 | uint8_t button3State = digitalRead(button3Pin); 30 | uint8_t lastButton1State = button1State; 31 | uint8_t lastButton2State = button2State; 32 | uint8_t lastButton3State = button3State; 33 | unsigned long lastButton1Push = 0; 34 | unsigned long lastButton2Push = 0; 35 | unsigned long lastButton3Push = 0; 36 | uint8_t buttonThreshold = 10; 37 | bool device_state[devicesCount]; 38 | byte mac[6]; 39 | ESP8266WebServer server(80); 40 | ESP8266HTTPUpdateServer httpUpdateServer; 41 | 42 | void handleNotFound() { 43 | String message = "File Not Found\n\n"; 44 | message += "URI: "; 45 | message += server.uri(); 46 | message += "\nMethod: "; 47 | message += (server.method() == HTTP_GET) ? "GET" : "POST"; 48 | message += "\nArguments: "; 49 | message += server.args(); 50 | message += "\n"; 51 | for (uint8_t i = 0; i < server.args(); i++) { 52 | message += " " + server.argName(i) + ": " + server.arg(i) + "\n"; 53 | } 54 | server.send(404, "text/plain", message); 55 | } 56 | 57 | void setup() { 58 | 59 | for (uint8_t ch = 0; ch < devicesCount; ch++) { 60 | pinMode(devicesPins[ch], OUTPUT); 61 | } 62 | 63 | digitalWrite(devicesPins[0], HIGH); 64 | digitalWrite(devicesPins[1], HIGH); 65 | digitalWrite(devicesPins[2], HIGH); 66 | EEPROM.begin(512); 67 | pinMode(ledPin, OUTPUT); 68 | pinMode(button1Pin, INPUT); 69 | pinMode(button2Pin, INPUT); 70 | pinMode(button3Pin, INPUT); 71 | digitalWrite(ledPin, HIGH); 72 | WiFi.mode(WIFI_STA); 73 | WiFiManager wifiManager; 74 | wifiManager.setConfigPortalTimeout(120); 75 | wifiManager.autoConnect(light_name); 76 | 77 | WiFi.macAddress(mac); 78 | 79 | if (EEPROM.read(1) == 1 || (EEPROM.read(1) == 0 && EEPROM.read(0) == 1)) { 80 | for (uint8_t ch = 0; ch < devicesCount; ch++) { 81 | digitalWrite(devicesPins[ch], OUTPUT); 82 | } 83 | } 84 | 85 | delay(10000); 86 | WiFi.macAddress(mac); 87 | 88 | 89 | server.on("/state", HTTP_PUT, []() { // HTTP PUT request used to set a new light state 90 | DynamicJsonDocument root(1024); 91 | DeserializationError error = deserializeJson(root, server.arg("plain")); 92 | 93 | if (error) { 94 | server.send(404, "text/plain", "FAIL. " + server.arg("plain")); 95 | } else { 96 | for (JsonPair state : root.as()) { 97 | const char* key = state.key().c_str(); 98 | int device = atoi(key) - 1; 99 | JsonObject values = state.value(); 100 | 101 | if (values.containsKey("on")) { 102 | if (values["on"]) { 103 | device_state[device] = true; 104 | digitalWrite(devicesPins[device], HIGH); 105 | if (EEPROM.read(1) == 0 && EEPROM.read(0) == 0) { 106 | EEPROM.write(0, 1); 107 | } 108 | } else { 109 | device_state[device] = false; 110 | digitalWrite(devicesPins[device], LOW); 111 | if (EEPROM.read(1) == 0 && EEPROM.read(0) == 1) { 112 | EEPROM.write(0, 0); 113 | } 114 | } 115 | } 116 | } 117 | String output; 118 | serializeJson(root, output); 119 | server.send(200, "text/plain", output); 120 | } 121 | }); 122 | 123 | server.on("/state", HTTP_GET, []() { // HTTP GET request used to fetch current light state 124 | uint8_t light = server.arg("light").toInt() - 1; 125 | DynamicJsonDocument root(1024); 126 | root["on"] = device_state[light]; 127 | String output; 128 | serializeJson(root, output); 129 | server.send(200, "text/plain", output); 130 | }); 131 | 132 | 133 | server.on("/detect", []() { // HTTP GET request used to discover the light type 134 | char macString[32] = {0}; 135 | sprintf(macString, "%02X:%02X:%02X:%02X:%02X:%02X", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); 136 | DynamicJsonDocument root(1024); 137 | root["name"] = light_name; 138 | root["lights"] = devicesCount; 139 | root["protocol"] = "native_multi"; 140 | root["modelid"] = "LOM001"; 141 | root["type"] = "plug_device"; 142 | root["mac"] = String(macString); 143 | root["version"] = LIGHT_VERSION; 144 | String output; 145 | serializeJson(root, output); 146 | server.send(200, "text/plain", output); 147 | }); 148 | 149 | server.on("/", []() { 150 | float transitiontime = 100; 151 | if (server.hasArg("startup")) { 152 | if ( EEPROM.read(1) != server.arg("startup").toInt()) { 153 | EEPROM.write(1, server.arg("startup").toInt()); 154 | EEPROM.commit(); 155 | } 156 | } 157 | for (uint8_t device = 0; device < devicesCount; device++) { 158 | if (server.hasArg("on")) { 159 | if (server.arg("on") == "true") { 160 | device_state[device] = true; 161 | digitalWrite(devicesPins[device], HIGH); 162 | if (EEPROM.read(1) == 0 && EEPROM.read(0) != 1) { 163 | EEPROM.write(0, 1); 164 | EEPROM.commit(); 165 | } 166 | } else { 167 | device_state[device] = false; 168 | digitalWrite(devicesPins[device], LOW); 169 | if (EEPROM.read(1) == 0 && EEPROM.read(0) != 0) { 170 | EEPROM.write(0, 0); 171 | EEPROM.commit(); 172 | } 173 | } 174 | } 175 | } 176 | if (server.hasArg("reset")) { 177 | ESP.reset(); 178 | } 179 | 180 | String http_content = ""; 181 | http_content += ""; 182 | http_content += ""; 183 | http_content += ""; 184 | http_content += ""; 185 | http_content += "Light Setup"; 186 | http_content += ""; 187 | http_content += ""; 188 | http_content += ""; 189 | http_content += "
"; 190 | http_content += "

Light Setup

"; 191 | http_content += "
"; 192 | http_content += "
"; 193 | http_content += ""; 194 | http_content += "ON"; 195 | http_content += "OFF"; 196 | http_content += "
"; 197 | http_content += "
"; 198 | http_content += ""; 199 | http_content += ""; 204 | http_content += "
"; 205 | http_content += "
"; 206 | http_content += "alert or reset"; 207 | http_content += ""; 209 | http_content += ""; 210 | http_content += "
"; 211 | http_content += "
"; 212 | http_content += ""; 213 | http_content += ""; 214 | http_content += ""; 215 | server.send(200, "text/html", http_content); 216 | }); 217 | server.onNotFound(handleNotFound); 218 | server.begin(); 219 | } 220 | 221 | void btn1read () { 222 | 223 | if (millis() < lastButton1Push + buttonThreshold) return; // check button only when the threshold after last push is reached 224 | lastButton1Push = millis(); 225 | button1State = digitalRead(button1Pin); 226 | if (button1State == lastButton1State) return; 227 | if (button1State == HIGH) { 228 | for (uint8_t device = 0; device < devicesCount; device++) { 229 | device_state[device] = !device_state[device]; 230 | if (device_state[0] == true) { 231 | digitalWrite(devicesPins[0], HIGH); 232 | device_state[0] == true; 233 | if (EEPROM.read(1) == 0 && EEPROM.read(0) != 1) { 234 | EEPROM.write(0, 1); 235 | EEPROM.commit(); 236 | } 237 | } else { 238 | digitalWrite(devicesPins[0], LOW); 239 | device_state[0] == false; 240 | 241 | if (EEPROM.read(1) == 0 && EEPROM.read(0) != 0) { 242 | EEPROM.write(0, 0); 243 | EEPROM.commit(); 244 | } 245 | } 246 | } 247 | } 248 | lastButton1State = button1State; 249 | String power_status; 250 | power_status = device_state[0] ? "true" : "false"; 251 | server.send(200, "text/plain", "{\"on\": " + power_status + "}"); 252 | } 253 | 254 | void btn2read () { 255 | 256 | if (millis() < lastButton2Push + buttonThreshold) return; // check button only when the threshold after last push is reached 257 | lastButton2Push = millis(); 258 | button2State = digitalRead(button2Pin); 259 | if (button2State == lastButton2State) return; 260 | if (button2State == HIGH) { 261 | for (uint8_t device = 0; device < devicesCount; device++) { 262 | device_state[device] = !device_state[device]; 263 | if (device_state[1] == true) { 264 | digitalWrite(devicesPins[1], HIGH); 265 | device_state[1] == true; 266 | if (EEPROM.read(1) == 0 && EEPROM.read(0) != 1) { 267 | EEPROM.write(0, 1); 268 | EEPROM.commit(); 269 | } 270 | } else { 271 | digitalWrite(devicesPins[1], LOW); 272 | device_state[1] == false; 273 | 274 | if (EEPROM.read(1) == 0 && EEPROM.read(0) != 0) { 275 | EEPROM.write(0, 0); 276 | EEPROM.commit(); 277 | } 278 | } 279 | } 280 | } 281 | lastButton2State = button2State; 282 | } 283 | 284 | void btn3read () { 285 | 286 | if (millis() < lastButton3Push + buttonThreshold) return; // check button only when the threshold after last push is reached 287 | lastButton3Push = millis(); 288 | button3State = digitalRead(button3Pin); 289 | if (button3State == lastButton3State) return; 290 | if (button3State == HIGH) { 291 | for (uint8_t device = 0; device < devicesCount; device++) { 292 | device_state[device] = !device_state[device]; 293 | if (device_state[2] == true) { 294 | digitalWrite(devicesPins[2], HIGH); 295 | device_state[2] == true; 296 | if (EEPROM.read(1) == 0 && EEPROM.read(0) != 1) { 297 | EEPROM.write(0, 1); 298 | EEPROM.commit(); 299 | } 300 | } else { 301 | digitalWrite(devicesPins[2], LOW); 302 | device_state[2] == false; 303 | 304 | if (EEPROM.read(1) == 0 && EEPROM.read(0) != 0) { 305 | EEPROM.write(0, 0); 306 | EEPROM.commit(); 307 | } 308 | } 309 | } 310 | } 311 | lastButton3State = button3State; 312 | } 313 | 314 | void loop() { 315 | server.handleClient(); 316 | 317 | if (devicesCount == 1) { 318 | btn1read(); 319 | } 320 | 321 | if (devicesCount == 2) { 322 | btn1read(); 323 | btn2read(); 324 | } 325 | 326 | if (devicesCount == 3) { 327 | btn1read(); 328 | btn2read(); 329 | btn3read(); 330 | } 331 | } 332 | -------------------------------------------------------------------------------- /ESP8266/Sonoff_TX_T3/SonoffTXT3US3C-May292020.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | ////////////////////////////// USER SETTINGS ////////////////////////////// 11 | 12 | #define devicesCount 3 // How many Light attach 13 | #define light_name "SonoffTX3C" // default light name (ArduinoOTA name) 14 | #define LIGHT_VERSION 2.1 15 | 16 | //uint8_t devicesPins[devicesCount] = {12}; // the pin that the light is attached to (FOR SonoffTX 1 gang) 17 | //uint8_t devicesPins[devicesCount] = {12,5}; // the pin that the light is attached to (FOR SonoffTX 2 gang) 18 | uint8_t devicesPins[devicesCount] = {12,5,4}; // the pin that the light is attached to (FOR SonoffTX 3 gang) 19 | 20 | uint8_t ledPin = 13; // the pin that the indicator light is attached to 21 | uint8_t button1Pin = 0; // the pin that the pushbutton1 is attached to 22 | uint8_t button2Pin = 9; // the pin that the pushbutton2 is attached to 23 | uint8_t button3Pin = 10; // the pin that the pushbutton3 is attached to 24 | 25 | //////////////////////////////////////////////////////////////////////// 26 | 27 | uint8_t button1State = digitalRead(button1Pin); 28 | uint8_t button2State = digitalRead(button2Pin); 29 | uint8_t button3State = digitalRead(button3Pin); 30 | uint8_t lastButton1State = button1State; 31 | uint8_t lastButton2State = button2State; 32 | uint8_t lastButton3State = button3State; 33 | unsigned long lastButton1Push = 0; 34 | unsigned long lastButton2Push = 0; 35 | unsigned long lastButton3Push = 0; 36 | uint8_t buttonThreshold = 10; 37 | bool device_state[devicesCount]; 38 | byte mac[6]; 39 | ESP8266WebServer server(80); 40 | ESP8266HTTPUpdateServer httpUpdateServer; 41 | 42 | void handleNotFound() { 43 | String message = "File Not Found\n\n"; 44 | message += "URI: "; 45 | message += server.uri(); 46 | message += "\nMethod: "; 47 | message += (server.method() == HTTP_GET) ? "GET" : "POST"; 48 | message += "\nArguments: "; 49 | message += server.args(); 50 | message += "\n"; 51 | for (uint8_t i = 0; i < server.args(); i++) { 52 | message += " " + server.argName(i) + ": " + server.arg(i) + "\n"; 53 | } 54 | server.send(404, "text/plain", message); 55 | } 56 | 57 | void setup() { 58 | 59 | for (uint8_t ch = 0; ch < devicesCount; ch++) { 60 | pinMode(devicesPins[ch], OUTPUT); 61 | } 62 | 63 | digitalWrite(devicesPins[0], HIGH); 64 | digitalWrite(devicesPins[1], HIGH); 65 | digitalWrite(devicesPins[2], HIGH); 66 | EEPROM.begin(512); 67 | pinMode(ledPin, OUTPUT); 68 | pinMode(button1Pin, INPUT); 69 | pinMode(button2Pin, INPUT); 70 | pinMode(button3Pin, INPUT); 71 | digitalWrite(ledPin, HIGH); 72 | WiFi.mode(WIFI_STA); 73 | WiFiManager wifiManager; 74 | wifiManager.setConfigPortalTimeout(120); 75 | wifiManager.autoConnect(light_name); 76 | 77 | WiFi.macAddress(mac); 78 | 79 | if (EEPROM.read(1) == 1 || (EEPROM.read(1) == 0 && EEPROM.read(0) == 1)) { 80 | for (uint8_t ch = 0; ch < devicesCount; ch++) { 81 | digitalWrite(devicesPins[ch], OUTPUT); 82 | } 83 | } 84 | 85 | delay(10000); 86 | WiFi.macAddress(mac); 87 | 88 | 89 | server.on("/state", HTTP_PUT, []() { // HTTP PUT request used to set a new light state 90 | DynamicJsonDocument root(1024); 91 | DeserializationError error = deserializeJson(root, server.arg("plain")); 92 | 93 | if (error) { 94 | server.send(404, "text/plain", "FAIL. " + server.arg("plain")); 95 | } else { 96 | for (JsonPair state : root.as()) { 97 | const char* key = state.key().c_str(); 98 | int device = atoi(key) - 1; 99 | JsonObject values = state.value(); 100 | 101 | if (values.containsKey("on")) { 102 | if (values["on"]) { 103 | device_state[device] = true; 104 | digitalWrite(devicesPins[device], HIGH); 105 | if (EEPROM.read(1) == 0 && EEPROM.read(0) == 0) { 106 | EEPROM.write(0, 1); 107 | } 108 | } else { 109 | device_state[device] = false; 110 | digitalWrite(devicesPins[device], LOW); 111 | if (EEPROM.read(1) == 0 && EEPROM.read(0) == 1) { 112 | EEPROM.write(0, 0); 113 | } 114 | } 115 | } 116 | } 117 | String output; 118 | serializeJson(root, output); 119 | server.send(200, "text/plain", output); 120 | } 121 | }); 122 | 123 | server.on("/state", HTTP_GET, []() { // HTTP GET request used to fetch current light state 124 | uint8_t light = server.arg("light").toInt() - 1; 125 | DynamicJsonDocument root(1024); 126 | root["on"] = device_state[light]; 127 | String output; 128 | serializeJson(root, output); 129 | server.send(200, "text/plain", output); 130 | }); 131 | 132 | 133 | server.on("/detect", []() { // HTTP GET request used to discover the light type 134 | char macString[32] = {0}; 135 | sprintf(macString, "%02X:%02X:%02X:%02X:%02X:%02X", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); 136 | DynamicJsonDocument root(1024); 137 | root["name"] = light_name; 138 | root["lights"] = devicesCount; 139 | root["protocol"] = "native_multi"; 140 | root["modelid"] = "LOM001"; 141 | root["type"] = "plug_device"; 142 | root["mac"] = String(macString); 143 | root["version"] = LIGHT_VERSION; 144 | String output; 145 | serializeJson(root, output); 146 | server.send(200, "text/plain", output); 147 | }); 148 | 149 | server.on("/", []() { 150 | float transitiontime = 100; 151 | if (server.hasArg("startup")) { 152 | if ( EEPROM.read(1) != server.arg("startup").toInt()) { 153 | EEPROM.write(1, server.arg("startup").toInt()); 154 | EEPROM.commit(); 155 | } 156 | } 157 | for (uint8_t device = 0; device < devicesCount; device++) { 158 | if (server.hasArg("on")) { 159 | if (server.arg("on") == "true") { 160 | device_state[device] = true; 161 | digitalWrite(devicesPins[device], HIGH); 162 | if (EEPROM.read(1) == 0 && EEPROM.read(0) != 1) { 163 | EEPROM.write(0, 1); 164 | EEPROM.commit(); 165 | } 166 | } else { 167 | device_state[device] = false; 168 | digitalWrite(devicesPins[device], LOW); 169 | if (EEPROM.read(1) == 0 && EEPROM.read(0) != 0) { 170 | EEPROM.write(0, 0); 171 | EEPROM.commit(); 172 | } 173 | } 174 | } 175 | } 176 | if (server.hasArg("reset")) { 177 | ESP.reset(); 178 | } 179 | 180 | String http_content = ""; 181 | http_content += ""; 182 | http_content += ""; 183 | http_content += ""; 184 | http_content += ""; 185 | http_content += "Light Setup"; 186 | http_content += ""; 187 | http_content += ""; 188 | http_content += ""; 189 | http_content += "
"; 190 | http_content += "

Light Setup

"; 191 | http_content += "
"; 192 | http_content += "
"; 193 | http_content += ""; 194 | http_content += "ON"; 195 | http_content += "OFF"; 196 | http_content += "
"; 197 | http_content += "
"; 198 | http_content += ""; 199 | http_content += ""; 204 | http_content += "
"; 205 | http_content += "
"; 206 | http_content += "alert or reset"; 207 | http_content += ""; 209 | http_content += ""; 210 | http_content += "
"; 211 | http_content += "
"; 212 | http_content += ""; 213 | http_content += ""; 214 | http_content += ""; 215 | server.send(200, "text/html", http_content); 216 | }); 217 | server.onNotFound(handleNotFound); 218 | server.begin(); 219 | } 220 | 221 | void btn1read () { 222 | 223 | if (millis() < lastButton1Push + buttonThreshold) return; // check button only when the threshold after last push is reached 224 | lastButton1Push = millis(); 225 | button1State = digitalRead(button1Pin); 226 | if (button1State == lastButton1State) return; 227 | if (button1State == HIGH) { 228 | for (uint8_t device = 0; device < devicesCount; device++) { 229 | device_state[device] = !device_state[device]; 230 | if (device_state[0] == true) { 231 | digitalWrite(devicesPins[0], HIGH); 232 | device_state[0] == true; 233 | if (EEPROM.read(1) == 0 && EEPROM.read(0) != 1) { 234 | EEPROM.write(0, 1); 235 | EEPROM.commit(); 236 | } 237 | } else { 238 | digitalWrite(devicesPins[0], LOW); 239 | device_state[0] == false; 240 | 241 | if (EEPROM.read(1) == 0 && EEPROM.read(0) != 0) { 242 | EEPROM.write(0, 0); 243 | EEPROM.commit(); 244 | } 245 | } 246 | } 247 | } 248 | lastButton1State = button1State; 249 | String power_status; 250 | power_status = device_state[0] ? "true" : "false"; 251 | server.send(200, "text/plain", "{\"on\": " + power_status + "}"); 252 | } 253 | 254 | void btn2read () { 255 | 256 | if (millis() < lastButton2Push + buttonThreshold) return; // check button only when the threshold after last push is reached 257 | lastButton2Push = millis(); 258 | button2State = digitalRead(button2Pin); 259 | if (button2State == lastButton2State) return; 260 | if (button2State == HIGH) { 261 | for (uint8_t device = 0; device < devicesCount; device++) { 262 | device_state[device] = !device_state[device]; 263 | if (device_state[1] == true) { 264 | digitalWrite(devicesPins[1], HIGH); 265 | device_state[1] == true; 266 | if (EEPROM.read(1) == 0 && EEPROM.read(0) != 1) { 267 | EEPROM.write(0, 1); 268 | EEPROM.commit(); 269 | } 270 | } else { 271 | digitalWrite(devicesPins[1], LOW); 272 | device_state[1] == false; 273 | 274 | if (EEPROM.read(1) == 0 && EEPROM.read(0) != 0) { 275 | EEPROM.write(0, 0); 276 | EEPROM.commit(); 277 | } 278 | } 279 | } 280 | } 281 | lastButton2State = button2State; 282 | } 283 | 284 | void btn3read () { 285 | 286 | if (millis() < lastButton3Push + buttonThreshold) return; // check button only when the threshold after last push is reached 287 | lastButton3Push = millis(); 288 | button3State = digitalRead(button3Pin); 289 | if (button3State == lastButton3State) return; 290 | if (button3State == HIGH) { 291 | for (uint8_t device = 0; device < devicesCount; device++) { 292 | device_state[device] = !device_state[device]; 293 | if (device_state[2] == true) { 294 | digitalWrite(devicesPins[2], HIGH); 295 | device_state[2] == true; 296 | if (EEPROM.read(1) == 0 && EEPROM.read(0) != 1) { 297 | EEPROM.write(0, 1); 298 | EEPROM.commit(); 299 | } 300 | } else { 301 | digitalWrite(devicesPins[2], LOW); 302 | device_state[2] == false; 303 | 304 | if (EEPROM.read(1) == 0 && EEPROM.read(0) != 0) { 305 | EEPROM.write(0, 0); 306 | EEPROM.commit(); 307 | } 308 | } 309 | } 310 | } 311 | lastButton3State = button3State; 312 | } 313 | 314 | void loop() { 315 | server.handleClient(); 316 | 317 | if (devicesCount == 1) { 318 | btn1read(); 319 | } 320 | 321 | if (devicesCount == 2) { 322 | btn1read(); 323 | btn2read(); 324 | } 325 | 326 | if (devicesCount == 3) { 327 | btn1read(); 328 | btn2read(); 329 | btn3read(); 330 | } 331 | } 332 | -------------------------------------------------------------------------------- /ESP8266/esp8266-lighting-controllers/README.md: -------------------------------------------------------------------------------- 1 | # ESP8266 Lighting controllers 2 | 3 | Full source: https://github.com/panovvv/esp8266-lighting-controllers 4 | 5 | * ESP-12 RGBCCT (5 channels) controller 6 | 7 | * Prototype 8 | ![prototype_photo.jpg](https://github.com/panovvv/esp8266-lighting-controllers/raw/master/esp12_rgbcct_led_strip_controller/breadboard/prototype_photo.jpg) 9 | * PCB render 10 | ![esp12_rgbcct.png](https://github.com/panovvv/esp8266-lighting-controllers/raw/master/esp12_rgbcct_led_strip_controller/pcb/renders/09_raytrace_left.png) 11 | * PCB 12 | 13 | ![0_pcb.jpg](https://github.com/panovvv/esp8266-lighting-controllers/raw/master/esp12_rgbcct_led_strip_controller/pcb/photo/0_pcb.jpg) 14 | * Regular enclosure 15 | 16 | ![1_regular_enclosure_open.jpg](https://github.com/panovvv/esp8266-lighting-controllers/raw/master/esp12_rgbcct_led_strip_controller/pcb/photo/1_regular_enclosure_open.jpg) 17 | 18 | ![2_regular_enclosure_closed.jpg](https://github.com/panovvv/esp8266-lighting-controllers/raw/master/esp12_rgbcct_led_strip_controller/pcb/photo/2_regular_enclosure_closed.jpg) 19 | 20 | * Waterproof enclosure 21 | 22 | ![3_waterproof_enclosure_open.jpg](https://github.com/panovvv/esp8266-lighting-controllers/raw/master/esp12_rgbcct_led_strip_controller/pcb/photo/3_waterproof_enclosure_open.jpg) 23 | 24 | ![4_waterproof_enclosure_closed.jpg](https://github.com/panovvv/esp8266-lighting-controllers/raw/master/esp12_rgbcct_led_strip_controller/pcb/photo/4_waterproof_enclosure_closed.jpg) 25 | 26 | 27 | * ESP-01 Neopixel (WS2812) controller 28 | 29 | * Schematic 30 | ![schematic.jpg](https://github.com/panovvv/esp8266-lighting-controllers/raw/master/esp01_neopixel_controller/esp01_neopixel_controller-1.png) 31 | * Prototype 32 | ![prototype.jpg](https://github.com/panovvv/esp8266-lighting-controllers/raw/master/esp01_neopixel_controller/prototype.jpg) 33 | 34 | -------------------------------------------------------------------------------- /ESP8266/fastLED_SM16726_RGBW_Bulb/README.md: -------------------------------------------------------------------------------- 1 | # FastLED RGBW Bulb 2 | 3 | This sketch utilises the [FastLED](https://github.com/FastLED/FastLED) library in order to be able to use bulbs that don't use simple RGB PWM dimming, rather use an SPI controlled interface instead. It has only been tested on one type of such [bulb](https://www.ebay.co.uk/itm/E27-8W-RGBW-Wireless-Smart-Bulb-WiFi-APP-Remote-Control-LED-Light-for-Alexa-UK-/263504802242?item=263504802242&ViewItem=&nma=true&si=x%252BdO9TdL81nrD8N1V9CZxFXF0rY%253D&orig_cvip=true&rt=nc&_trksid=p2047675.l2557), but it should work with many similar bulbs which have CW LEDs and RGB LEDs. 4 | 5 | Slight alterations have been made in comparison to other RGBW light sketches in this project these being: 6 | * FastLED implementation for RGB LEDs 7 | * PWM implementation for CW LEDs 8 | * Ability to use [FastLED Color Correction](https://github.com/FastLED/FastLED/wiki/FastLED-Color-Correction) 9 | * Experimental use of CW leds in XY conversion by getting a basic Luminance value and using that. 10 | * Use of CCT bulb algorithm for ct conversion, where cold white mainly consists of the CW LEDs and the warmer whites mainly consist of RGB leds. 11 | * Slightly different implementation of the hue conversion to also include the cold white LEDs 12 | 13 | ## Use 14 | 15 | Depending on your bulb or strip, set these variables to their appropriate values for FastLED setup: 16 | 17 | * DATA_PIN - Which pin is data for SPI being sent out 18 | * CLOCK_PIN - Pin for SPI clock 19 | * COLOR_ORDER - Order of which colors are interpreted, usually RGB 20 | * LED_TYPE - What type of LEDs are you using, list [here](https://github.com/FastLED/FastLED/wiki/Chipset-reference) 21 | * CORRECTION - Color correction setting for LEDs, list of options [here](http://fastled.io/docs/3.1/group___color_enums.html) 22 | 23 | ## Problems 24 | 25 | * There is flickering from the white LEDs when changing values in the XY color picker in the hue app. To stop this behaviour set `W_ON_XY` to false. 26 | * There is also a bit of an issue around the blue color area when using the white color leds on the color picker. 27 | * Don't think the infoLight is working. 28 | 29 | ## To Do 30 | 31 | * Think about implementing FastLEDs native dimming functions. 32 | Try to solve above problems. 33 | -------------------------------------------------------------------------------- /ESPHome/AsyncUDP/diyhueasyncudp-rgbww.h: -------------------------------------------------------------------------------- 1 | #include "esphome.h" 2 | #include 3 | class diyhueudp : public Component { 4 | public: 5 | int lastUDPmilsec; 6 | int entertainmentTimeout = 1500; 7 | float maxColor = 255; 8 | AsyncUDP Udp; 9 | void setup() override { 10 | if(Udp.listen(2100)) { 11 | ESP_LOGD("DiyHueUDP", "Listerner Enabled"); 12 | Udp.onPacket([&](AsyncUDPPacket &packet) {entertainment(packet);}); 13 | } 14 | } 15 | void loop() override { 16 | if (entertainment_switch->state) { 17 | if ((millis() - lastUDPmilsec) >= entertainmentTimeout) { 18 | entertainment_switch->turn_off(); 19 | } 20 | } 21 | //entertainment(); 22 | } 23 | void entertainment(AsyncUDPPacket &packet) 24 | { 25 | ESP_LOGD("DiyHueUDP", "Entertainment packet arrived"); 26 | if (!entertainment_switch->state) { 27 | entertainment_switch->turn_on(); 28 | } 29 | lastUDPmilsec = millis(); //reset timeout value 30 | uint8_t *packetBuffer = packet.data(); 31 | uint32_t packetSize = packet.length(); 32 | auto call = rgbww_led->turn_on(); 33 | if (((packetBuffer[1])+(packetBuffer[2])+(packetBuffer[3])) == 0) { 34 | call.set_rgb(0,0,0); 35 | call.set_brightness(0); 36 | call.set_transition_length(0); 37 | call.perform(); 38 | } else { 39 | call.set_rgb(packetBuffer[1]/maxColor, packetBuffer[2]/maxColor, packetBuffer[3]/maxColor); 40 | call.set_transition_length(0); 41 | call.set_brightness(packetBuffer[4]/maxColor); 42 | call.perform(); 43 | } 44 | } 45 | }; -------------------------------------------------------------------------------- /ESPHome/AsyncUDP/diyhueasyncudp.h: -------------------------------------------------------------------------------- 1 | #include "esphome.h" 2 | #include 3 | class diyhueudp : public Component { 4 | public: 5 | int lastUDPmilsec; 6 | int entertainmentTimeout = 1500; 7 | float maxColor = 255; 8 | AsyncUDP Udp; 9 | void setup() override { 10 | if(Udp.listen(2100)) { 11 | ESP_LOGD("DiyHueUDP", "Listerner Enabled"); 12 | Udp.onPacket([&](AsyncUDPPacket &packet) {entertainment(packet);}); 13 | } 14 | } 15 | void loop() override { 16 | if (entertainment_switch->state) { 17 | if ((millis() - lastUDPmilsec) >= entertainmentTimeout) { 18 | entertainment_switch->turn_off(); 19 | } 20 | } 21 | //entertainment(); 22 | } 23 | void entertainment(AsyncUDPPacket &packet) 24 | { 25 | ESP_LOGD("DiyHueUDP", "Entertainment packet arrived"); 26 | auto call = white_led->turn_off(); //turn off white_led when entertainment starts 27 | call.set_transition_length(0); 28 | call.perform(); 29 | if (!entertainment_switch->state) { 30 | entertainment_switch->turn_on(); 31 | } 32 | lastUDPmilsec = millis(); //reset timeout value 33 | uint8_t *packetBuffer = packet.data(); 34 | uint32_t packetSize = packet.length(); 35 | call = color_led->turn_on(); 36 | if (((packetBuffer[1])+(packetBuffer[2])+(packetBuffer[3])) == 0) { 37 | call.set_rgb(0,0,0); 38 | call.set_brightness(0); 39 | call.set_transition_length(0); 40 | call.perform(); 41 | } else { 42 | call.set_rgb(packetBuffer[1]/maxColor, packetBuffer[2]/maxColor, packetBuffer[3]/maxColor); 43 | call.set_transition_length(0); 44 | call.set_brightness(packetBuffer[4]/maxColor); 45 | call.perform(); 46 | } 47 | } 48 | }; -------------------------------------------------------------------------------- /ESPHome/WiFiUDP/diyhueudp.h: -------------------------------------------------------------------------------- 1 | #include "esphome.h" 2 | #include 3 | 4 | class diyhueudp : public Component { 5 | public: 6 | WiFiUDP Udp; 7 | int lastUDPmilsec; 8 | int entertainmentTimeout = 1500; 9 | void setup() override { 10 | Udp.begin(2100); 11 | } 12 | void loop() override { 13 | if (entertainment_switch->state) { 14 | if ((millis() - lastUDPmilsec) >= entertainmentTimeout) { 15 | entertainment_switch->turn_off(); 16 | } 17 | } 18 | entertainment(); 19 | } 20 | void entertainment() { 21 | int packetSize = Udp.parsePacket(); //begin parsing udp packet 22 | if (packetSize) { 23 | //turn off white_led when entertainment starts 24 | auto call = white_led->turn_off(); 25 | call.set_transition_length(0); 26 | call.perform(); 27 | if (!entertainment_switch->state) { 28 | entertainment_switch->turn_on(); 29 | } 30 | lastUDPmilsec = millis(); //reset timeout value 31 | byte packetBuffer[8]; 32 | Udp.read(packetBuffer, packetSize); 33 | call = color_led->turn_on(); 34 | if (((packetBuffer[1])+(packetBuffer[2])+(packetBuffer[3])) == 0) { 35 | call.set_rgb(0,0,0); 36 | call.set_brightness(0); 37 | call.set_transition_length(0); 38 | call.perform(); 39 | } else { 40 | call.set_rgb((float)((packetBuffer[1])/(float)255), (float)((packetBuffer[2])/(float)255), (float)((packetBuffer[3])/(float)255)); 41 | call.set_transition_length(0); 42 | call.set_brightness((float)((packetBuffer[4])/(float)255)); 43 | call.perform(); 44 | } 45 | } 46 | } 47 | }; -------------------------------------------------------------------------------- /ESPHome/alertswitch.h: -------------------------------------------------------------------------------- 1 | #include "esphome.h" 2 | 3 | class alertSwitch : public Component, public Switch { 4 | public: 5 | unsigned long lastTime = 0; 6 | int phase = 0; 7 | float stored_brightness = 0; 8 | bool color_led_on = false; 9 | bool white_led_on = false; 10 | 11 | void setup() override {} 12 | void loop() override { 13 | if (phase != 0 && (((millis() - lastTime)/500) >= phase)) { 14 | if (phase == 3 && !(color_led_on || white_led_on)) { 15 | auto call_off = white_led->turn_off(); 16 | call_off.perform(); 17 | finalize(); 18 | } else { 19 | light::LightCall call = (color_led_on) ? color_led->make_call() : call = white_led->make_call(); 20 | if (phase == 1) { 21 | call.set_brightness(0.01); 22 | } else if (phase == 2) { 23 | call.set_brightness(1.0); 24 | } else {// phase is 3 25 | call.set_brightness(stored_brightness); 26 | } 27 | call.set_transition_length(500); 28 | call.perform(); 29 | if (phase == 3) { 30 | finalize(); 31 | } else { 32 | phase++; 33 | } 34 | } 35 | } 36 | } 37 | void finalize() { 38 | phase = 0; 39 | color_led_on = false; 40 | white_led_on = false; 41 | stored_brightness = 0.0f; 42 | this->publish_state(false); 43 | } 44 | void write_state(bool state) override { 45 | if (state) { 46 | if (color_led->remote_values.is_on()) { 47 | stored_brightness = color_led->remote_values.get_brightness(); 48 | color_led_on = true; 49 | } else { 50 | white_led_on = white_led->remote_values.is_on(); 51 | stored_brightness = white_led->remote_values.get_brightness(); 52 | } 53 | light::LightCall call = (color_led_on) ? color_led->turn_on() : call = white_led->turn_on(); 54 | call.set_brightness(1.0); 55 | call.set_transition_length(500); 56 | call.perform(); 57 | phase = 1; 58 | lastTime = millis(); 59 | } 60 | } 61 | }; 62 | -------------------------------------------------------------------------------- /ESPHome/rgb-cct-fastled.yaml: -------------------------------------------------------------------------------- 1 | esphome: 2 | name: rgb-cct 3 | platform: ESP8266 4 | board: esp01_1m 5 | includes: 6 | - diyhueasyncudp.h 7 | - alertswitch.h 8 | libraries: 9 | - git+https://github.com/me-no-dev/ESPAsyncUDP.git#697c75a0255e5dccf91b4ef8b5cc28c569b3bac9 10 | 11 | custom_component: 12 | - lambda: |- 13 | auto diyhue = new diyhueudp(); 14 | return {diyhue}; 15 | 16 | # on_boot: 17 | # then: 18 | # - light.turn_on: 19 | # id: white_led 20 | # brightness: 100% 21 | # color_temperature: 4000 K 22 | 23 | ota: 24 | password: "SUPER-SECRET-PASSWORD" 25 | 26 | wifi: 27 | ssid: "SUPER-SECRET-SSID" 28 | password: "SUPER-SECRET-PASSWORD" 29 | 30 | manual_ip: 31 | static_ip: STATIC_IP 32 | gateway: GATEWAY 33 | subnet: SUBNET 34 | 35 | ap: 36 | ssid: "LIGHT-NAME" 37 | 38 | # Enable logging 39 | logger: 40 | baud_rate: 0 41 | 42 | # Enable Home Assistant API 43 | api: 44 | password: "SUPER-SECRET-PASSWORD" 45 | reboot_timeout: 0s 46 | 47 | output: 48 | - platform: esp8266_pwm 49 | pin: GPIO5 50 | id: cold_white_gpio 51 | frequency: 1000 Hz 52 | inverted: False 53 | min_power: 0 54 | max_power: 0.7 55 | 56 | - platform: esp8266_pwm 57 | pin: GPIO12 58 | id: warm_white_gpio 59 | frequency: 1000 Hz 60 | inverted: False 61 | min_power: 0 62 | max_power: 0.7 63 | 64 | - platform: gpio 65 | pin: GPIO13 66 | id: fast_led_pwr 67 | inverted: True 68 | 69 | light: 70 | - platform: cwww 71 | id: white_led 72 | name: "white_led" 73 | cold_white: cold_white_gpio 74 | warm_white: warm_white_gpio 75 | cold_white_color_temperature: 6500 K 76 | warm_white_color_temperature: 2000 K 77 | gamma_correct: 0.8 78 | default_transition_length: 0.4s 79 | 80 | - platform: fastled_spi 81 | id: color_led 82 | chipset: SM16716 83 | data_pin: GPIO14 84 | clock_pin: GPIO4 85 | num_leds: 1 86 | rgb_order: BGR 87 | name: "color_led" 88 | default_transition_length: 0.4s 89 | gamma_correct: 2.6 90 | effects: 91 | - random: 92 | name: Random Effect With Custom Values 93 | transition_length: 5s 94 | update_interval: 3s 95 | 96 | text_sensor: 97 | - platform: template 98 | name: "light_id" 99 | id: light_id 100 | lambda: |- 101 | char response[100]; 102 | memset( response, 0, 100 ); 103 | strcat( response, "esphome_diyhue_light;"); 104 | strcat( response, WiFi.macAddress().c_str()); 105 | strcat( response, ";"); 106 | strcat( response, App.get_name().c_str()); 107 | strcat( response, ";CT_BOOST;RGB_BOOST" ); // ;CT_BOOST;RGB_BOOST values go here; Replace with 0 to disable 108 | return { response }; 109 | update_interval: 24h 110 | 111 | switch: 112 | - platform: custom 113 | lambda: |- 114 | auto alertswitch = new alertSwitch(); 115 | App.register_component(alertswitch); 116 | return {alertswitch}; 117 | switches: 118 | name: alert 119 | id: alert 120 | 121 | - platform: template 122 | name: entertainment_switch 123 | id: entertainment_switch 124 | optimistic: true 125 | 126 | web_server: 127 | port: 80 128 | -------------------------------------------------------------------------------- /HTML/diyhue.js: -------------------------------------------------------------------------------- 1 | var slider; 2 | var refreshInterval = 1500; 3 | var multipleLights = false; 4 | var lightscount = 0; 5 | var pixelcount = 0; 6 | let availablepixels = 0; 7 | var InitReload = false; 8 | 9 | function postData(t) { 10 | var e = new XMLHttpRequest; 11 | e.timeout = 2000; 12 | e.open("PUT", "/state", !0); 13 | e.setRequestHeader("Content-Type", "application/json"); 14 | console.log(JSON.stringify(t)), e.send(JSON.stringify(t)); 15 | } 16 | function postDataMultiple(t) { 17 | var e = {}; 18 | for (light = 1; light <= lightscount; light += 1) e[light] = t; 19 | var o = new XMLHttpRequest; 20 | o.open("PUT", "/state", !0), o.setRequestHeader("Content-Type", "application/json"), console.log(JSON.stringify(e)), o.send(JSON.stringify(e)) 21 | } 22 | 23 | function getPosition(t) { 24 | var e = 0, 25 | a = 0; 26 | if (t.offsetParent) { 27 | do { 28 | e += t.offsetLeft, a += t.offsetTop 29 | } while (t = t.offsetParent); 30 | return { 31 | x: e, 32 | y: a 33 | } 34 | } 35 | } 36 | 37 | function rgb_to_cie(t, e, a) { 38 | var n = .664511 * (t = t > .04045 ? Math.pow((t + .055) / 1.055, 2.4) : t / 12.92) + .154324 * (e = e > .04045 ? Math.pow((e + .055) / 1.055, 2.4) : e / 12.92) + .162028 * (a = a > .04045 ? Math.pow((a + .055) / 1.055, 2.4) : a / 12.92), 39 | o = .283881 * t + .668433 * e + .047685 * a, 40 | r = 88e-6 * t + .07231 * e + .986039 * a, 41 | i = (n / (n + o + r)).toFixed(4), 42 | s = (o / (n + o + r)).toFixed(4); 43 | return isNaN(i) && (i = 0), isNaN(s) && (s = 0), [parseFloat(i), parseFloat(s)] 44 | } 45 | 46 | function updateStatus() { 47 | $.ajax({ 48 | type: 'GET', 49 | url: "/state", 50 | dataType: "json", 51 | data: [ 52 | { name: "light", value: "1" }, 53 | ], 54 | success: function (data) { 55 | if (!data) { 56 | return; 57 | } 58 | $("#pow").prop("checked", data.on); 59 | slider.noUiSlider.set(data.bri / 2.54); 60 | if (InitReload) 61 | location.reload(); 62 | console.log('update state done'); 63 | }, 64 | error: function () { 65 | console.log('error getting state'); 66 | }, 67 | timeout: 1000 68 | }); 69 | } 70 | 71 | function updateConfig() { 72 | $.ajax({ 73 | url: '/config', 74 | type: 'GET', 75 | tryCount: 0, 76 | retryLimit: 5, 77 | dataType: 'json', 78 | contentType: 'application/json', 79 | success: function (json) { 80 | lightscount = json["lightscount"]; 81 | pixelcount = json["pixelcount"]; 82 | availablepixels = json["pixelcount"]; 83 | $.each(json, function (key, val) { 84 | if ($("#" + key).is(':checkbox')) { 85 | $("input[type=\"checkbox\"]#" + key).addClass('checked-' + val).prop("checked", !!val); 86 | } else { 87 | $("#" + key).val(val); 88 | } 89 | $('select').formSelect(); 90 | }); 91 | 92 | var newDividedLight = lightscount; 93 | var newDividedLights = false; 94 | for (var n = 0; n < lightscount; n++) { 95 | var dividedLightElement; 96 | if (!json["dividedLight_" + n]) { 97 | dividedLightElement = $('
'); 98 | newDividedLights = true; 99 | } 100 | else { 101 | newDividedLight -= 1; 102 | dividedLightElement = $('
'); 103 | } 104 | availablepixels -= parseInt(json["dividedLight_" + n]); 105 | $(".dividedLights").append(dividedLightElement); 106 | } 107 | 108 | if (newDividedLights) 109 | availablepixels = 'Please first adjust the pixels of the newly added lamps and confirm.' 110 | 111 | $(".availablepixels").html("" + availablepixels + ""); 112 | 113 | $(".brand-logo").text(json.name); 114 | toggleSections($('input[type="checkbox"]')); 115 | }, 116 | error: function () { 117 | return; 118 | }, 119 | timeout: 5000, 120 | }); 121 | console.log('update config done'); 122 | } 123 | 124 | function toggleSections(ele) { 125 | ele.each(function (index) { 126 | var collapsable = $(this).parents('.row').next('.switchable').find('input[type="text"],input[type="number"]'); 127 | if ($(this).is(":checked")) { 128 | collapsable.prop("disabled", !!0); 129 | } else { 130 | collapsable.prop('disabled', !!1); 131 | } 132 | }); 133 | } 134 | 135 | $(function () { 136 | 137 | var oldValue; 138 | $('body').on('focus', '.dividedLight', function (cb) { 139 | oldValue = parseInt(cb.currentTarget.value); 140 | }); 141 | 142 | $('body').on('change', '.dividedLight', function (cb) { 143 | var summe = parseInt(cb.currentTarget.value) - oldValue; 144 | if (summe > 0) { 145 | availablepixels = availablepixels - summe; 146 | } else { 147 | availablepixels = availablepixels + Math.abs(summe); 148 | } 149 | $(".availablepixels").html("" + availablepixels.toString() + ""); 150 | }); 151 | 152 | $('.tab').on('click', function (tab) { 153 | window.location.href = tab.currentTarget.title; 154 | $('html, body').scrollTop(); 155 | }); 156 | 157 | if ($("#lightscount").length) { 158 | multipleLights = true; 159 | }; 160 | 161 | $('.sidenav').sidenav(); 162 | 163 | $('.tabs').tabs(); 164 | 165 | $('input[type="checkbox"]').change(function () { 166 | toggleSections($(this)); 167 | }); 168 | 169 | $("button[type=submit").click(function (e) { 170 | $("button[type=submit").addClass("disabled"); 171 | e.preventDefault(); 172 | var form = $(this).parents('form'); 173 | $.ajax({ 174 | type: "POST", 175 | url: $(this).parents('form').action, 176 | data: form.serialize(), // serializes the form's elements. 177 | success: function (data) { 178 | M.toast({ html: 'Succesful! Rebooting.', classes: 'teal lighten-2' }); 179 | InitReload = true; 180 | }, 181 | error: function (data) { 182 | M.toast({ html: 'Error occured while sending data. Try again.', classes: 'red lighten-2' }); 183 | $("button[type=submit").removeClass("disabled"); 184 | }, 185 | timeout: 5000, 186 | }); 187 | }); 188 | 189 | $("#bri").hide().parent().append("
"); 190 | 191 | slider = $('#briSlider')[0]; 192 | noUiSlider.create(slider, { 193 | start: 20, 194 | connect: [true, false], 195 | step: 1, 196 | behaviour: 'drag-tap', 197 | orientation: 'horizontal', // 'horizontal' or 'vertical' 198 | range: { 199 | 'min': 0, 200 | 'max': 100 201 | }, 202 | format: wNumb({ 203 | decimals: 0, 204 | }) 205 | }); 206 | 207 | slider.noUiSlider.on('start', function () { 208 | refreshIntervalId = clearInterval(refreshIntervalId); 209 | }); 210 | 211 | slider.noUiSlider.on('end', function (values, handle) { 212 | if (refreshIntervalId) { 213 | clearInterval(refreshIntervalId); 214 | } 215 | refreshIntervalId = setInterval(updateStatus, refreshInterval); 216 | 217 | var value = values[handle]; 218 | if (multipleLights) { 219 | postDataMultiple({ 220 | bri: value * 2.54 221 | }); 222 | } else { 223 | postData({ 224 | bri: value * 2.54 225 | }); 226 | } 227 | }); 228 | 229 | slider.noUiSlider.on('set', function (values, handle) { 230 | 231 | }); 232 | 233 | context = (canvas = document.getElementById("hue")).getContext("2d"); 234 | 235 | x = canvas.width / 2, y = canvas.height / 2, radius = 150, counterClockwise = !1; 236 | for (angle = 0; angle <= 360; angle += 1) { 237 | var startAngle = (angle - 2) * Math.PI / 180, 238 | endAngle = angle * Math.PI / 180; 239 | context.beginPath(), context.moveTo(x, y), context.arc(x, y, radius, startAngle, endAngle, counterClockwise), context.closePath(); 240 | var gradient = context.createRadialGradient(x, y, 20, x, y, radius); 241 | angle < 270 ? (gradient.addColorStop(0, "hsl(" + (angle + 90) + ", 20%, 100%)"), gradient.addColorStop(1, "hsl(" + (angle + 90) + ", 100%, 50%)")) : (gradient.addColorStop(0, "hsl(" + (angle - 270) + ", 20%, 100%)"), gradient.addColorStop(1, "hsl(" + (angle - 270) + ", 100%, 50%)")), context.fillStyle = gradient, context.fill() 242 | } 243 | var canvas, ctx = (canvas = document.getElementById("ct")).getContext("2d"); 244 | 245 | (gradient = ctx.createLinearGradient(20, 0, 300, 0)).addColorStop(0, "#ACEDFF"), gradient.addColorStop(.5, "#ffffff"), gradient.addColorStop(1, "#FEFFDE"), ctx.fillStyle = gradient, ctx.fillRect(0, 0, 320, 60), $("#hue").click(function (t) { 246 | var e = getPosition(this), 247 | a = t.pageX - e.x, 248 | n = t.pageY - e.y, 249 | o = this.getContext("2d").getImageData(a, n, 1, 1).data; 250 | if (multipleLights) { 251 | postDataMultiple({ 252 | xy: rgb_to_cie(o[0], o[1], o[2]) 253 | }); 254 | } else { 255 | postData({ 256 | xy: rgb_to_cie(o[0], o[1], o[2]) 257 | }); 258 | } 259 | }), $("#ct").click(function (t) { 260 | var e = getPosition(this); 261 | if (multipleLights) { 262 | postDataMultiple({ 263 | ct: t.pageX - e.x + 153 264 | }); 265 | } else { 266 | postData({ 267 | ct: t.pageX - e.x + 153 268 | }); 269 | } 270 | }); 271 | 272 | $("#pow").change(function () { 273 | if (multipleLights) { 274 | postDataMultiple({ 275 | on: $(this).prop('checked') ? 1 : 0, 276 | }); 277 | } else { 278 | postData({ 279 | on: $(this).prop('checked') ? 1 : 0, 280 | }); 281 | } 282 | }); 283 | 284 | updateConfig(); 285 | updateStatus(); 286 | 287 | var refreshIntervalId = setInterval(updateStatus, refreshInterval); 288 | }); -------------------------------------------------------------------------------- /HTML/generic_rgb.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Hue Light 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 32 | 33 | 38 | 39 |
40 |
41 |
42 |
43 | 44 |
45 |
46 | 47 |
48 | 54 |
55 |
56 |
57 |
58 |
59 | 60 | 61 |
62 |
63 |
64 |
65 | 66 |
67 | 68 |
69 |
70 |
71 |
72 |
73 | 74 |
75 | 76 |
77 |
78 |
79 |
80 |
81 | 82 |
83 |
84 | 85 |
86 |
87 | 88 | 89 |
90 |
91 |
92 |
93 | 94 | 99 |
100 |
101 |
102 |
103 | 104 | 117 |
118 |
119 |
120 |
121 | 122 | 123 |
124 |
125 | 126 | 127 |
128 |
129 | 130 | 131 |
132 |
133 |
134 |
135 | 136 | 137 |
138 |
139 | 140 | 141 |
142 |
143 | 144 | 145 |
146 |
147 |
148 |
149 |
150 | 156 |
157 |
158 |
159 |
160 |
161 |
162 | 163 | 164 |
165 |
166 | 167 | 168 |
169 |
170 |
171 |
172 |
173 | 174 | 175 |
176 |
177 |
178 |
179 | 180 |
181 |
182 | 183 |
184 |
185 | 186 |
187 | 193 |
194 |
195 |
196 |
197 |
198 |
199 | 200 | 201 |
202 |
203 | 204 | 205 |
206 |
207 | 208 | 209 |
210 |
211 |
212 |
213 |
214 | 215 | 216 | 217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | -------------------------------------------------------------------------------- /HTML/generic_ws2812_strip.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | " + String(lightName) + " - DiyHue 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 33 | 34 | 39 | 40 |
41 |
42 |
43 |
44 | 45 |
46 |
47 | 48 |
49 | 55 |
56 |
57 |
58 |
59 |
60 | 61 | 62 |
63 |
64 |
65 |
66 | 67 |
68 | 69 |
70 |
71 |
72 |
73 |
74 | 75 |
76 | 77 |
78 |
79 |
80 |
81 |
82 | 83 |
84 |
85 | 86 |
87 |
88 | 89 | 90 |
91 |
92 |
93 |
94 | 95 | 100 |
101 |
102 |
103 |
104 | 105 | 118 |
119 |
120 |
121 |
122 | 123 | 124 |
125 |
126 |
127 |
128 | 129 | 130 |
131 |
132 | 133 |
134 | 135 | 136 |
137 |
138 |
139 |
140 | 141 | 149 |
150 |
151 |
152 |
153 | 154 | 155 |
156 |
157 | 158 | 159 |
160 |
161 | 162 | 163 |
164 |
165 |
166 | 167 |
168 |
169 | 175 |
176 |
177 |
178 |
179 |
180 |
181 | 182 | 183 |
184 |
185 | 186 | 187 |
188 |
189 |
190 |
191 |
192 | 193 | 194 |
195 |
196 |
197 |
198 | 199 |
200 |
201 | 202 |
203 |
204 | 205 |
206 | 212 |
213 |
214 |
215 |
216 |
217 |
218 | 219 | 220 |
221 |
222 | 223 | 224 |
225 |
226 | 227 | 228 |
229 |
230 |
231 |
232 |
233 | 234 | 235 | 236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | -------------------------------------------------------------------------------- /HTML/nouislider.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Materialize 1.0.0 (http://materializecss.com) 3 | * Copyright 2014-2015 Materialize 4 | * MIT License (https://raw.githubusercontent.com/Dogfalo/materialize/master/LICENSE) 5 | */ 6 | 7 | /*! nouislider - 9.1.0 - 2016-12-10 16:00:32 */ 8 | 9 | 10 | /* Functional styling; 11 | * These styles are required for noUiSlider to function. 12 | * You don't need to change these rules to apply your design. 13 | */ 14 | .noUi-target, 15 | .noUi-target * { 16 | -webkit-touch-callout: none; 17 | -webkit-tap-highlight-color: rgba(0,0,0,0); 18 | -webkit-user-select: none; 19 | -ms-touch-action: none; 20 | touch-action: none; 21 | -ms-user-select: none; 22 | -moz-user-select: none; 23 | user-select: none; 24 | -moz-box-sizing: border-box; 25 | box-sizing: border-box; 26 | } 27 | .noUi-target { 28 | position: relative; 29 | direction: ltr; 30 | } 31 | .noUi-base { 32 | width: 100%; 33 | height: 100%; 34 | position: relative; 35 | z-index: 1; /* Fix 401 */ 36 | } 37 | .noUi-connect { 38 | position: absolute; 39 | right: 0; 40 | top: 0; 41 | left: 0; 42 | bottom: 0; 43 | } 44 | .noUi-origin { 45 | position: absolute; 46 | height: 0; 47 | width: 0; 48 | } 49 | .noUi-handle { 50 | position: relative; 51 | z-index: 1; 52 | } 53 | .noUi-state-tap .noUi-connect, 54 | .noUi-state-tap .noUi-origin { 55 | -webkit-transition: top 0.25s, right 0.25s, bottom 0.25s, left 0.25s; 56 | transition: top 0.25s, right 0.25s, bottom 0.25s, left 0.25s; 57 | } 58 | .noUi-state-drag * { 59 | cursor: inherit !important; 60 | } 61 | 62 | .noUi-handle-touch-area{ 63 | position: relative; 64 | width: 44px; 65 | height: 44px; 66 | left: -15px; 67 | top: -15px; 68 | } 69 | /* Painting and performance; 70 | * Browsers can paint handles in their own layer. 71 | */ 72 | .noUi-base, 73 | .noUi-handle { 74 | -webkit-transform: translate3d(0,0,0); 75 | transform: translate3d(0,0,0); 76 | } 77 | 78 | /* Slider size and handle placement; 79 | */ 80 | .noUi-horizontal { 81 | height: 18px; 82 | } 83 | .noUi-horizontal .noUi-handle { 84 | width: 34px; 85 | height: 28px; 86 | left: -17px; 87 | top: -6px; 88 | } 89 | .noUi-vertical { 90 | width: 18px; 91 | } 92 | .noUi-vertical .noUi-handle { 93 | width: 28px; 94 | height: 34px; 95 | left: -6px; 96 | top: -17px; 97 | } 98 | 99 | /* Styling; 100 | */ 101 | .noUi-target { 102 | background: #cdcdcd; 103 | border-radius: 4px; 104 | border: 1px solid transparent; 105 | } 106 | .noUi-connect { 107 | background: #26A69A; 108 | -webkit-transition: background 450ms; 109 | transition: background 450ms; 110 | } 111 | 112 | /* Handles and cursors; 113 | */ 114 | .noUi-draggable { 115 | cursor: ew-resize; 116 | } 117 | .noUi-vertical .noUi-draggable { 118 | cursor: ns-resize; 119 | } 120 | .noUi-handle { 121 | border: 1px solid #D9D9D9; 122 | border-radius: 3px; 123 | background: #FFF; 124 | cursor: default; 125 | box-shadow: inset 0 0 1px #FFF, 126 | inset 0 1px 7px #EBEBEB, 127 | 0 3px 6px -3px #BBB; 128 | } 129 | .noUi-active { 130 | box-shadow: inset 0 0 1px #FFF, 131 | inset 0 1px 7px #DDD, 132 | 0 3px 6px -3px #BBB; 133 | } 134 | 135 | /* Handle stripes 136 | */ 137 | .noUi-handle:before, 138 | .noUi-handle:after { 139 | content: ""; 140 | display: block; 141 | position: absolute; 142 | height: 14px; 143 | width: 1px; 144 | background: #E8E7E6; 145 | left: 14px; 146 | top: 6px; 147 | } 148 | .noUi-handle:after { 149 | left: 17px; 150 | } 151 | .noUi-vertical .noUi-handle:before, 152 | .noUi-vertical .noUi-handle:after { 153 | width: 14px; 154 | height: 1px; 155 | left: 6px; 156 | top: 14px; 157 | } 158 | .noUi-vertical .noUi-handle:after { 159 | top: 17px; 160 | } 161 | 162 | /* Disabled state; 163 | */ 164 | 165 | [disabled] .noUi-connect { 166 | background: #B8B8B8; 167 | } 168 | [disabled].noUi-target, 169 | [disabled].noUi-handle, 170 | [disabled] .noUi-handle { 171 | cursor: not-allowed; 172 | } 173 | 174 | 175 | /* Base; 176 | * 177 | */ 178 | .noUi-pips, 179 | .noUi-pips * { 180 | -moz-box-sizing: border-box; 181 | box-sizing: border-box; 182 | } 183 | .noUi-pips { 184 | position: absolute; 185 | color: #999; 186 | } 187 | 188 | /* Values; 189 | * 190 | */ 191 | .noUi-value { 192 | position: absolute; 193 | text-align: center; 194 | } 195 | .noUi-value-sub { 196 | color: #ccc; 197 | font-size: 10px; 198 | } 199 | 200 | /* Markings; 201 | * 202 | */ 203 | .noUi-marker { 204 | position: absolute; 205 | background: #CCC; 206 | } 207 | .noUi-marker-sub { 208 | background: #AAA; 209 | } 210 | .noUi-marker-large { 211 | background: #AAA; 212 | } 213 | 214 | /* Horizontal layout; 215 | * 216 | */ 217 | .noUi-pips-horizontal { 218 | padding: 10px 0; 219 | height: 80px; 220 | top: 100%; 221 | left: 0; 222 | width: 100%; 223 | } 224 | .noUi-value-horizontal { 225 | -webkit-transform: translate3d(-50%,50%,0); 226 | transform: translate3d(-50%,50%,0); 227 | } 228 | 229 | .noUi-marker-horizontal.noUi-marker { 230 | margin-left: -1px; 231 | width: 2px; 232 | height: 5px; 233 | } 234 | .noUi-marker-horizontal.noUi-marker-sub { 235 | height: 10px; 236 | } 237 | .noUi-marker-horizontal.noUi-marker-large { 238 | height: 15px; 239 | } 240 | 241 | /* Vertical layout; 242 | * 243 | */ 244 | .noUi-pips-vertical { 245 | padding: 0 10px; 246 | height: 100%; 247 | top: 0; 248 | left: 100%; 249 | } 250 | .noUi-value-vertical { 251 | -webkit-transform: translate3d(0,50%,0); 252 | transform: translate3d(0,50%,0); 253 | padding-left: 25px; 254 | } 255 | 256 | .noUi-marker-vertical.noUi-marker { 257 | width: 5px; 258 | height: 2px; 259 | margin-top: -1px; 260 | } 261 | .noUi-marker-vertical.noUi-marker-sub { 262 | width: 10px; 263 | } 264 | .noUi-marker-vertical.noUi-marker-large { 265 | width: 15px; 266 | } 267 | 268 | .noUi-tooltip { 269 | display: block; 270 | position: absolute; 271 | border: 1px solid transparent; 272 | border-radius: 3px; 273 | background: #fff; 274 | color: #000; 275 | padding: 5px; 276 | text-align: center; 277 | } 278 | .noUi-horizontal .noUi-tooltip { 279 | -webkit-transform: translate(-50%, 0); 280 | transform: translate(-50%, 0); 281 | left: 50%; 282 | bottom: 120%; 283 | } 284 | .noUi-vertical .noUi-tooltip { 285 | -webkit-transform: translate(0, -50%); 286 | transform: translate(0, -50%); 287 | top: 50%; 288 | right: 120%; 289 | } 290 | 291 | /* Materialize Styles */ 292 | .noUi-target { 293 | border: 0; 294 | border-radius: 0; 295 | } 296 | .noUi-horizontal { 297 | height: 3px; 298 | } 299 | 300 | .noUi-vertical { 301 | height: 100%; 302 | width: 3px; 303 | } 304 | 305 | .noUi-horizontal .noUi-handle, 306 | .noUi-vertical .noUi-handle { 307 | width: 15px; 308 | height: 15px; 309 | border-radius: 50%; 310 | box-shadow: none; 311 | background-color: #26A69A; 312 | border: none; 313 | left: -5px; 314 | top: -6px; 315 | transition: width .2s cubic-bezier(0.215, 0.610, 0.355, 1.000), 316 | height .2s cubic-bezier(0.215, 0.610, 0.355, 1.000), 317 | left .2s cubic-bezier(0.215, 0.610, 0.355, 1.000), 318 | top .2s cubic-bezier(0.215, 0.610, 0.355, 1.000); 319 | } 320 | .noUi-handle:before { 321 | content: none; 322 | } 323 | .noUi-handle:after { 324 | content: none; 325 | } 326 | 327 | .noUi-target .noUi-active.noUi-handle { 328 | width: 3px; 329 | height: 3px; 330 | left: 0; 331 | top: 0; 332 | } 333 | 334 | .noUi-target.noUi-horizontal .noUi-tooltip { 335 | position: absolute; 336 | height: 30px; 337 | width: 30px; 338 | top: -17px; 339 | left: -2px; 340 | background-color: #26A69A; 341 | border-radius: 50%; 342 | transition: border-radius .25s cubic-bezier(0.215, 0.610, 0.355, 1.000), 343 | transform .25s cubic-bezier(0.215, 0.610, 0.355, 1.000); 344 | transform: scale(.5) rotate(-45deg); 345 | transform-origin: 50% 100%; 346 | } 347 | .noUi-target.noUi-horizontal .noUi-active .noUi-tooltip { 348 | border-radius: 15px 15px 15px 0; 349 | transform: rotate(-45deg) translate(23px, -25px); 350 | } 351 | 352 | .noUi-tooltip span { 353 | width: 100%; 354 | text-align: center; 355 | color: #fff; 356 | font-size: 12px; 357 | opacity: 0; 358 | position: absolute; 359 | top: 6px; 360 | left: -1px; 361 | transition: opacity .25s cubic-bezier(0.215, 0.610, 0.355, 1.000); 362 | } 363 | 364 | .noUi-horizontal .noUi-tooltip span { 365 | transform: rotate(45deg); 366 | } 367 | 368 | .noUi-vertical .noUi-tooltip span { 369 | transform: rotate(135deg); 370 | } 371 | 372 | 373 | .noUi-target.noUi-vertical .noUi-tooltip { 374 | position: absolute; 375 | height: 30px; 376 | width: 30px; 377 | top: -17px; 378 | left: -2px; 379 | background-color: #26A69A; 380 | border-radius: 50%; 381 | transition: border-radius .25s cubic-bezier(0.215, 0.610, 0.355, 1.000), 382 | transform .25s cubic-bezier(0.215, 0.610, 0.355, 1.000); 383 | transform: scale(.5) rotate(-45deg); 384 | transform-origin: 50% 100%; 385 | } 386 | .noUi-target.noUi-vertical .noUi-active .noUi-tooltip { 387 | border-radius: 15px 15px 15px 0; 388 | transform: rotate(-135deg) translate(35px, -10px); 389 | } 390 | .noUi-vertical .noUi-tooltip span { 391 | width: 100%; 392 | text-align: center; 393 | color: #fff; 394 | font-size: 12px; 395 | transform: rotate(135deg); 396 | opacity: 0; 397 | position: absolute; 398 | top: 7px; 399 | left: -1px; 400 | transition: opacity .25s cubic-bezier(0.215, 0.610, 0.355, 1.000); 401 | } 402 | 403 | .noUi-horizontal .noUi-active .noUi-tooltip span, 404 | .noUi-vertical .noUi-active .noUi-tooltip span { 405 | opacity: 1; 406 | } 407 | 408 | /* CUSTOMIZATIONS */ 409 | .noUi-handle-touch-area{ 410 | z-index: 5; 411 | } -------------------------------------------------------------------------------- /PCB_Files/ESP8266-01_4Channels/LED_Controller_4Channels.PcbDoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diyhue/Lights/5c7d5816f07d55b7df05a53115db783ecb733042/PCB_Files/ESP8266-01_4Channels/LED_Controller_4Channels.PcbDoc -------------------------------------------------------------------------------- /PCB_Files/ESP8266-01_4Channels/LED_Controller_4Channels.PrjPcbStructure: -------------------------------------------------------------------------------- 1 | Record=TopLevelDocument|FileName=LED_Controller_4Channels.SchDoc 2 | -------------------------------------------------------------------------------- /PCB_Files/ESP8266-01_4Channels/LED_Controller_4Channels.SchDoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diyhue/Lights/5c7d5816f07d55b7df05a53115db783ecb733042/PCB_Files/ESP8266-01_4Channels/LED_Controller_4Channels.SchDoc -------------------------------------------------------------------------------- /PCB_Files/ESP8266-01_4Channels/LED_Controller_4Channels.cam: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diyhue/Lights/5c7d5816f07d55b7df05a53115db783ecb733042/PCB_Files/ESP8266-01_4Channels/LED_Controller_4Channels.cam -------------------------------------------------------------------------------- /PCB_Files/ESP8266-01_4Channels/Project Outputs for LED_Controller_4Channels/LED_Controller_4Channels-macro.APR_LIB: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diyhue/Lights/5c7d5816f07d55b7df05a53115db783ecb733042/PCB_Files/ESP8266-01_4Channels/Project Outputs for LED_Controller_4Channels/LED_Controller_4Channels-macro.APR_LIB -------------------------------------------------------------------------------- /PCB_Files/ESP8266-01_4Channels/Project Outputs for LED_Controller_4Channels/LED_Controller_4Channels.EXTREP: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------------------ 2 | Gerber File Extension Report For: LED_Controller_4Channels.GBR 17.10.2017 19:24:17 3 | ------------------------------------------------------------------------------------------ 4 | 5 | 6 | ------------------------------------------------------------------------------------------ 7 | Layer Extension Layer Description 8 | ------------------------------------------------------------------------------------------ 9 | .GTL Top Layer 10 | .GBL Bottom Layer 11 | .GTO Top Overlay 12 | .GTP Top Paste 13 | .GTS Top Solder 14 | .GBS Bottom Solder 15 | .GBP Bottom Paste 16 | .GBO Bottom Overlay 17 | .GD1 Drill Drawing 18 | .GG1 Drill Guide 19 | ------------------------------------------------------------------------------------------ 20 | -------------------------------------------------------------------------------- /PCB_Files/ESP8266-01_4Channels/Project Outputs for LED_Controller_4Channels/LED_Controller_4Channels.GBO: -------------------------------------------------------------------------------- 1 | %FSLAX25Y25*% 2 | %MOIN*% 3 | G70* 4 | G01* 5 | G75* 6 | G04 Layer_Color=32896* 7 | %ADD10R,0.05512X0.04331*% 8 | %ADD11R,0.04331X0.10630*% 9 | %ADD12R,0.42126X0.36221*% 10 | %ADD13R,0.04331X0.05512*% 11 | %ADD14C,0.01200*% 12 | %ADD15C,0.07500*% 13 | %ADD16C,0.10000*% 14 | %ADD17C,0.05000*% 15 | %ADD18C,0.02000*% 16 | %ADD19C,0.02500*% 17 | %ADD20C,0.06000*% 18 | %ADD21R,0.06000X0.06000*% 19 | %ADD22R,0.05906X0.05906*% 20 | %ADD23C,0.05906*% 21 | %ADD24C,0.04724*% 22 | %ADD25C,0.05315*% 23 | %ADD26R,0.05315X0.05315*% 24 | %ADD27R,0.06299X0.06299*% 25 | %ADD28C,0.06299*% 26 | %ADD29R,0.05315X0.05315*% 27 | %ADD30C,0.05000*% 28 | %ADD31C,0.02500*% 29 | %ADD32C,0.00984*% 30 | %ADD33C,0.00787*% 31 | %ADD34C,0.00050*% 32 | %ADD35C,0.01000*% 33 | %ADD36C,0.00591*% 34 | %ADD37R,0.06312X0.05131*% 35 | %ADD38R,0.05131X0.11430*% 36 | %ADD39R,0.42926X0.37021*% 37 | %ADD40R,0.05131X0.06312*% 38 | %ADD41C,0.06800*% 39 | %ADD42R,0.06800X0.06800*% 40 | %ADD43R,0.06706X0.06706*% 41 | %ADD44C,0.06706*% 42 | %ADD45C,0.05524*% 43 | %ADD46C,0.06115*% 44 | %ADD47R,0.06115X0.06115*% 45 | %ADD48R,0.07099X0.07099*% 46 | %ADD49C,0.07099*% 47 | %ADD50R,0.06115X0.06115*% 48 | %ADD51C,0.05800*% 49 | %ADD52C,0.03300*% 50 | D32* 51 | X37492Y98500D02* 52 | G03* 53 | X37492Y98500I-492J0D01* 54 | G01* 55 | D33* 56 | X42669Y109567D02* 57 | Y114488D01* 58 | X1331Y109567D02* 59 | X42669D01* 60 | X1331D02* 61 | Y114488D01* 62 | D35* 63 | X101500Y74000D02* 64 | Y79998D01* 65 | X98501D01* 66 | X97501Y78998D01* 67 | Y76999D01* 68 | X98501Y75999D01* 69 | X101500D01* 70 | X99501D02* 71 | X97501Y74000D01* 72 | X92503D02* 73 | Y79998D01* 74 | X95502Y76999D01* 75 | X91503D01* 76 | X36500Y83000D02* 77 | X42498D01* 78 | Y85999D01* 79 | X41498Y86999D01* 80 | X39499D01* 81 | X38499Y85999D01* 82 | Y83000D01* 83 | Y84999D02* 84 | X36500Y86999D01* 85 | X42498Y92997D02* 86 | X41498Y90997D01* 87 | X39499Y88998D01* 88 | X37500D01* 89 | X36500Y89998D01* 90 | Y91997D01* 91 | X37500Y92997D01* 92 | X38499D01* 93 | X39499Y91997D01* 94 | Y88998D01* 95 | X38651Y158150D02* 96 | Y162148D01* 97 | X39651Y163148D01* 98 | X41650D01* 99 | X42650Y162148D01* 100 | Y158150D01* 101 | X41650Y157150D01* 102 | X39651D01* 103 | X40651Y159149D02* 104 | X38651Y157150D01* 105 | X39651D02* 106 | X38651Y158150D01* 107 | X36652Y156150D02* 108 | X32653D01* 109 | X26655Y162148D02* 110 | X27655Y163148D01* 111 | X29654D01* 112 | X30654Y162148D01* 113 | Y158150D01* 114 | X29654Y157150D01* 115 | X27655D01* 116 | X26655Y158150D01* 117 | Y160149D01* 118 | X28655D01* 119 | M02* 120 | -------------------------------------------------------------------------------- /PCB_Files/ESP8266-01_4Channels/Project Outputs for LED_Controller_4Channels/LED_Controller_4Channels.GBP: -------------------------------------------------------------------------------- 1 | %FSLAX25Y25*% 2 | %MOIN*% 3 | G70* 4 | G01* 5 | G75* 6 | G04 Layer_Color=128* 7 | %ADD10R,0.05512X0.04331*% 8 | %ADD11R,0.04331X0.10630*% 9 | %ADD12R,0.42126X0.36221*% 10 | %ADD13R,0.04331X0.05512*% 11 | %ADD14C,0.01200*% 12 | %ADD15C,0.07500*% 13 | %ADD16C,0.10000*% 14 | %ADD17C,0.05000*% 15 | %ADD18C,0.02000*% 16 | %ADD19C,0.02500*% 17 | %ADD20C,0.06000*% 18 | %ADD21R,0.06000X0.06000*% 19 | %ADD22R,0.05906X0.05906*% 20 | %ADD23C,0.05906*% 21 | %ADD24C,0.04724*% 22 | %ADD25C,0.05315*% 23 | %ADD26R,0.05315X0.05315*% 24 | %ADD27R,0.06299X0.06299*% 25 | %ADD28C,0.06299*% 26 | %ADD29R,0.05315X0.05315*% 27 | %ADD30C,0.05000*% 28 | %ADD31C,0.02500*% 29 | %ADD32C,0.00984*% 30 | %ADD33C,0.00787*% 31 | %ADD34C,0.00050*% 32 | %ADD35C,0.01000*% 33 | %ADD36C,0.00591*% 34 | %ADD37R,0.06312X0.05131*% 35 | %ADD38R,0.05131X0.11430*% 36 | %ADD39R,0.42926X0.37021*% 37 | %ADD40R,0.05131X0.06312*% 38 | %ADD41C,0.06800*% 39 | %ADD42R,0.06800X0.06800*% 40 | %ADD43R,0.06706X0.06706*% 41 | %ADD44C,0.06706*% 42 | %ADD45C,0.05524*% 43 | %ADD46C,0.06115*% 44 | %ADD47R,0.06115X0.06115*% 45 | %ADD48R,0.07099X0.07099*% 46 | %ADD49C,0.07099*% 47 | %ADD50R,0.06115X0.06115*% 48 | %ADD51C,0.05800*% 49 | %ADD52C,0.03300*% 50 | D10* 51 | X39500Y103953D02* 52 | D03* 53 | Y98047D02* 54 | D03* 55 | D11* 56 | X32000Y101031D02* 57 | D03* 58 | X12000D02* 59 | D03* 60 | D12* 61 | X22000Y134173D02* 62 | D03* 63 | D13* 64 | X94047Y68500D02* 65 | D03* 66 | X99953D02* 67 | D03* 68 | M02* 69 | -------------------------------------------------------------------------------- /PCB_Files/ESP8266-01_4Channels/Project Outputs for LED_Controller_4Channels/LED_Controller_4Channels.GBS: -------------------------------------------------------------------------------- 1 | %FSLAX25Y25*% 2 | %MOIN*% 3 | G70* 4 | G01* 5 | G75* 6 | G04 Layer_Color=16711935* 7 | %ADD10R,0.05512X0.04331*% 8 | %ADD11R,0.04331X0.10630*% 9 | %ADD12R,0.42126X0.36221*% 10 | %ADD13R,0.04331X0.05512*% 11 | %ADD14C,0.01200*% 12 | %ADD15C,0.07500*% 13 | %ADD16C,0.10000*% 14 | %ADD17C,0.05000*% 15 | %ADD18C,0.02000*% 16 | %ADD19C,0.02500*% 17 | %ADD20C,0.06000*% 18 | %ADD21R,0.06000X0.06000*% 19 | %ADD22R,0.05906X0.05906*% 20 | %ADD23C,0.05906*% 21 | %ADD24C,0.04724*% 22 | %ADD25C,0.05315*% 23 | %ADD26R,0.05315X0.05315*% 24 | %ADD27R,0.06299X0.06299*% 25 | %ADD28C,0.06299*% 26 | %ADD29R,0.05315X0.05315*% 27 | %ADD30C,0.05000*% 28 | %ADD31C,0.02500*% 29 | %ADD32C,0.00984*% 30 | %ADD33C,0.00787*% 31 | %ADD34C,0.00050*% 32 | %ADD35C,0.01000*% 33 | %ADD36C,0.00591*% 34 | %ADD37R,0.06312X0.05131*% 35 | %ADD38R,0.05131X0.11430*% 36 | %ADD39R,0.42926X0.37021*% 37 | %ADD40R,0.05131X0.06312*% 38 | %ADD41C,0.06800*% 39 | %ADD42R,0.06800X0.06800*% 40 | %ADD43R,0.06706X0.06706*% 41 | %ADD44C,0.06706*% 42 | %ADD45C,0.05524*% 43 | %ADD46C,0.06115*% 44 | %ADD47R,0.06115X0.06115*% 45 | %ADD48R,0.07099X0.07099*% 46 | %ADD49C,0.07099*% 47 | %ADD50R,0.06115X0.06115*% 48 | %ADD51C,0.05800*% 49 | %ADD52C,0.03300*% 50 | D37* 51 | X39500Y103953D02* 52 | D03* 53 | Y98047D02* 54 | D03* 55 | D38* 56 | X32000Y101031D02* 57 | D03* 58 | X12000D02* 59 | D03* 60 | D39* 61 | X22000Y134173D02* 62 | D03* 63 | D40* 64 | X94047Y68500D02* 65 | D03* 66 | X99953D02* 67 | D03* 68 | D41* 69 | X62200Y58000D02* 70 | D03* 71 | Y48100D02* 72 | D03* 73 | X72200Y58000D02* 74 | D03* 75 | X71900Y48100D02* 76 | D03* 77 | X82100Y58000D02* 78 | D03* 79 | Y48000D02* 80 | D03* 81 | X92200D02* 82 | D03* 83 | D42* 84 | X92100Y58100D02* 85 | D03* 86 | D43* 87 | X19000Y6500D02* 88 | D03* 89 | X61000Y147000D02* 90 | D03* 91 | D44* 92 | X29000Y6500D02* 93 | D03* 94 | X101000Y147000D02* 95 | D03* 96 | X91000D02* 97 | D03* 98 | X81000D02* 99 | D03* 100 | X71000D02* 101 | D03* 102 | D45* 103 | X19000Y37500D02* 104 | D03* 105 | Y67500D02* 106 | D03* 107 | D46* 108 | X45000Y26842D02* 109 | D03* 110 | X59658Y32500D02* 111 | D03* 112 | D47* 113 | X45000Y7158D02* 114 | D03* 115 | D48* 116 | X68500Y8000D02* 117 | D03* 118 | D49* 119 | X78500D02* 120 | D03* 121 | X88500D02* 122 | D03* 123 | D50* 124 | X79343Y32500D02* 125 | D03* 126 | D51* 127 | X104500Y68500D02* 128 | D03* 129 | X38500Y85000D02* 130 | D03* 131 | X121000Y48000D02* 132 | D03* 133 | X127000Y42000D02* 134 | D03* 135 | X55000Y53000D02* 136 | D03* 137 | D52* 138 | X106500Y97547D02* 139 | D03* 140 | X68000Y76000D02* 141 | D03* 142 | M02* 143 | -------------------------------------------------------------------------------- /PCB_Files/ESP8266-01_4Channels/Project Outputs for LED_Controller_4Channels/LED_Controller_4Channels.GD1: -------------------------------------------------------------------------------- 1 | %FSLAX25Y25*% 2 | %MOIN*% 3 | G70* 4 | G01* 5 | G75* 6 | G04 Layer_Color=2752767* 7 | %ADD10R,0.05512X0.04331*% 8 | %ADD11R,0.04331X0.10630*% 9 | %ADD12R,0.42126X0.36221*% 10 | %ADD13R,0.04331X0.05512*% 11 | %ADD14C,0.01200*% 12 | %ADD15C,0.07500*% 13 | %ADD16C,0.10000*% 14 | %ADD17C,0.05000*% 15 | %ADD18C,0.02000*% 16 | %ADD19C,0.02500*% 17 | %ADD20C,0.06000*% 18 | %ADD21R,0.06000X0.06000*% 19 | %ADD22R,0.05906X0.05906*% 20 | %ADD23C,0.05906*% 21 | %ADD24C,0.04724*% 22 | %ADD25C,0.05315*% 23 | %ADD26R,0.05315X0.05315*% 24 | %ADD27R,0.06299X0.06299*% 25 | %ADD28C,0.06299*% 26 | %ADD29R,0.05315X0.05315*% 27 | %ADD30C,0.05000*% 28 | %ADD31C,0.02500*% 29 | %ADD32C,0.00984*% 30 | %ADD33C,0.00787*% 31 | %ADD34C,0.00050*% 32 | %ADD35C,0.01000*% 33 | %ADD36C,0.00591*% 34 | %ADD37R,0.06312X0.05131*% 35 | %ADD38R,0.05131X0.11430*% 36 | %ADD39R,0.42926X0.37021*% 37 | %ADD40R,0.05131X0.06312*% 38 | %ADD41C,0.06800*% 39 | %ADD42R,0.06800X0.06800*% 40 | %ADD43R,0.06706X0.06706*% 41 | %ADD44C,0.06706*% 42 | %ADD45C,0.05524*% 43 | %ADD46C,0.06115*% 44 | %ADD47R,0.06115X0.06115*% 45 | %ADD48R,0.07099X0.07099*% 46 | %ADD49C,0.07099*% 47 | %ADD50R,0.06115X0.06115*% 48 | %ADD51C,0.05800*% 49 | %ADD52C,0.03300*% 50 | %ADD53C,0.00500*% 51 | %ADD54C,0.00667*% 52 | D53* 53 | X60200Y56000D02* 54 | Y60000D01* 55 | X64200D01* 56 | Y56000D01* 57 | X60200D01* 58 | Y46100D02* 59 | Y50100D01* 60 | X64200D01* 61 | Y46100D01* 62 | X60200D01* 63 | X70200Y56000D02* 64 | Y60000D01* 65 | X74200D01* 66 | Y56000D01* 67 | X70200D01* 68 | X69900Y46100D02* 69 | Y50100D01* 70 | X73900D01* 71 | Y46100D01* 72 | X69900D01* 73 | X80100Y56000D02* 74 | Y60000D01* 75 | X84100D01* 76 | Y56000D01* 77 | X80100D01* 78 | Y46000D02* 79 | Y50000D01* 80 | X84100D01* 81 | Y46000D01* 82 | X80100D01* 83 | X90100Y56100D02* 84 | Y60100D01* 85 | X94100D01* 86 | Y56100D01* 87 | X90100D01* 88 | X90200Y46000D02* 89 | Y50000D01* 90 | X94200D01* 91 | Y46000D01* 92 | X90200D01* 93 | X19000Y35500D02* 94 | X17000Y39500D01* 95 | X21000D01* 96 | X19000Y35500D01* 97 | Y65500D02* 98 | X17000Y69500D01* 99 | X21000D01* 100 | X19000Y65500D01* 101 | X45000Y24843D02* 102 | X46000Y25842D01* 103 | X47000D01* 104 | X46000Y26842D01* 105 | X47000Y27843D01* 106 | X46000D01* 107 | X45000Y28842D01* 108 | X44000Y27843D01* 109 | X43000D01* 110 | X44000Y26842D01* 111 | X43000Y25842D01* 112 | X44000D01* 113 | X45000Y24843D01* 114 | X45000Y5158D02* 115 | X46000Y6157D01* 116 | X47000D01* 117 | X46000Y7158D01* 118 | X47000Y8157D01* 119 | X46000D01* 120 | X45000Y9157D01* 121 | X44000Y8157D01* 122 | X43000D01* 123 | X44000Y7158D01* 124 | X43000Y6157D01* 125 | X44000D01* 126 | X45000Y5158D01* 127 | X66500Y6000D02* 128 | X67500Y8000D01* 129 | X66500Y10000D01* 130 | X68500Y9000D01* 131 | X70500Y10000D01* 132 | X69500Y8000D01* 133 | X70500Y6000D01* 134 | X68500Y7000D01* 135 | X66500Y6000D01* 136 | X76500D02* 137 | X77500Y8000D01* 138 | X76500Y10000D01* 139 | X78500Y9000D01* 140 | X80500Y10000D01* 141 | X79500Y8000D01* 142 | X80500Y6000D01* 143 | X78500Y7000D01* 144 | X76500Y6000D01* 145 | X86500D02* 146 | X87500Y8000D01* 147 | X86500Y10000D01* 148 | X88500Y9000D01* 149 | X90500Y10000D01* 150 | X89500Y8000D01* 151 | X90500Y6000D01* 152 | X88500Y7000D01* 153 | X86500Y6000D01* 154 | X59658Y30500D02* 155 | X60658Y31500D01* 156 | X61658D01* 157 | X60658Y32500D01* 158 | X61658Y33500D01* 159 | X60658D01* 160 | X59658Y34500D01* 161 | X58657Y33500D01* 162 | X57657D01* 163 | X58657Y32500D01* 164 | X57657Y31500D01* 165 | X58657D01* 166 | X59658Y30500D01* 167 | X79343Y30500D02* 168 | X80343Y31500D01* 169 | X81343D01* 170 | X80343Y32500D01* 171 | X81343Y33500D01* 172 | X80343D01* 173 | X79343Y34500D01* 174 | X78342Y33500D01* 175 | X77342D01* 176 | X78342Y32500D01* 177 | X77342Y31500D01* 178 | X78342D01* 179 | X79343Y30500D01* 180 | X103500Y67500D02* 181 | Y66500D01* 182 | X105500D01* 183 | Y67500D01* 184 | X106500D01* 185 | Y69500D01* 186 | X105500D01* 187 | Y70500D01* 188 | X103500D01* 189 | Y69500D01* 190 | X102500D01* 191 | Y67500D01* 192 | X103500D01* 193 | X37500Y84000D02* 194 | Y83000D01* 195 | X39500D01* 196 | Y84000D01* 197 | X40500D01* 198 | Y86000D01* 199 | X39500D01* 200 | Y87000D01* 201 | X37500D01* 202 | Y86000D01* 203 | X36500D01* 204 | Y84000D01* 205 | X37500D01* 206 | X104500Y95547D02* 207 | X105500D01* 208 | X106500Y96547D01* 209 | X107500Y95547D01* 210 | X108500D01* 211 | Y96547D01* 212 | X107500Y97547D01* 213 | X108500Y98547D01* 214 | Y99547D01* 215 | X107500D01* 216 | X106500Y98547D01* 217 | X105500Y99547D01* 218 | X104500D01* 219 | Y98547D01* 220 | X105500Y97547D01* 221 | X104500Y96547D01* 222 | Y95547D01* 223 | X66000Y74000D02* 224 | X67000D01* 225 | X68000Y75000D01* 226 | X69000Y74000D01* 227 | X70000D01* 228 | Y75000D01* 229 | X69000Y76000D01* 230 | X70000Y77000D01* 231 | Y78000D01* 232 | X69000D01* 233 | X68000Y77000D01* 234 | X67000Y78000D01* 235 | X66000D01* 236 | Y77000D01* 237 | X67000Y76000D01* 238 | X66000Y75000D01* 239 | Y74000D01* 240 | X120000Y47000D02* 241 | Y46000D01* 242 | X122000D01* 243 | Y47000D01* 244 | X123000D01* 245 | Y49000D01* 246 | X122000D01* 247 | Y50000D01* 248 | X120000D01* 249 | Y49000D01* 250 | X119000D01* 251 | Y47000D01* 252 | X120000D01* 253 | X126000Y41000D02* 254 | Y40000D01* 255 | X128000D01* 256 | Y41000D01* 257 | X129000D01* 258 | Y43000D01* 259 | X128000D01* 260 | Y44000D01* 261 | X126000D01* 262 | Y43000D01* 263 | X125000D01* 264 | Y41000D01* 265 | X126000D01* 266 | X54000Y52000D02* 267 | Y51000D01* 268 | X56000D01* 269 | Y52000D01* 270 | X57000D01* 271 | Y54000D01* 272 | X56000D01* 273 | Y55000D01* 274 | X54000D01* 275 | Y54000D01* 276 | X53000D01* 277 | Y52000D01* 278 | X54000D01* 279 | D54* 280 | X21000Y6500D02* 281 | G03* 282 | X21000Y6500I-2000J0D01* 283 | G01* 284 | X31000D02* 285 | G03* 286 | X31000Y6500I-2000J0D01* 287 | G01* 288 | X103000Y147000D02* 289 | G03* 290 | X103000Y147000I-2000J0D01* 291 | G01* 292 | X93000D02* 293 | G03* 294 | X93000Y147000I-2000J0D01* 295 | G01* 296 | X83000D02* 297 | G03* 298 | X83000Y147000I-2000J0D01* 299 | G01* 300 | X73000D02* 301 | G03* 302 | X73000Y147000I-2000J0D01* 303 | G01* 304 | X63000D02* 305 | G03* 306 | X63000Y147000I-2000J0D01* 307 | G01* 308 | M02* 309 | -------------------------------------------------------------------------------- /PCB_Files/ESP8266-01_4Channels/Project Outputs for LED_Controller_4Channels/LED_Controller_4Channels.GG1: -------------------------------------------------------------------------------- 1 | %FSLAX25Y25*% 2 | %MOIN*% 3 | G70* 4 | G01* 5 | G75* 6 | %ADD10R,0.05512X0.04331*% 7 | %ADD11R,0.04331X0.10630*% 8 | %ADD12R,0.42126X0.36221*% 9 | %ADD13R,0.04331X0.05512*% 10 | %ADD14C,0.01200*% 11 | %ADD15C,0.07500*% 12 | %ADD16C,0.10000*% 13 | %ADD17C,0.05000*% 14 | %ADD18C,0.02000*% 15 | %ADD19C,0.02500*% 16 | %ADD20C,0.06000*% 17 | %ADD21R,0.06000X0.06000*% 18 | %ADD22R,0.05906X0.05906*% 19 | %ADD23C,0.05906*% 20 | %ADD24C,0.04724*% 21 | %ADD25C,0.05315*% 22 | %ADD26R,0.05315X0.05315*% 23 | %ADD27R,0.06299X0.06299*% 24 | %ADD28C,0.06299*% 25 | %ADD29R,0.05315X0.05315*% 26 | %ADD30C,0.05000*% 27 | %ADD31C,0.02500*% 28 | %ADD32C,0.00984*% 29 | %ADD33C,0.00787*% 30 | %ADD34C,0.00050*% 31 | %ADD35C,0.01000*% 32 | %ADD36C,0.00591*% 33 | %ADD37R,0.06312X0.05131*% 34 | %ADD38R,0.05131X0.11430*% 35 | %ADD39R,0.42926X0.37021*% 36 | %ADD40R,0.05131X0.06312*% 37 | %ADD41C,0.06800*% 38 | %ADD42R,0.06800X0.06800*% 39 | %ADD43R,0.06706X0.06706*% 40 | %ADD44C,0.06706*% 41 | %ADD45C,0.05524*% 42 | %ADD46C,0.06115*% 43 | %ADD47R,0.06115X0.06115*% 44 | %ADD48R,0.07099X0.07099*% 45 | %ADD49C,0.07099*% 46 | %ADD50R,0.06115X0.06115*% 47 | %ADD51C,0.05800*% 48 | %ADD52C,0.03300*% 49 | %ADD53C,0.00500*% 50 | %ADD54C,0.00667*% 51 | D53* 52 | X60700Y58000D02* 53 | X63700D01* 54 | X62200Y56500D02* 55 | Y59500D01* 56 | X60700Y48100D02* 57 | X63700D01* 58 | X62200Y46600D02* 59 | Y49600D01* 60 | X70700Y58000D02* 61 | X73700D01* 62 | X72200Y56500D02* 63 | Y59500D01* 64 | X70400Y48100D02* 65 | X73400D01* 66 | X71900Y46600D02* 67 | Y49600D01* 68 | X80600Y58000D02* 69 | X83600D01* 70 | X82100Y56500D02* 71 | Y59500D01* 72 | X80600Y48000D02* 73 | X83600D01* 74 | X82100Y46500D02* 75 | Y49500D01* 76 | X90600Y58100D02* 77 | X93600D01* 78 | X92100Y56600D02* 79 | Y59600D01* 80 | X90700Y48000D02* 81 | X93700D01* 82 | X92200Y46500D02* 83 | Y49500D01* 84 | X17228Y6500D02* 85 | X20772D01* 86 | X19000Y4728D02* 87 | Y8272D01* 88 | X27228Y6500D02* 89 | X30772D01* 90 | X29000Y4728D02* 91 | Y8272D01* 92 | X17622Y37500D02* 93 | X20378D01* 94 | X19000Y36122D02* 95 | Y38878D01* 96 | X17622Y67500D02* 97 | X20378D01* 98 | X19000Y66122D02* 99 | Y68878D01* 100 | X43425Y26842D02* 101 | X46575D01* 102 | X45000Y25268D02* 103 | Y28417D01* 104 | X43425Y7158D02* 105 | X46575D01* 106 | X45000Y5583D02* 107 | Y8732D01* 108 | X66531Y8000D02* 109 | X70468D01* 110 | X68500Y6032D02* 111 | Y9968D01* 112 | X76531Y8000D02* 113 | X80468D01* 114 | X78500Y6032D02* 115 | Y9968D01* 116 | X86532Y8000D02* 117 | X90469D01* 118 | X88500Y6032D02* 119 | Y9968D01* 120 | X58083Y32500D02* 121 | X61232D01* 122 | X59658Y30925D02* 123 | Y34075D01* 124 | X77768Y32500D02* 125 | X80917D01* 126 | X79343Y30925D02* 127 | Y34075D01* 128 | X99228Y147000D02* 129 | X102772D01* 130 | X101000Y145228D02* 131 | Y148772D01* 132 | X89228Y147000D02* 133 | X92772D01* 134 | X91000Y145228D02* 135 | Y148772D01* 136 | X79228Y147000D02* 137 | X82772D01* 138 | X81000Y145228D02* 139 | Y148772D01* 140 | X69228Y147000D02* 141 | X72772D01* 142 | X71000Y145228D02* 143 | Y148772D01* 144 | X59228Y147000D02* 145 | X62772D01* 146 | X61000Y145228D02* 147 | Y148772D01* 148 | X103100Y68500D02* 149 | X105900D01* 150 | X104500Y67100D02* 151 | Y69900D01* 152 | X37100Y85000D02* 153 | X39900D01* 154 | X38500Y83600D02* 155 | Y86400D01* 156 | X105800Y97547D02* 157 | X107200D01* 158 | X106500Y96847D02* 159 | Y98247D01* 160 | X67300Y76000D02* 161 | X68700D01* 162 | X68000Y75300D02* 163 | Y76700D01* 164 | X119600Y48000D02* 165 | X122400D01* 166 | X121000Y46600D02* 167 | Y49400D01* 168 | X125600Y42000D02* 169 | X128400D01* 170 | X127000Y40600D02* 171 | Y43400D01* 172 | X53600Y53000D02* 173 | X56400D01* 174 | X55000Y51600D02* 175 | Y54400D01* 176 | M02* 177 | -------------------------------------------------------------------------------- /PCB_Files/ESP8266-01_4Channels/Project Outputs for LED_Controller_4Channels/LED_Controller_4Channels.GTP: -------------------------------------------------------------------------------- 1 | %FSLAX25Y25*% 2 | %MOIN*% 3 | G70* 4 | G01* 5 | G75* 6 | G04 Layer_Color=8421504* 7 | %ADD10R,0.05512X0.04331*% 8 | %ADD11R,0.04331X0.10630*% 9 | %ADD12R,0.42126X0.36221*% 10 | %ADD13R,0.04331X0.05512*% 11 | %ADD14C,0.01200*% 12 | %ADD15C,0.07500*% 13 | %ADD16C,0.10000*% 14 | %ADD17C,0.05000*% 15 | %ADD18C,0.02000*% 16 | %ADD19C,0.02500*% 17 | %ADD20C,0.06000*% 18 | %ADD21R,0.06000X0.06000*% 19 | %ADD22R,0.05906X0.05906*% 20 | %ADD23C,0.05906*% 21 | %ADD24C,0.04724*% 22 | %ADD25C,0.05315*% 23 | %ADD26R,0.05315X0.05315*% 24 | %ADD27R,0.06299X0.06299*% 25 | %ADD28C,0.06299*% 26 | %ADD29R,0.05315X0.05315*% 27 | %ADD30C,0.05000*% 28 | %ADD31C,0.02500*% 29 | %ADD32C,0.00984*% 30 | %ADD33C,0.00787*% 31 | %ADD34C,0.00050*% 32 | %ADD35C,0.01000*% 33 | %ADD36C,0.00591*% 34 | D10* 35 | X148500Y77453D02* 36 | D03* 37 | Y71547D02* 38 | D03* 39 | X5000Y103953D02* 40 | D03* 41 | Y98047D02* 42 | D03* 43 | X114000Y103453D02* 44 | D03* 45 | Y97547D02* 46 | D03* 47 | D11* 48 | X141500Y74468D02* 49 | D03* 50 | X121500D02* 51 | D03* 52 | X121000Y101031D02* 53 | D03* 54 | X141000D02* 55 | D03* 56 | X12000D02* 57 | D03* 58 | X32000D02* 59 | D03* 60 | D12* 61 | X131500Y41327D02* 62 | D03* 63 | X131000Y134173D02* 64 | D03* 65 | X22000D02* 66 | D03* 67 | D13* 68 | X67547Y68500D02* 69 | D03* 70 | X73453D02* 71 | D03* 72 | X85953Y68500D02* 73 | D03* 74 | X80047D02* 75 | D03* 76 | X99953D02* 77 | D03* 78 | X94047D02* 79 | D03* 80 | M02* 81 | -------------------------------------------------------------------------------- /PCB_Files/ESP8266-01_4Channels/Project Outputs for LED_Controller_4Channels/LED_Controller_4Channels.GTS: -------------------------------------------------------------------------------- 1 | %FSLAX25Y25*% 2 | %MOIN*% 3 | G70* 4 | G01* 5 | G75* 6 | G04 Layer_Color=8388736* 7 | %ADD10R,0.05512X0.04331*% 8 | %ADD11R,0.04331X0.10630*% 9 | %ADD12R,0.42126X0.36221*% 10 | %ADD13R,0.04331X0.05512*% 11 | %ADD14C,0.01200*% 12 | %ADD15C,0.07500*% 13 | %ADD16C,0.10000*% 14 | %ADD17C,0.05000*% 15 | %ADD18C,0.02000*% 16 | %ADD19C,0.02500*% 17 | %ADD20C,0.06000*% 18 | %ADD21R,0.06000X0.06000*% 19 | %ADD22R,0.05906X0.05906*% 20 | %ADD23C,0.05906*% 21 | %ADD24C,0.04724*% 22 | %ADD25C,0.05315*% 23 | %ADD26R,0.05315X0.05315*% 24 | %ADD27R,0.06299X0.06299*% 25 | %ADD28C,0.06299*% 26 | %ADD29R,0.05315X0.05315*% 27 | %ADD30C,0.05000*% 28 | %ADD31C,0.02500*% 29 | %ADD32C,0.00984*% 30 | %ADD33C,0.00787*% 31 | %ADD34C,0.00050*% 32 | %ADD35C,0.01000*% 33 | %ADD36C,0.00591*% 34 | %ADD37R,0.06312X0.05131*% 35 | %ADD38R,0.05131X0.11430*% 36 | %ADD39R,0.42926X0.37021*% 37 | %ADD40R,0.05131X0.06312*% 38 | %ADD41C,0.06800*% 39 | %ADD42R,0.06800X0.06800*% 40 | %ADD43R,0.06706X0.06706*% 41 | %ADD44C,0.06706*% 42 | %ADD45C,0.05524*% 43 | %ADD46C,0.06115*% 44 | %ADD47R,0.06115X0.06115*% 45 | %ADD48R,0.07099X0.07099*% 46 | %ADD49C,0.07099*% 47 | %ADD50R,0.06115X0.06115*% 48 | %ADD51C,0.05800*% 49 | %ADD52C,0.03300*% 50 | D37* 51 | X148500Y77453D02* 52 | D03* 53 | Y71547D02* 54 | D03* 55 | X5000Y103953D02* 56 | D03* 57 | Y98047D02* 58 | D03* 59 | X114000Y103453D02* 60 | D03* 61 | Y97547D02* 62 | D03* 63 | D38* 64 | X141500Y74468D02* 65 | D03* 66 | X121500D02* 67 | D03* 68 | X121000Y101031D02* 69 | D03* 70 | X141000D02* 71 | D03* 72 | X12000D02* 73 | D03* 74 | X32000D02* 75 | D03* 76 | D39* 77 | X131500Y41327D02* 78 | D03* 79 | X131000Y134173D02* 80 | D03* 81 | X22000D02* 82 | D03* 83 | D40* 84 | X67547Y68500D02* 85 | D03* 86 | X73453D02* 87 | D03* 88 | X85953Y68500D02* 89 | D03* 90 | X80047D02* 91 | D03* 92 | X99953D02* 93 | D03* 94 | X94047D02* 95 | D03* 96 | D41* 97 | X62200Y58000D02* 98 | D03* 99 | Y48100D02* 100 | D03* 101 | X72200Y58000D02* 102 | D03* 103 | X71900Y48100D02* 104 | D03* 105 | X82100Y58000D02* 106 | D03* 107 | Y48000D02* 108 | D03* 109 | X92200D02* 110 | D03* 111 | D42* 112 | X92100Y58100D02* 113 | D03* 114 | D43* 115 | X19000Y6500D02* 116 | D03* 117 | X61000Y147000D02* 118 | D03* 119 | D44* 120 | X29000Y6500D02* 121 | D03* 122 | X101000Y147000D02* 123 | D03* 124 | X91000D02* 125 | D03* 126 | X81000D02* 127 | D03* 128 | X71000D02* 129 | D03* 130 | D45* 131 | X19000Y37500D02* 132 | D03* 133 | Y67500D02* 134 | D03* 135 | D46* 136 | X45000Y26842D02* 137 | D03* 138 | X59658Y32500D02* 139 | D03* 140 | D47* 141 | X45000Y7158D02* 142 | D03* 143 | D48* 144 | X68500Y8000D02* 145 | D03* 146 | D49* 147 | X78500D02* 148 | D03* 149 | X88500D02* 150 | D03* 151 | D50* 152 | X79343Y32500D02* 153 | D03* 154 | D51* 155 | X104500Y68500D02* 156 | D03* 157 | X38500Y85000D02* 158 | D03* 159 | X121000Y48000D02* 160 | D03* 161 | X127000Y42000D02* 162 | D03* 163 | X55000Y53000D02* 164 | D03* 165 | D52* 166 | X106500Y97547D02* 167 | D03* 168 | X68000Y76000D02* 169 | D03* 170 | M02* 171 | -------------------------------------------------------------------------------- /PCB_Files/ESP8266-01_4Channels/Project Outputs for LED_Controller_4Channels/LED_Controller_4Channels.REP: -------------------------------------------------------------------------------- 1 | ************************************************************* 2 | FileName = LED_Controller_4Channels.GBR 3 | AutoAperture = True 4 | ************************************************************* 5 | Generating : Top Layer 6 | File : LED_Controller_4Channels.GTL 7 | 8 | Adding Layer : Top Layer 9 | 10 | Adding Layer : Multi-Layer 11 | 12 | 13 | Used DCodes : 14 | D10 15 | D11 16 | D12 17 | D13 18 | D14 19 | D15 20 | D16 21 | D17 22 | D18 23 | D19 24 | D20 25 | D21 26 | D22 27 | D23 28 | D24 29 | D25 30 | D26 31 | D27 32 | D28 33 | D29 34 | D30 35 | D31 36 | ************************************************************* 37 | 38 | ************************************************************* 39 | Generating : Bottom Layer 40 | File : LED_Controller_4Channels.GBL 41 | 42 | Adding Layer : Bottom Layer 43 | 44 | Adding Layer : Multi-Layer 45 | 46 | 47 | Used DCodes : 48 | D10 49 | D11 50 | D12 51 | D13 52 | D14 53 | D15 54 | D16 55 | D17 56 | D19 57 | D20 58 | D21 59 | D22 60 | D23 61 | D24 62 | D25 63 | D26 64 | D27 65 | D28 66 | D29 67 | D30 68 | D31 69 | ************************************************************* 70 | 71 | ************************************************************* 72 | Generating : Top Overlay 73 | File : LED_Controller_4Channels.GTO 74 | 75 | Adding Layer : Top Overlay 76 | 77 | 78 | Used DCodes : 79 | D32 80 | D33 81 | D34 82 | D35 83 | D36 84 | ************************************************************* 85 | 86 | ************************************************************* 87 | Generating : Top Paste 88 | File : LED_Controller_4Channels.GTP 89 | 90 | Adding Layer : Top Paste 91 | 92 | Adding Layer : Top Layer 93 | 94 | Adding Layer : Multi-Layer 95 | 96 | 97 | Used DCodes : 98 | D10 99 | D11 100 | D12 101 | D13 102 | ************************************************************* 103 | 104 | ************************************************************* 105 | Generating : Top Solder 106 | File : LED_Controller_4Channels.GTS 107 | 108 | Adding Layer : Top Solder 109 | 110 | Adding Layer : Top Layer 111 | 112 | Adding Layer : Multi-Layer 113 | 114 | 115 | Used DCodes : 116 | D37 117 | D38 118 | D39 119 | D40 120 | D41 121 | D42 122 | D43 123 | D44 124 | D45 125 | D46 126 | D47 127 | D48 128 | D49 129 | D50 130 | D51 131 | D52 132 | ************************************************************* 133 | 134 | ************************************************************* 135 | Generating : Bottom Solder 136 | File : LED_Controller_4Channels.GBS 137 | 138 | Adding Layer : Bottom Solder 139 | 140 | Adding Layer : Bottom Layer 141 | 142 | Adding Layer : Multi-Layer 143 | 144 | 145 | Used DCodes : 146 | D37 147 | D38 148 | D39 149 | D40 150 | D41 151 | D42 152 | D43 153 | D44 154 | D45 155 | D46 156 | D47 157 | D48 158 | D49 159 | D50 160 | D51 161 | D52 162 | ************************************************************* 163 | 164 | ************************************************************* 165 | Generating : Bottom Paste 166 | File : LED_Controller_4Channels.GBP 167 | 168 | Adding Layer : Bottom Paste 169 | 170 | Adding Layer : Bottom Layer 171 | 172 | Adding Layer : Multi-Layer 173 | 174 | 175 | Used DCodes : 176 | D10 177 | D11 178 | D12 179 | D13 180 | ************************************************************* 181 | 182 | ************************************************************* 183 | Generating : Bottom Overlay 184 | File : LED_Controller_4Channels.GBO 185 | 186 | Adding Layer : Bottom Overlay 187 | 188 | 189 | Used DCodes : 190 | D32 191 | D33 192 | D35 193 | ************************************************************* 194 | 195 | ************************************************************* 196 | Generating : Drill Drawing 197 | File : LED_Controller_4Channels.GD1 198 | 199 | Adding Drill Pair : Bottom Layer-Top Layer 200 | 201 | Adding Layer : Drill Drawing 202 | 203 | 204 | Used DCodes : 205 | D53 206 | D54 207 | ************************************************************* 208 | 209 | ************************************************************* 210 | Generating : Drill Guide 211 | File : LED_Controller_4Channels.GG1 212 | 213 | Adding Drill Pair : Bottom Layer-Top Layer 214 | 215 | Adding Layer : Drill Guide 216 | 217 | 218 | Used DCodes : 219 | D53 220 | ************************************************************* 221 | 222 | -------------------------------------------------------------------------------- /PCB_Files/ESP8266-01_4Channels/Project Outputs for LED_Controller_4Channels/LED_Controller_4Channels.RUL: -------------------------------------------------------------------------------- 1 | DRC Rules Export File for PCB: E:\_DATEN\Alexander\Projekte\_Projektordner\HueBridge\diyHue\Lights\PCB_Files\ESP8266-01_4Channels\LED_Controller_4Channels.PcbDoc 2 | RuleKind=ShortCircuit|RuleName=ShortCircuit|Scope=Board|Allowed=0 3 | RuleKind=Clearance|RuleName=Clearance|Scope=Board|Minimum=10.00 4 | RuleKind=Width|RuleName=Width|Scope=Board|Minimum=10.00 5 | RuleKind=SolderMaskExpansion|RuleName=SolderMaskExpansion|Scope=Board|Minimum=4.00 6 | -------------------------------------------------------------------------------- /PCB_Files/ESP8266-01_4Channels/Project Outputs for LED_Controller_4Channels/LED_Controller_4Channels.apr: -------------------------------------------------------------------------------- 1 | D10 RECTANGULAR 55.118 43.307 0.000 FLASH 0.000 2 | D11 RECTANGULAR 43.307 106.299 0.000 FLASH 0.000 3 | D12 RECTANGULAR 421.260 362.205 0.000 FLASH 0.000 4 | D13 RECTANGULAR 55.118 43.307 0.000 FLASH 90.000 5 | D14 ROUNDED 12.000 12.000 0.000 LINE 0.000 6 | D15 ROUNDED 75.000 75.000 0.000 LINE 0.000 7 | D16 ROUNDED 100.000 100.000 0.000 LINE 0.000 8 | D17 ROUNDED 50.000 50.000 0.000 LINE 0.000 9 | D18 ROUNDED 20.000 20.000 0.000 LINE 0.000 10 | D19 ROUNDED 25.000 25.000 0.000 LINE 0.000 11 | D20 ROUNDED 60.000 60.000 0.000 FLASH 0.000 12 | D21 RECTANGULAR 60.000 60.000 0.000 FLASH 180.000 13 | D22 RECTANGULAR 59.055 59.055 0.000 FLASH 0.000 14 | D23 ROUNDED 59.055 59.055 0.000 FLASH 0.000 15 | D24 ROUNDED 47.244 47.244 0.000 FLASH 0.000 16 | D25 ROUNDED 53.150 53.150 0.000 FLASH 0.000 17 | D26 RECTANGULAR 53.150 53.150 0.000 FLASH 90.000 18 | D27 RECTANGULAR 62.992 62.992 0.000 FLASH 0.000 19 | D28 ROUNDED 62.992 62.992 0.000 FLASH 0.000 20 | D29 RECTANGULAR 53.150 53.150 0.000 FLASH 180.000 21 | D30 ROUNDED 50.000 50.000 0.000 FLASH 0.000 22 | D31 ROUNDED 25.000 25.000 0.000 FLASH 0.000 23 | D32 ROUNDED 9.842 9.842 0.000 LINE 0.000 24 | D33 ROUNDED 7.874 7.874 0.000 LINE 0.000 25 | D34 ROUNDED 0.500 0.500 0.000 LINE 0.000 26 | D35 ROUNDED 10.000 10.000 0.000 LINE 0.000 27 | D36 ROUNDED 5.905 5.905 0.000 LINE 0.000 28 | D37 RECTANGULAR 63.118 51.307 0.000 FLASH 0.000 29 | D38 RECTANGULAR 51.307 114.299 0.000 FLASH 0.000 30 | D39 RECTANGULAR 429.260 370.205 0.000 FLASH 0.000 31 | D40 RECTANGULAR 63.118 51.307 0.000 FLASH 90.000 32 | D41 ROUNDED 68.000 68.000 0.000 FLASH 0.000 33 | D42 RECTANGULAR 68.000 68.000 0.000 FLASH 180.000 34 | D43 RECTANGULAR 67.055 67.055 0.000 FLASH 0.000 35 | D44 ROUNDED 67.055 67.055 0.000 FLASH 0.000 36 | D45 ROUNDED 55.244 55.244 0.000 FLASH 0.000 37 | D46 ROUNDED 61.150 61.150 0.000 FLASH 0.000 38 | D47 RECTANGULAR 61.150 61.150 0.000 FLASH 90.000 39 | D48 RECTANGULAR 70.992 70.992 0.000 FLASH 0.000 40 | D49 ROUNDED 70.992 70.992 0.000 FLASH 0.000 41 | D50 RECTANGULAR 61.150 61.150 0.000 FLASH 180.000 42 | D51 ROUNDED 58.000 58.000 0.000 FLASH 0.000 43 | D52 ROUNDED 33.000 33.000 0.000 FLASH 0.000 44 | D53 ROUNDED 5.000 5.000 0.000 LINE 0.000 45 | D54 ROUNDED 6.667 6.667 0.000 LINE 0.000 46 | -------------------------------------------------------------------------------- /PCB_Files/ESP8266-01_4Channels/Project Outputs for LED_Controller_4Channels/Status Report.Txt: -------------------------------------------------------------------------------- 1 | Output: Gerber Files 2 | Type : Gerber 3 | From : Variant [[No Variations]] of Project [LED_Controller_4Channels.PrjPcb] 4 | Generated File[LED_Controller_4Channels.GTL] 5 | Generated File[LED_Controller_4Channels.GBL] 6 | Generated File[LED_Controller_4Channels.GTO] 7 | Generated File[LED_Controller_4Channels.GTP] 8 | Generated File[LED_Controller_4Channels.GTS] 9 | Generated File[LED_Controller_4Channels.GBS] 10 | Generated File[LED_Controller_4Channels.GBP] 11 | Generated File[LED_Controller_4Channels.GBO] 12 | Generated File[LED_Controller_4Channels.GD1] 13 | Generated File[LED_Controller_4Channels.GG1] 14 | Generated File[LED_Controller_4Channels.RUL] 15 | Generated File[LED_Controller_4Channels.EXTREP] 16 | Generated File[LED_Controller_4Channels.REP] 17 | 18 | 19 | Files Generated : 13 20 | Documents Printed : 0 21 | 22 | Finished Output Generation At 19:24:17 On 17.10.2017 23 | -------------------------------------------------------------------------------- /PCB_Files/ESP8266-01_4Channels/__Previews/LED_Controller_4Channels.PcbDocPreview: -------------------------------------------------------------------------------- 1 | [Preview] 2 | LargeImageOriginalSize=272000 3 | LargeImageWidth=500 4 | LargeImageHeight=136 5 | LargeImage=78DAEDDC316A1B411480E13D8A4B1DC207D049740EBB37489D1A432055AA7486409A0537C6A40AA432AAD40443CAD4EB4565B0792F663C9E1D7F63FE56D66877DFB7D50CC3340C924E5D24FEA669AAD6906852B5DFBAC57ADDDB47BF66AFBA87CD7089E7E2B97DF15CE239CF79CE3DFBE2B9C4739EF39C7B3CE7B9C473F19CE73C37C3259EAB733FC47389E73C17CFC57389E73CE7B9C47389E73CE7B978CE7389E7E2B9782EF19CE7E2B9782EF19CE73C97782EF19CE73C17CF792EF15C3C17CF259E3FFF577565E683D5D6E295DE2B335CE2B9C573F15CE239CF2D9E8BE712CF79CE7389E712CF2D9E4B66B8C4738BE7E2B9C4739E5B3C17CF259EF39CE712CF259E5B3C975EF07C95E8F23A6E3DC4653E67B58ADB5CE6CACCF4EB4DA29BB852DF47AD795EF13B792757A59CFFD7C1F9853CE7B9782E9EF390E73CE739CF792E9E8BE73C17CF792E9E8BE73C17CF259E8BE73C17CF251EF29CE73CE739CFC573F19CE7E608CF792E9E8BE73C17CF5D37F15C6681F4DF9E577DDFE3B9982F9E4B3C9778CE7389E73C9778CE7389E73C17CFC57389E73C17CFC57389E712CF792EF19CE712CF792EF19CE7E2B9782EF19CE7E2B93AF33C735EDD7A93CB3329E7C3496F59BCD8CB739E8BE73C17CFC5739E8BE712CF79CE73F19CE712CF79CE73F19CE7E239CF79CE73F19CE7E2B978CE73F15CE239CF792E9EF35CE239CF792E9EF35C3CE7B9F3E1A4563CAFFA7C2632C71AABBA9ECC17CF259E8BE73CE7B9C4739E8BE73CE7B9C4739EF39CE73CE7B9C4739EF39CE7E2B9C473F19CE73C9778CE73F19CE73C9778CE739EF39CE73C9778CE739EF35C3C977AF15C929C1529F15C12CF259EF35C12CF259EF35C12CF259E4B12CF259E4BE2B9C4739E4BE2B9C4739E4BE2B9C47349E2B9D4BEE75D9F652589E712CF792E89E712CF792EF15CE2B9782EF15CE2B9CC5E89E712CF792E89E712CF792EF15CE2B9782EF15CE2B9CC5E89E712CF792E89E752239E7FF4D9E39DA650159F905E9FFB6EDE91CD7089E73CE739CF792EF19CE73CE739CF792EF19CE7E239CF792EF19CE73CE739CFCD7089E73CE739CF792EF19CE73CE739CF792EF19CE7E239CF792EF19CE73CE739CF792E391FEE0D3A4BB4FD1DB73FC47D39FC0DDBFFBC0FFB747C8CFBF12BECCFBCB74C99FD7F4E546AFFFB797F510F170F6199753E3F6B51DBBBB8ABDBB862BFCFDCF63885659E8F52F7C7BF99E112CF79CE739EF35CE2B978CE739EF35CE239CF79CE739EF35CE239CF79CE739E9BDF12CF79CE739EF35CE2B978CE739EF35CE239CF79CE739EF35CE239CF79CE739EF35C6ADBF3A59EEB56EA73C6715C5C25AF7FE67E5CE2FE732B7E5E7BBFFECE879378CE739EF39CE712CF79CE739EF39CE712CF79CE739EF39CE712CF79CE739EF39CE712CF79CE739EF35CE239CF79CE739EF35CE239CF79CE739EF35CE239CF79CE739EF35C5A8EE7A5CC6BB19A9E6FBF0E6135E779F65E2BF55B7F9BFF67D4EEFB2E6C899EA5F67EB70B1BC7FB643C9778CE739EF39CE73C9778CE739EF39CE73C9778CE739EF39CE712CF79CE739EF39CE712CF79CE739EF39CE712CF79CE739EF39CE712CF79CE739EF35CE239CF79CE739EF35CE2795F9ED73C676E89E7C395BC1F4B5DB3CCF76EED6CC49A7B5FC2D96F3C9778CE739EF39CE712CF79CE739EF39CE712CF79CE739EF39CE712CF79CE739EF39CE712CF79CE739EF35CE239CF79CE739EF35CE239CF79CE739EF35CE239CF79CE739EF35C6ADBF39ECF751B24D5CF0C9778CE7389E712CF79CE7389E712CF792E89E712CF792EC90C9778CE7389E712CF79CE7389E712CF792E89E712CF792E89E712CF792EF15CE239CF792EF15CE239CF25F15CE239CF259D7A02A9863076 6 | MediumImageOriginalSize=68000 7 | MediumImageWidth=250 8 | MediumImageHeight=68 9 | MediumImage=78DAEDDDBF4AC34000C0E13C8A631FC207E893F439EC2EB45B1741707272130497804B1127C1499C5C4470748E4511BC3F483C9AD8A45FE4B769AF4DEEEB705C62553555A57FEF28F3D334CD9FAB323503A8EAB07D19EBD7F3CB18E79C732ECE39E75C9C0FCCFD58E29C73CE39E79C73CE3917E79C73AE7E9C171DB939319683EDF218E39C73CEC539E79C8B73CE3917E79CEF94F349D4FC246D5A85E57E6732099BCDD37273FD64167599D6E675C6E3BCE0B57C9717D534E38E73CEC539E79C73CE39E79C733E2CE7DA2DE745DF7B9C73CF39E7E25C9C8B7371CE39E7E29CF3BD711EAFDB4F6769E692F5F6E1156FCFE39C73CE39E7DC9CE19C73CE39E79C73EB709E1B35EEE746652BD6D98FFB5DB6CF18E79C732ECE39E75C9C73CEB938E79C7375EF5C628C73712ECEC5B93817E7EAD7B9FF8326CE39E79C7371CE39E7E29C73CEC5B938D7F69DFFF7FC19EB3EBAB13DA38A31CE39E75C9C73CEB938E79C7371CE39E71ACE7AFB41A6C54BD8EA29EDFCE93D68757F9B74FAFC1A76F790F4B6192F2E1EFF2C539BF1579B317FF678F498141F879BEB16B758871DDFA4B5793F8BE72629BE1E6DCEC7778C71CE39E7E29C73CEC539E79C6BB8F7A5963C93AAAEEBCE6AF3F973E7B1ABF1F347785DFBFEFCD6E138E79C7371CE39E7E29C73CEC539E79CAB9FFD707DDF83DAC6F9E2A20A2A9DE7A57BC9AE367FFBB3E5F532A92B67F1D89FE3AF9741757D9B8973CE39E79C73CE39E79C73CE39E75C9CB75FD3EB731D6E5BF77EE55EBBCFBD885DAFB971CE39E79C8B73CE3917E79C732ECE39E75CBB7B5F6AE97E38797EBB3817E7E25C9C73CEB938E79C7371CE39E7FAEA037B8F749D 10 | SmallImageOriginalSize=24600 11 | SmallImageWidth=150 12 | SmallImageHeight=41 13 | SmallImage=78DAEDDCBF4AC3401CC0F17B14C73C840FD027C973B4BB906C590A8293939B20B8045C4A71129C4AA72E22383A9F69E2DDFDA2A9A7F963FE7D23DFA5A4479A7CC4EB25A894566A262DC58FD6FAC79448779CAA59D331DA3E86D278B8C215AE26E9AA8DEBDB57B8C215AE7085AB71BAF26EF2FCF5B58DD0993B67B8C25577AE02D16A5DB4502EF3DAB120280A572E79FDD6A1E8B6E8D4BEFDB9F2EC3FD2DF3DAD8711AE70852B5C8DCDD5DCE6575EFB139883E20A57B8C215AEBA7165E6618BD035BE758669CEAF4E27972F70852B5CE10A57DC1F1CE6FDC1525E29CD8CE10A57B89A9E2BE2BE33AE70852B5CCDCDD5DC9ECFC315AE70852B5CE1EA3F9EFB1EC73A44F3FB8BB8C215AE86FF77F0ECB3E8C595EC5DD7FB775BF2B4CDBB3CBCBA1E9F6D6FD9382633D695A86AAC241BC3B45BEE6C723BCFCEC5B168E3BA78707D1B332B3A689BFCBC5F8FCF842B5CE10A57B89ACFBA68D5FBE46B699AD6AAEAB8E467A83B9678B2C1D6F4B8985FE10A57B8C2D5B4D6199AAE879E7215DD289BEFFAF9BEF3DF65FB98E2FB38AFAE85D2589B382F4DB7225CE10A57B8C215AE7E3F176B637EF5973570F39E36D652EACEA970852B5C0D735DB4EDFFD3C9F30CB8C215AE70852B5C4DA70FE0858115 14 | 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Lights 2 | 3 | Create your own diyHue compatible Lights! 4 | 5 | Steps to Follow: 6 | - Select the correct Sketch according to your Harware Setup (e.g. WS2812b) 7 | - Upload Firmware to Microcontroller 8 | - Easy Web Tool https://install.diyhue.org (Use Chrome or Edge Browser) 9 | - or 10 | - with Arduino IDE (No Changes to Code) 11 | - Connect Hardware (LEDs) and Powersupply 12 | - Connect to ESP8266 WiFi (e.g. search for new WiFi on Smartphone) --> `"Hue rgb strip"` 13 | - Browse `192.168.4.1` --> Connect ESP8266 to your local WiFi 14 | - Check and browse local IP of ESP8266 15 | - Configure Light from WEB UI (Number of Emulated Lights, Total Number of connected LEDs) 16 | - Rename you new diyHue Light 17 | 18 | - HUE APP: Add new created diyHue Light within APP by searching for new Devices. 19 | 20 | 21 | More Information is available in our [documentation](https://diyhue.readthedocs.io/en/latest/lights/diylights.html) 22 | 23 | www.diyhue.org 24 | 49 | -------------------------------------------------------------------------------- /catalog.json: -------------------------------------------------------------------------------- 1 | { 2 | "cct":{ 3 | "version":2.0, 4 | "filename":"Generic_CCT_Light.bin" 5 | }, 6 | "rgb-cct":{ 7 | "version":2.0, 8 | "filename":"Generic_RGB_CCT_Light.bin" 9 | }, 10 | "rgbw":{ 11 | "version":2.0, 12 | "filename":"Generic_RGBW_Light.bin" 13 | }, 14 | "dimmable":{ 15 | "version":2.0, 16 | "filename":"Generic_Dimmable_Light.bin" 17 | }, 18 | "on_off":{ 19 | "version":2.0, 20 | "filename":"Generic_ON_OFF_Light.bin" 21 | }, 22 | "rgb":{ 23 | "version":3.0, 24 | "filename":"Generic_RGB_Light.bin" 25 | }, 26 | "ws2812_strip":{ 27 | "version":3.1, 28 | "filename":"Generic_WS2812_Strip.bin" 29 | }, 30 | "sk6812_strip":{ 31 | "version":2.0, 32 | "filename":"Generic_SK6812_Strip.bin" 33 | }, 34 | "ws2812_gradient":{ 35 | "version":4.0, 36 | "filename":"Gradient_TV_Strip_WS2812.bin" 37 | }, 38 | "SonoffTXT3US1C":{ 39 | "version":2.1, 40 | "filename":"SonoffTXT3US1C.bin" 41 | }, 42 | "SonoffTXT3US2C":{ 43 | "version":2.1, 44 | "filename":"SonoffTXT3US2C.bin" 45 | }, 46 | "SonoffTXT3US3C":{ 47 | "version":2.1, 48 | "filename":"SonoffTXT3US3C.bin" 49 | }, 50 | "gradient-lightstrip":{ 51 | "version":4.0, 52 | "filename": "Hue_Gradient_Lightstrip.bin" 53 | }, 54 | "signe-gradient":{ 55 | "version":4.0, 56 | "filename": "Hue_Signe_Gradient.bin" 57 | }, 58 | "luma-gradient":{ 59 | "version":1.0, 60 | "filename": "luma-gradient.bin" 61 | } 62 | } 63 | --------------------------------------------------------------------------------