Skip to content

Add WiFi-only Matter (CHIP) usermod for WLED-MM#351

Draft
Copilot wants to merge 3 commits intomdevfrom
copilot/add-wifi-only-matter-support
Draft

Add WiFi-only Matter (CHIP) usermod for WLED-MM#351
Copilot wants to merge 3 commits intomdevfrom
copilot/add-wifi-only-matter-support

Conversation

Copy link

Copilot AI commented Mar 27, 2026

WLED-MM has no Matter smart-home protocol support. Existing Matter implementations assume BLE for commissioning, which adds ~60–100KB RAM overhead and is impractical on constrained ESP32 builds. This adds Matter support using WiFi-only commissioning (Soft-AP/mDNS), bypassing BLE entirely.

Changes

  • New usermod (usermods/usermod_v2_matter/): Exposes WLED as a Matter Extended Color Light (0x010D) with On/Off, Level Control, and Color Control (HSV + CT) clusters. Bridges Matter attribute callbacks to WLED's col[]/bri state via colorUpdated(CALL_MODE_DIRECT_CHANGE). Bidirectional sync — WLED UI/API/preset changes push back to the Matter fabric every 250ms.
  • Thread safety: Matter SDK callbacks run on the Matter task; pending state is transferred via volatile flags and consumed in the Arduino loop() context.
  • Registration: USERMOD_ID_MATTER (95) in const.h, conditional include/registration in usermods_list.cpp behind #ifdef USERMOD_MATTER.
  • Build environment: [env:esp32s3_matter_wifi] in platformio.ini with -D USERMOD_MATTER -D CONFIG_BT_ENABLED=0 -D CONFIG_RENDEZVOUS_MODE_WIFI=1. Requires ESP-IDF v5.1+ with the esp_matter component.

Color mapping

Matter hue (0–254)  →  WLED hue (0–65535):  wledHue = matterHue * 65535 / 254
Matter sat (0–254)  →  WLED sat (0–255):    wledSat = matterSat * 255 / 254
Matter CT (mireds)  →  colorCTtoRGB()
WLED RGB → Matter:     standard RGB→HSV with output clamped to 0–254

Zero impact on existing builds — all Matter code is behind #ifdef USERMOD_MATTER.


⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with Raycast.

Copilot AI and others added 2 commits March 27, 2026 07:31
- New usermod: usermods/usermod_v2_matter/usermod_v2_matter.h
  Exposes WLED as a Matter Extended Color Light with On/Off,
  Level Control, and Color Control clusters. WiFi-only
  commissioning (no BLE required).
- Register usermod in wled00/usermods_list.cpp
- Add USERMOD_ID_MATTER (95) in wled00/const.h
- Add esp32s3_matter_wifi build environment in platformio.ini
- Add readme documentation for the usermod

Agent-Logs-Url: https://github.com/MoonModules/WLED-MM/sessions/8fdc84b5-d880-40fc-9352-e684ff247509

Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
…fy brightness comment

Agent-Logs-Url: https://github.com/MoonModules/WLED-MM/sessions/8fdc84b5-d880-40fc-9352-e684ff247509

Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
Copilot AI changed the title [WIP] Add WiFi-only Matter integration for WLED without BLE Add WiFi-only Matter (CHIP) usermod for WLED-MM Mar 27, 2026
Copilot AI requested a review from netmindz March 27, 2026 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants