{"id":13614084,"url":"https://github.com/sidoh/esp8266_milight_hub","last_synced_at":"2026-01-21T10:41:12.635Z","repository":{"id":43174320,"uuid":"80194529","full_name":"sidoh/esp8266_milight_hub","owner":"sidoh","description":"Replacement for a Milight/LimitlessLED hub hosted on an ESP8266","archived":false,"fork":false,"pushed_at":"2025-02-11T04:37:17.000Z","size":13910,"stargazers_count":971,"open_issues_count":149,"forks_count":225,"subscribers_count":70,"default_branch":"master","last_synced_at":"2025-04-13T18:43:35.699Z","etag":null,"topics":["easybulb","home-automation","limitlessled","milight"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sidoh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2017-01-27T09:20:11.000Z","updated_at":"2025-04-05T03:33:06.000Z","dependencies_parsed_at":"2024-10-17T18:44:54.830Z","dependency_job_id":"f68b6a97-259e-4252-897e-3e7116243a58","html_url":"https://github.com/sidoh/esp8266_milight_hub","commit_stats":null,"previous_names":[],"tags_count":140,"template":false,"template_full_name":null,"purl":"pkg:github/sidoh/esp8266_milight_hub","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidoh%2Fesp8266_milight_hub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidoh%2Fesp8266_milight_hub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidoh%2Fesp8266_milight_hub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidoh%2Fesp8266_milight_hub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sidoh","download_url":"https://codeload.github.com/sidoh/esp8266_milight_hub/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidoh%2Fesp8266_milight_hub/sbom","scorecard":{"id":822605,"data":{"date":"2025-08-11","repo":{"name":"github.com/sidoh/esp8266_milight_hub","commit":"23102c73f7a40ad4308952162a9040f72d6cfc56"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: jobLevel 'contents' permission set to 'write': .github/workflows/release.yaml:107","Warn: no topLevel permission defined: .github/workflows/build.yaml:1","Warn: no topLevel permission defined: .github/workflows/release.yaml:1"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Code-Review","score":2,"reason":"Found 1/4 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yaml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/sidoh/esp8266_milight_hub/build.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yaml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/sidoh/esp8266_milight_hub/build.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yaml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/sidoh/esp8266_milight_hub/build.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yaml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/sidoh/esp8266_milight_hub/release.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yaml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/sidoh/esp8266_milight_hub/release.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yaml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/sidoh/esp8266_milight_hub/release.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yaml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/sidoh/esp8266_milight_hub/release.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yaml:56: update your workflow using https://app.stepsecurity.io/secureworkflow/sidoh/esp8266_milight_hub/release.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yaml:62: update your workflow using https://app.stepsecurity.io/secureworkflow/sidoh/esp8266_milight_hub/release.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yaml:110: update your workflow using https://app.stepsecurity.io/secureworkflow/sidoh/esp8266_milight_hub/release.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yaml:113: update your workflow using https://app.stepsecurity.io/secureworkflow/sidoh/esp8266_milight_hub/release.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yaml:119: update your workflow using https://app.stepsecurity.io/secureworkflow/sidoh/esp8266_milight_hub/release.yaml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/build.yaml:23","Warn: npmCommand not pinned by hash: .github/workflows/build.yaml:29","Warn: npmCommand not pinned by hash: .github/workflows/release.yaml:30","Warn: pipCommand not pinned by hash: .github/workflows/release.yaml:35","Info:   0 out of  11 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   2 pipCommand dependencies pinned","Info:   0 out of   2 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact 1.13.1-beta2 not signed: https://api.github.com/repos/sidoh/esp8266_milight_hub/releases/190124046","Warn: release artifact 1.13.1-beta1 not signed: https://api.github.com/repos/sidoh/esp8266_milight_hub/releases/187135919","Warn: release artifact 1.13.0 not signed: https://api.github.com/repos/sidoh/esp8266_milight_hub/releases/184569109","Warn: release artifact 1.13.0-rc1 not signed: https://api.github.com/repos/sidoh/esp8266_milight_hub/releases/182095348","Warn: release artifact 1.13.0-beta2 not signed: https://api.github.com/repos/sidoh/esp8266_milight_hub/releases/180939284","Warn: release artifact 1.13.1-beta2 does not have provenance: https://api.github.com/repos/sidoh/esp8266_milight_hub/releases/190124046","Warn: release artifact 1.13.1-beta1 does not have provenance: https://api.github.com/repos/sidoh/esp8266_milight_hub/releases/187135919","Warn: release artifact 1.13.0 does not have provenance: https://api.github.com/repos/sidoh/esp8266_milight_hub/releases/184569109","Warn: release artifact 1.13.0-rc1 does not have provenance: https://api.github.com/repos/sidoh/esp8266_milight_hub/releases/182095348","Warn: release artifact 1.13.0-beta2 does not have provenance: https://api.github.com/repos/sidoh/esp8266_milight_hub/releases/180939284"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 29 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"10 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-jr5f-v2jv-69x6","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-67mh-4wv8-2f99","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-4www-5p9h-95mh","Warn: Project is vulnerable to: GHSA-9gqv-wp59-fq42","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T15:57:25.482Z","repository_id":43174320,"created_at":"2025-08-23T15:57:25.482Z","updated_at":"2025-08-23T15:57:25.482Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28631946,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T04:47:28.174Z","status":"ssl_error","status_checked_at":"2026-01-21T04:47:22.943Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["easybulb","home-automation","limitlessled","milight"],"created_at":"2024-08-01T20:00:56.670Z","updated_at":"2026-01-21T10:41:12.607Z","avatar_url":"https://github.com/sidoh.png","language":"C++","funding_links":[],"categories":["DIY"],"sub_categories":["DIY Gateways"],"readme":"# esp8266_milight_hub [![Build Status](https://travis-ci.org/sidoh/esp8266_milight_hub.svg?branch=master)](https://travis-ci.org/sidoh/esp8266_milight_hub) [![License][shield-license]][info-license]\n\nThis is a replacement for a Milight/LimitlessLED remote/gateway hosted on an ESP8266. Leverages [Henryk Plötz's awesome reverse-engineering work](https://hackaday.io/project/5888-reverse-engineering-the-milight-on-air-protocol).\n\n[Milight bulbs](https://www.amazon.com/Mi-light-Dimmable-RGBWW-Spotlight-Smart/dp/B01LPRQ4BK/r) are cheap smart bulbs that are controllable with an undocumented 2.4 GHz protocol. In order to control them, you either need a [remote](https://www.amazon.com/Mi-light-Dimmable-RGBWW-Spotlight-Smart/dp/B01LCSALV6/r?th=1) ($13), which allows you to control them directly, or a [WiFi gateway](http://futlight.com/productlist.aspx?typeid=125) ($30), which allows you to control them with a mobile app or a [UDP protocol](https://github.com/Fantasmos/LimitlessLED-DevAPI).\n\nThis project is a replacement for the wifi gateway.\n\n[This guide](http://blog.christophermullins.com/2017/02/11/milight-wifi-gateway-emulator-on-an-esp8266/) on my blog details setting one of these up.\n\n## Features\n\n* Fully-featured Web UI\n* MQTT support\n* UDP gateway\n* REST API\n* Server-side tracking of device state.\n* Passive listening for intercepted packets from other Milight devices.\n\n## Quick Start\n\n### What you'll need\n\n1. An ESP8266 or ESP32. I used a NodeMCU.\n2. A NRF24L01+ module (~$3 on ebay). Alternatively, you can use a LT8900.\n3. Some way to connect the two (7 female/female dupont cables is probably easiest).\n\n### Wiring Guide\n\nThis project technically supports both NRF24L01 and LT8900 radios, but I recommend using an NRF24.  Both modules are SPI devices and should be connected to the standard SPI pins on the ESP8266. See the below diagram for pin connections.\n\n##### NRF24L01+\n\n[This guide](https://www.mysensors.org/build/connect_radio#nrf24l01+-\u0026-esp8266) details how to connect an NRF24 to an ESP8266. By default GPIO 4 for CE and GPIO 15 for CSN are used, but these can be configured later in the Web UI under Settings -\u003e Hardware.\n\n\u003cimg src=\"https://user-images.githubusercontent.com/40266/47967518-67556f00-e05e-11e8-857d-1173a9da955c.png\" align=\"left\" width=\"32%\" /\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/40266/47967520-691f3280-e05e-11e8-838a-83706df2edb0.png\" align=\"left\" width=\"22%\" /\u003e\n\n_Image source: [MySensors.org](https://mysensors.org)_\n\nNodeMCU (Esp8266) | Esp32        | Radio | Color\n--------- |--------------|----| --\nGND | GND          | GND | Black        \n3V3 | 3V3          | VCC | Red    \nD2 (GPIO4) | D4 (GPIO4)   | CE | Orange \nD8 (GPIO15) | D5 (GPIO5)   | CSN/CS | Yellow \nD5 (GPIO14) | D18 (GPIO18) | SCK | Green \nD7 (GPIO13) | D23 (GPIO23) | MOSI | Blue  \nD6 (GPIO12) | D19 (GPIO19) | MISO | Violet \n\n\n##### LT8900\n\nConnect SPI pins (CE, SCK, MOSI, MISO) to appropriate SPI pins on the ESP8266. With default settings, connect RST to GPIO 0, PKT to GPIO 16, CE to GPIO 4, and CSN to GPIO 15.  Make sure to properly configure these if using non-default pinouts.\n\n### Install firmware\n\n#### ESP8266\n\nIf you have [PlatformIO](http://platformio.org/) set up, you can compile from source and upload with:\n\n```\nplatformio run -e d1_mini --target upload\n```\n\n(make sure to substitute `d1_mini` with the board that you're using.)\n\nAlternatively, you can download a pre-compiled firmware image from the [releases](https://github.com/sidoh/esp8266_milight_hub/releases). This can be used with [`esptool.py`](https://github.com/espressif/esptool):\n\n```\nesptool.py write_flash 0x0 \u003cfirmware_file.bin\u003e\n```\n\nMake sure you read instructions\n\n#### ESP32\n\nFor ESP32, you need to flash both the partition table and the firmware image. The easiest way to do this is with [PlatformIO](http://platformio.org/):\n\n```\nplatformio run -e esp32 --target upload\n```\n\nAfter you've flashed it once, you can update using the web ui or with `esptool.py`:\n\n```\n# \u003e\u003e\u003e FOR ESP32 ONLY \u003c\u003c\u003c\nesptool.py write_flash 0x1000 \u003cfirmware_file.bin\u003e\n```\n\n### Configure WiFi\n\nThis project uses [WiFiManager](https://github.com/tzapu/WiFiManager) to avoid the need to hardcode AP credentials in the firmware.\n\nWhen the ESP powers on, you should be able to see a network named \"ESPXXXXX\", with XXXXX being an identifier for your ESP. Connect to this AP and a window should pop up prompting you to enter WiFi credentials.  If your board has a built-in LED (or you wire up an LED), it will [flash to indicate the status](#led-status).\n\nThe network password is \"**milightHub**\".\n\n#### Get IP Address\n\nBoth mDNS and SSDP are supported.\n\n* OS X - you should be able to navigate to http://milight-hub.local.\n* Windows - you should see a device called \"ESP8266 MiLight Gateway\" show up in your network explorer.\n* Linux users can install [avahi](http://www.avahi.org/) (`sudo apt-get install avahi-daemon` on Ubuntu), and should then be able to navigate to http://milight-hub.local.\n\n### Use it!\n\nThe default hostname is `milight-hub`. If your network supports local DNS, you can navigate to `http://milight-hub` (you may also want to try `http://milight-hub.local` if your client supports mDNS).\n\nThe UI should look like this:\n\n![Web UI](https://github.com/user-attachments/assets/95fc6faa-eb08-48bd-a0ea-caff15bd4857)\n\nAdd devices using the \"+\" button. Use the \"Sniffer\" tab to intercept packets from existing remotes or milight devices if you wish to spoof their device IDs.\n\nMore details on this are [in the wiki](https://github.com/sidoh/esp8266_milight_hub/wiki/Pairing-new-bulbs).\n\n### (Optional) HomeAssistant\n\nSet up HomeAssistant discovery by configuring an MQTT connection with the same broker your HomeAssistant instance is using. If all goes well, lights you create should automatically be discovered by HomeAssistant.\n\n## Supported remotes\n\nThe following remotes can be emulated:\n\nSupport has been added for the following [bulb types](http://futlight.com/productlist.aspx?typeid=101):\n\nModel #|Name|Compatible Bulbs\n-------|-----------|----------------\n|FUT096|RGB/W|\u003col\u003e\u003cli\u003eFUT014\u003c/li\u003e\u003cli\u003eFUT016\u003c/li\u003e\u003cli\u003eFUT103\u003c/li\u003e|\n|FUT005\u003cbr/\u003eFUT006\u003cbr/\u003eFUT007\u003c/li\u003e\u003c/ol\u003e|CCT|\u003col\u003e\u003cli\u003eFUT011\u003c/li\u003e\u003cli\u003eFUT017\u003c/li\u003e\u003cli\u003eFUT019\u003c/li\u003e\u003c/ol\u003e|\n|FUT098|RGB|Most RGB LED Strip Controlers|\n|FUT020|RGB|Some other RGB LED strip controllers|\n|FUT092|RGB/CCT|\u003col\u003e\u003cli\u003eFUT012\u003c/li\u003e\u003cli\u003eFUT013\u003c/li\u003e\u003cli\u003eFUT014\u003c/li\u003e\u003cli\u003eFUT015\u003c/li\u003e\u003cli\u003eFUT103\u003c/li\u003e\u003cli\u003eFUT104\u003c/li\u003e\u003cli\u003eFUT105\u003c/li\u003e\u003cli\u003eMany RGB/CCT LED Strip Controllers\u003c/li\u003e\u003c/ol\u003e|\n|FUT091|CCT v2|Most newer dual white bulbs and controllers|\n|FUT089|8-zone RGB/CCT|Most newer rgb + dual white bulbs and controllers|\n|B05|4-zone RGB/CCT|?|\n\nOther remotes or bulbs, but have not been tested.\n\n\nIf it does not work as expected see [Troubleshooting](https://github.com/sidoh/esp8266_milight_hub/wiki/Troubleshooting).\n\n## Device Aliases\n\nYou can configure aliases or labels for a given _(Device Type, Device ID, Group ID)_ tuple.  For example, you might want to call the RGB+CCT remote with the ID `0x1111` and the Group ID `1` to be called `living_room`.  Aliases are useful in a couple of different ways:\n\n* **In the UI**: These show up as named devices in the UI.\n* **In the REST API**: standard CRUD verbs (`GET`, `PUT`, and `DELETE`) allow you to interact with aliases via the `/gateways/:device_alias` route.\n* **MQTT**: you can configure topics to listen for commands and publish updates/state using aliases rather than IDs.\n* **HomeAssistant**: if you've configured MQTT discovery, aliases that you configure will automatically be discovered by HomeAssistant.\n\n## REST API\n\nGenerated API documentation is available here:\n\n* [latest version](https://sidoh.github.io/esp8266_milight_hub/branches/latest)\n* [all versions](https://sidoh.github.io/esp8266_milight_hub)\n\nAPI documentation is generated from the [OpenAPI spec](docs/openapi.yaml) using redoc.\n\n## MQTT\n\nTo configure your ESP to integrate with MQTT, fill out the following settings:\n\n1. `mqtt_server`- IP or hostname should work. Specify a port with standard syntax (e.g., \"mymqttbroker.com:1884\").\n1. (if necessary) `mqtt_username` and `mqtt_password`\n1. (optional) topic patterns. These come pre-configured with suitable values, but you can customize them if you'd like. These control which topics the device will publish and subscribe to to receive commands and publish updates.\n\n### Topics\n\nThere are a few different types of topics used by the light hub. In most cases, the topics are similar to API routes -- they contain the device identifiers in the topic.\n\nA pattern of the form:\n\n```\nmilight/commands/:device_id/:device_type/:group_id\n```\n\nWill cause the ESP to subscribe to the topic `milight/commands/+/+/+` and interpret the second, third, and fourth tokens as `:device_id`, `:device_type`, and `:group_id`, respectively.\n\nLikewise, a pattern of the form:\n\n```\nmilight/states/:device_id/:device_type/:group_id\n```\n\nwill cause the ESP to publish state updates to the topic (for example) \n\n```\nmilight/states/0x1234/rgb_cct/1\n```\n\nHere's a brief description of supported topics:\n\n1. `mqtt_topic_pattern` - controls the topic that the ESP subscribes to for commands. See the above example.\n1. `mqtt_update_topic_pattern` - controls the topic that the ESP publishes delta updates to. These are a fairly direct translation of the raw RF packets submitted by milight control devices. They might look something like `{\"state\":\"ON\"}`.\n1. `mqtt_state_topic_pattern` - controls the topic that the ESP publishes full state updates to. These are JSON objects that contain the entirety of the current state for a given device. The hub tracks state internally and applies updates as they come in.\n1. `mqtt_client_status_topic` - nothing fancy for this one! It controls the topic that the ESP publishes client status updates to (in MQTT lingo, this is where birth and LWT messages are sent). \n\n### Customize state fields\n\nIf you're integrating with a platform that expects specific fields in the state update topic, you can customize which fields are included in the state updates published by the hub. The default is designed to be compatible with HomeAssistant!\n\nThere's a fair amount of duplication in the available fields (for example, `computed_color`, `oh_color`, `hex_color` all control the `color` field in state updates). Sorry this is confusing!\n\n## UDP Gateways\n\nIf for whatever reason you wish to integrate with this hub using the UDP protocol used by the official Milight gateways, you can do that! \n\n1. In the Web UI, navigate to Settings -\u003e UDP\n1. Add a gateway with the \"+\" button.\n1. Configure the remote ID you want to associate with this gateway. If you're wanting to mimic an existing gateway, use the \"Sniffer\" tab while the existing gateway is sending commands to snag its ID.\n1. Choose a UDP port for the gateway -- it shouldn't matter, maybe choose something in the 5000 range.\n1. Choose v5 or v6 based on your integration requirements.\n\nThe UDP protocol is documented [in this handy github archive](https://github.com/BKrajancic/LimitlessLED-DevAPI/). Version 6 has support for the newer RGB+CCT bulbs and also includes response packets, which can theoretically improve reliability. Version 5 has much smaller packets and is probably lower latency.\n\n## Transitions\n\nTransitions between two given states are supported.  Depending on how transition commands are being issued, the duration and smoothness of the transition are both configurable.  There are a few ways to use transitions:\n\n#### RESTful `/transitions` routes\n\nThese routes are fully documented in the [REST API documentation](https://sidoh.github.io/esp8266_milight_hub/branches/latest/#tag/Transitions).\n\n#### `transition` field when issuing commands\n\nWhen you issue a command to a bulb either via REST or MQTT, you can include a `transition` field.  The value of this field specifies the duration of the transition, in seconds (non-integer values are supported).\n\nFor example, the command:\n\n```json\n{\"brightness\":255,\"transition\":60}\n```\n\nwill transition from whatever the current brightness is to `brightness=255` over 60 seconds.\n\n#### Notes on transitions\n\n* espMH's transitions should work seamlessly with [HomeAssistant's transition functionality](https://www.home-assistant.io/components/light/).\n* You can issue commands specifying transitions between many fields at once.  For example:\n  ```json\n  {\"brightness\":255,\"kelvin\":0,\"transition\":10.5}\n  ```\n  will transition from current values for brightness and kelvin to the specified values -- 255 and 0 respectively -- over 10.5 seconds.\n* Color transitions are supported.  Under the hood, this is treated as a transition between current values for r, g, and b to the r, g, b values for the specified color.  Because milight uses hue-sat colors, this might not behave exactly as you'd expect for all colors.\n* You can transition to a given `status` or `state`.  For example,\n  ```json\n  {\"status\":\"ON\",\"transition\":10}\n  ```\n  will turn the bulb on, immediately set the brightness to 0, and then transition to brightness=255 over 10 seconds.  If you specify a brightness value, the transition will stop there instead of 255.\n\n## LED Status\n\nSome ESP boards have a built-in LED, on pin #2.  This LED will flash to indicate the current status of the hub:\n\n* Wifi not configured: Fast flash (on/off once per second).  See [Configure Wifi](#configure-wifi) to configure the hub.\n* Wifi connected and ready: Occasional blips of light (a flicker of light every 1.5 seconds).\n* Packets sending/receiving: Rapid blips of light for brief periods (three rapid flashes).\n* Wifi failed to configure: Solid light.\n\nIn the setup UI, you can turn on \"enable_solid_led\" to change the LED behavior to:\n\n* Wifi connected and ready: Solid LED light\n* Wifi failed to configure: Light off\n\nNote that you must restart the hub to affect the change in \"enable_solid_led\".\n\nYou can configure the LED pin from the web console.  Note that pin means the GPIO number, not the D number ... for example, D1 is actually GPIO5 and therefore its pin 5.  If you specify the pin as a negative number, it will invert the LED signal (the built-in LED on pin 2 (D4) is inverted, so the default is -2).\n\nIf you want to wire up your own LED you can connect it to D1/GPIO5. Put a wire from D1 to one side of a 220 ohm resistor. On the other side, connect it to the positive side (the longer wire) of a 3.3V LED.  Then connect the negative side of the LED (the shorter wire) to ground.  If you use a different voltage LED, or a high current LED, you will need to add a driver circuit.\n\nAnother option is to use an external LED parallel to the (inverted) internal one, this way it will mirror the internal LED without configuring a new LED pin in the UI. To do this connect the (short) GND pin of your LED to D4. The longer one to a 220 ohm resistor and finally the other side of the resistor to a 3V3 pin.\n\n## Development\n\nThis project is developed and built using [PlatformIO](https://platformio.org/).\n\nThe Web UI is [documented here](./web2/README.md).\n\n#### Running tests\n\nOn-board unit tests are available using PlatformIO.  Run unit tests with this command:\n\n```\npio test -e d1_mini\n```\n\nsubstituting `d1_mini` for the environment of your choice.\n\n#### Running integration tests\n\nA remote integration test suite built using rspec is available under [`./test/remote`](test/remote).\n\n## Ready-Made Hub\n\nh4nc (h4nc.zigbee(a)gmail.com) created a PCB and 3D-printable case for espMH.  He's offering ready-made versions.  Please get in touch with him at the aforementioned email address for further information.\n\nFind more information from the [espmh_pcb](https://github.com/sidoh/espmh_pcb) repository.\n\n## Acknowledgements\n\n* @WoodsterDK added support for LT8900 radios.\n* @cmidgley contributed many substantial features to the 1.7 release.\n\n[info-license]:   https://github.com/sidoh/esp8266_milight_hub/blob/master/LICENSE\n[shield-license]: https://img.shields.io/badge/license-MIT-blue.svg\n\n## Donating\n\nIf the project brings you happiness or utility, it's more than enough for me to hear those words.\n\nIf you're feeling especially generous, and are open to a charitable donation, that'd make me very happy.  Here are some whose mission I support (in no particular order):\n\n* [Water.org](https://www.water.org)\n* [Brain \u0026 Behavior Research Foundation](https://www.bbrfoundation.org/)\n* [Electronic Frontier Foundation](https://www.eff.org/)\n* [Girls Who Code](https://girlswhocode.com/)\n* [San Francisco Animal Care \u0026 Control](http://www.sfanimalcare.org/make-a-donation/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsidoh%2Fesp8266_milight_hub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsidoh%2Fesp8266_milight_hub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsidoh%2Fesp8266_milight_hub/lists"}