An ESPHome custom component that creates a Matter-compatible light controller which forwards all commands to a WLED device via its JSON API.
- π Full RGB colour control
- π‘ Brightness control
- π On/Off control
- π Matter protocol support (via ESPHome)
- π Integrates with existing WLED installations
- π‘ WiFi connectivity
- π Auto-discovery of WLED devices on your network via mDNS
- π¦ Support for multiple WLED devices simultaneously
This custom component allows you to control your WLED LED strips through Matter-compatible home automation systems (like Apple Home, Google Home, Amazon Alexa, etc.) by acting as a bridge. When you control the light through Matter, it sends the corresponding JSON API commands to your WLED device.
Auto-discovery mode uses the native esp-idf mDNS API to find all _wled._tcp services on your network, automatically creating a Matter light for each device found. Discovered devices are tracked and re-scanned every 60 seconds once the network is connected.
π See MATTER.md for detailed information about Matter protocol integration.
- ESPHome 2024.11.0 or later
- ESP32 board (Matter protocol requires ESP32, not ESP8266)
- ESP-IDF framework (required for Matter and native mDNS; not Arduino)
- Existing WLED installation (v0.13.0 or later recommended)
- WiFi network
- Matter-compatible controller (Apple Home, Google Home, Amazon Alexa, Home Assistant, etc.)
git clone https://github.com/netmindz/wled-matter.git
cd wled-matterInstall ESPHome in a Python virtual environment:
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip esphomecp secrets.yaml.example secrets.yamlEdit secrets.yaml with your WiFi credentials.
source .venv/bin/activate
esphome run wled-matter.yamlTo compile only (no upload):
esphome compile wled-matter.yamlThe component is structured as two cooperating pieces:
| Part | Purpose |
|---|---|
wled_matter_light hub |
Auto-discovery via mDNS β finds _wled._tcp devices every 60 s |
light platform wled_matter_light |
Manually configured RGB light forwarded to a specific WLED device |
Both can be used together in the same configuration.
esphome:
name: wled-matter
friendly_name: wled-matter
esp32:
board: esp32-s3-devkitc-1
framework:
type: esp-idf
logger:
api:
encryption:
key: !secret api_key
ota:
- platform: esphome
password: !secret ota_password
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ap:
ssid: "Wled-Matter Fallback Hotspot"
password: !secret fallback_password
captive_portal:
esp32_ble: # Required for Matter commissioning
mdns:
disabled: false # Required for Matter AND WLED discovery
# matter:
# vendor_id: 0xFFF1
# product_id: 0x8001
# device_type: dimmable_light
external_components:
- source:
type: local
path: components
components: [ wled_matter_light ]
# HTTP client used to send commands to WLED devices
http_request:
id: http_request_id
# Auto-discovery hub β scans for _wled._tcp mDNS services every 60 s
wled_matter_light:
enable_discovery: true
discovery_prefix: "WLED"
# Manually configured RGB light forwarded to a specific WLED device
light:
- platform: wled_matter_light
name: "WLED Living Room"
http_request_id: http_request_id
wled_host: "192.168.1.100"
wled_port: 80| Option | Type | Default | Description |
|---|---|---|---|
enable_discovery |
boolean | true |
Enable automatic mDNS discovery of WLED devices |
discovery_prefix |
string | "WLED" |
Prefix added to discovered device names |
| Option | Type | Required | Default | Description |
|---|---|---|---|---|
name |
string | Yes | β | Name of the light in Home Assistant / Matter |
wled_host |
string | Yes | β | IP address or hostname of the WLED device |
wled_port |
int | No | 80 |
Port of the WLED HTTP server |
http_request_id |
id | Yes | β | ID of the http_request: component in your config |
Note: An
http_request:component must be declared in your YAML and itsidpassed to eachwled_matter_lightlight. This is the ESPHome-native HTTP client and works correctly under the esp-idf framework.
- Matter Protocol Layer: The ESP32 runs ESPHome with Matter protocol support, appearing as an RGB light to Matter controllers
- Light Control Interface: ESPHome's light component receives commands (on/off, brightness, colour)
- Translation Layer: The custom component converts light state into WLED JSON API format
- HTTP Communication: Commands are sent via
http_request(ESPHome native, esp-idf compatible) to the WLED device - mDNS Discovery: The hub uses the native esp-idf
mdns_query_ptrAPI to scan for_wled._tcpservices every 60 seconds once WiFi is connected
Flow:
Matter Controller (Apple Home / Google / Alexa / Home Assistant)
β Matter Protocol
ESP32 running ESPHome
β light component
wled_matter_light (write_state)
β HTTP POST /json/state
WLED Device
β
LED Strips
- Endpoint:
POST http://<wled_host>:<wled_port>/json/state - Payload:
{
"on": true,
"bri": 128,
"seg": [{ "col": [[255, 100, 50]] }]
}This is expected behaviour β if no wled_host is configured yet (e.g. waiting for auto-discovery), write_state returns immediately without logging or sending. Commands are only forwarded once a host has been associated with the light.
- Check that the WLED device is reachable:
ping <wled_host> curl http://<wled_host>/json/state
- Check ESPHome logs for
wled_matter_lightandwled_matter_light.hubentries:esphome logs wled-matter.yaml
- Ensure
mdns: disabled: falseis set in your YAML
- Confirm your WLED firmware is v0.13+ (older versions may not advertise
_wled._tcp) - Ensure the ESP32 and WLED devices are on the same network/VLAN
- mDNS does not cross router boundaries by default
- Ensure you are using ESPHome 2024.11.0 or later:
pip install --upgrade esphome
- Confirm
framework: type: esp-idfis set β Arduino framework is not supported - Confirm
external_componentsusestype: local, path: componentsβ not a git URL - Confirm
http_request:is declared in your YAML
- Ensure
esp32_ble:is present in your config (required for commissioning) - Ensure
mdns: disabled: falseis set - Make sure the device is connected to WiFi before attempting to pair
After flashing, the Matter QR code and pairing code will be shown in:
- ESPHome logs during boot
- ESPHome dashboard (when connected)
- Serial monitor output
- Open Home β + β Add Accessory β More options
- Scan the QR code from ESPHome logs
- Open Google Home β + β Set up device β Matter-enabled device
- Scan the QR code
- Settings β Devices & Services β + Add Integration β Matter
- Follow the commissioning wizard
wled-matter/
βββ .github/
β βββ copilot-instructions.md # Copilot guidance (validate with esphome run wled-matter.yaml)
βββ components/
β βββ wled_matter_light/
β βββ __init__.py # Hub component definition (auto-discovery)
β βββ light.py # Light platform definition (manual RGB lights)
β βββ wled_matter_light.h # Light output C++ header
β βββ wled_matter_light.cpp # Light output C++ implementation
β βββ wled_matter_light_hub.h # Discovery hub C++ header
β βββ wled_matter_light_hub.cpp# Discovery hub C++ implementation (native mDNS)
βββ wled-matter.yaml # Main ESPHome configuration
βββ example.yaml # Manual configuration example
βββ example-discovery.yaml # Auto-discovery example
βββ partitions.csv # Custom partition table
βββ secrets.yaml.example # Secrets template
βββ README.md # This file
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE file for details
- Built with ESPHome
- Compatible with WLED
- Uses Matter protocol
- Native mDNS via esp-idf mdns component
For issues and questions:
- Open an issue on GitHub
- ESPHome docs: https://esphome.io/
- WLED docs: https://kno.wled.ge/