{"id":15161634,"url":"https://github.com/dra1ex/esp_led","last_synced_at":"2026-01-31T17:38:41.441Z","repository":{"id":254409109,"uuid":"846447488","full_name":"DrA1ex/esp_led","owner":"DrA1ex","description":"Smart LED","archived":false,"fork":false,"pushed_at":"2025-04-27T18:39:28.000Z","size":491,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-27T19:32:19.432Z","etag":null,"topics":["arduino","esp32","esp8266","led","led-controller","mqtt","rgb-led","smart-home","web-application"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DrA1ex.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-08-23T08:22:30.000Z","updated_at":"2025-04-27T18:39:32.000Z","dependencies_parsed_at":"2024-10-28T15:09:21.639Z","dependency_job_id":"c6948a46-33da-4b7d-b1c0-6bcd1618697e","html_url":"https://github.com/DrA1ex/esp_led","commit_stats":{"total_commits":92,"total_committers":1,"mean_commits":92.0,"dds":0.0,"last_synced_commit":"e1b323c2b74e73ef158d1cbbbae8345613a5e098"},"previous_names":["dra1ex/esp_led"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrA1ex%2Fesp_led","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrA1ex%2Fesp_led/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrA1ex%2Fesp_led/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrA1ex%2Fesp_led/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DrA1ex","download_url":"https://codeload.github.com/DrA1ex/esp_led/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrA1ex%2Fesp_led/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259166965,"owners_count":22815591,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino","esp32","esp8266","led","led-controller","mqtt","rgb-led","smart-home","web-application"],"created_at":"2024-09-27T00:41:25.585Z","updated_at":"2026-01-31T17:38:41.399Z","avatar_url":"https://github.com/DrA1ex.png","language":"C++","readme":"# esp-led\nSmart RGB/CCT/LED Control for ESP32/ESP8266\n\n\nOther: [[RGB LED LAMP](https://github.com/DrA1ex/esp_led_lamp)] [[RELAY](https://github.com/DrA1ex/esp_relay)]\n\n\n\u003ca href=\"https://espressif.github.io/esp-launchpad/?flashConfigURL=https://dra1ex.github.io/esp-launchpad/config.toml\"\u003e\n    \u003cimg alt=\"Try it with ESP Launchpad\" src=\"https://espressif.github.io/esp-launchpad/assets/try_with_launchpad.png\" width=\"180\"\u003e\n\u003c/a\u003e\n\nИнструкция на [русском](/README_RU.MD).\n\n## UI\n\n![image](https://github.com/user-attachments/assets/fa4d4f01-f9f8-494a-b6f1-6a08406da38b)\n\n## Features\n- Support for White, CCT and RGB Lamp (or LED-Strip)\n- Web/Mobile Application (PWA)\n- Integration with any Smart Home Assistant (such as Alise) via MQTT broker\n- Web Hooks\n- MQTT Protocol\n\n## Connection\n\n\u003cimg width=\"800\" alt=\"White Strip\" src=\"https://github.com/user-attachments/assets/793dc957-1312-4eb5-bbee-432d5c9db3fc\"\u003e\n\u003cimg width=\"800\" alt=\"RGB Strip\" src=\"https://github.com/user-attachments/assets/7a4982e1-5233-4a79-b179-5b2e6aeb8790\"\u003e\n\n\nThis is a basic connection scheme. You can use any pin for the connection (just change it in `constants.h`).\n\nTo safeguard your controller, I recommend connecting a 200-ohm resistor between the MOSFET and the controller pin. Additionally, connect the MOSFET's gate to GND using a 10k-ohm resistor to prevent unwanted activation due to induced currents.\n\nFor RGB/CCT connections, the setup is similar, but you will need multiple separate MOSFETs for each color channel.\n\nIf you encounter button interference issues, use a ceramic capacitor of approximately 0.47uF between the button legs. This will create an RC Filter and stabilize the signal.\n\n## Installation\n\n### Web Installer\n\n1. Open the [ESP Launchpad](https://espressif.github.io/esp-launchpad/?flashConfigURL=https://dra1ex.github.io/esp-launchpad/config.toml).\n2. Select **esp-led** and your desired platform.\n\n### Manual Build / OTA\n\n\n1. Install [Platform.IO](https://platformio.org/install):\n2. (Optional) Modify the `credentials.h` file and, if necessary, customize `constants.h`. You can change these parameters later through the Web UI.\n3. Upload filesystem and firmware\n\n**Note:** This repository contains a submodule. Please use the `--recursive` option when cloning.\n\n```bash\ngit clone --recursive https://github.com/DrA1ex/esp_led.git\ncd esp_led\n\n# Make script executable\nchmod +x ./upload_fs.sh\n\n# Specify the platform: esp32-c3 or esp8266\nPLATFORM=esp32-c3\n\n# Set the environment: debug, release, or ota\nENV=release\n\n# For OTA: set your ESP's address\nADDRESS=esp_led.local\n\n# Additional envs if OTA enabled\nif [ \"$ENV\" = \"ota\" ]; then OTA=1 else OTA=0 ADDRESS= fi\n\npio run -t upload -e $PLATFORM-$ENV --upload-port \"$ADDRESS\"\n./upload_fs.sh --upload-port \"$ADDRESS\"\n```\n\n## Web API\n\n| Endpoint             | Method    | Parameters               | Response                                                  | Description                                             |\n|----------------------|-----------|--------------------------|-----------------------------------------------------------|---------------------------------------------------------|\n| `/api/status`        | `GET`     | None                     | `{\"status\": \"ok\", \"value\": number, \"brightness\": number}` | Retrieves the current power and brightness values.      |\n| `/api/power`         | `GET`     | `value` (1 or 0)         | {\"status\": \"ok\"}                                          | Sets the power _state (on/off).                          |\n| `/api/brightness`    | `GET`     | `value` (0-100)          | {\"status\": \"ok\"}                                          | Updates the brightness level.                           |\n| `/api/debug`         | `GET`     | None                     | Plain Text                                                | Provides debugging information.                         |\n| `/api/restart`       | `GET`     | None                     | Plain Text: \"OK\"                                          | Restarts the server and saves configuration.            |\n\n\n## MQTT Protocol\n\n| Topic In *       \t\t\t| Topic Out *          \t\t\t| Type        | Values\t\t                  | Comments                              |\n|---------------------------|-------------------------------|-------------|-------------------------------|---------------------------------------|\n| `MQTT_TOPIC_POWER`\t\t| `MQTT_OUT_TOPIC_POWER` \t\t| `uint8_t`   | 0..1      \t     \t          | Power _state: ON (1) / OFF (0)        |\n| `MQTT_TOPIC_BRIGHTNESS`\t| `MQTT_OUT_TOPIC_BRIGHTNESS` \t| `uint16_t`  | 0.. `PWM_MAX_VALUE`            | Brightness level, can switch to 0..100 (`MQTT_CONVERT_BRIGHTNESS`) \t|\n| `MQTT_TOPIC_COLOR`\t\t| `MQTT_OUT_TOPIC_COLOR` \t\t| `uint32_t`  | 0..0xFFFFFF  \t\t          | Color value (ARGB or RGB format)      |\n| `MQTT_TOPIC_TEMPERATURE`\t| `MQTT_OUT_TOPIC_TEMPERATURE` \t| `uint32_t`  | 0.. `LED_TEMPERATURE_MAX_VALUE`| Temperature value                     |\n| `MQTT_TOPIC_NIGHT_MODE`\t| `MQTT_OUT_TOPIC_NIGHT_MODE` \t| `uint8_t`   | 0..1          \t\t          | Night mode _state: ON (1) / OFF (0)   |\n\n\\* Actual topic values decalred in `constants.h`\n\n\n## Misc\n\n### Configuring a Secure WebSocket Proxy with Nginx\n\nIf you're hosting a Web UI that uses SSL, you'll need to set up a Secure WebSocket (`wss://...`) server instead of the non-secure `ws://` provided by your ESP. Browsers require secure socket connections for WebSocket functionality, so this configuration is essential.\n\nTo achieve this, you can use Nginx as a proxy to create an SSL-enabled WebSocket connection.\n\n#### Step 0: Install Nginx\n\n```sh\napt install nginx\n```\n\n#### Step 1: Create the Nginx Configuration\n\nCreate a file at `/etc/nginx/conf.d/ws.locations` and add the following content:\n\n```nginx\nlocation /w_esp_led/ws {\n    proxy_pass http://\u003cYOUR-ESP-IP-HERE_1\u003e/ws; # Replace with your actual service address\n    proxy_http_version 1.1;\n    proxy_set_header Upgrade $http_upgrade;\n    proxy_set_header Connection keep-alive;\n    proxy_set_header Host $host;\n}\n\n# You can create proxy for multiple hosts\nlocation /w_esp_led_2/ws {\n    proxy_pass http://\u003cYOUR-ESP-IP-HERE_2\u003e/ws; # Replace with your actual service address\n    proxy_http_version 1.1;\n    proxy_set_header Upgrade $http_upgrade;\n    proxy_set_header Connection keep-alive;\n    proxy_set_header Host $host;\n}\n```\n\n#### Step 2: Reload the Nginx Configuration\n\nAfter saving the configuration file, reload Nginx to apply the changes:\n\n```sh\nnginx -s reload\n```\n\n**Note**\nMake sure to replace `\u003cYOUR-ESP-IP-HERE_1\u003e` and `\u003cYOUR-ESP-IP-HERE_2\u003e` with the actual IP addresses of your ESP devices.\n\n#### Step 3: Check result\n\nOpen WebUi in browser https://dra1ex.github.io/esp_led/?host=ADDRESS/w_esp_led\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdra1ex%2Fesp_led","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdra1ex%2Fesp_led","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdra1ex%2Fesp_led/lists"}