Skip to content

Extend the coverage of features in use #5444

Description

@netmindz

Is your feature request related to a problem? Please describe.
Currently, the WLED usage telemetry only reports if the 2D feature (matrix mode) is enabled. This provides a narrow view of real-world setups and leaves us blind to broader user configuration patterns (e.g. are people using relays, usermods, Hue, IR, ESP-NOW, or certain types of LED buses?).

Describe the solution you'd like
Extend usage reporting to include a wider set of configuration fields. The telemetry should not report user actions, runtime metrics, or sensitive information—only static or rarely-changing configuration that can help guide development. Telemetry should use boolean and human-readable string values, not bitmasks or raw IDs, to avoid any need for server-side mapping or interpretation.

Proposed fields to include (non-exhaustive):

  • Bus types in use (e.g. "digital", "pwm", "network")
  • List of enabled usermods by canonical name (as seen in config keys)
  • Hardware integrations:
    • Hue bridge enabled
    • MQTT enabled
    • Alexa enabled
    • Relay output configured
    • IR remote type (as mapped string, e.g. "24-key")
    • ESP-NOW enabled (base and per-remote count)
    • E1.31 receive/send
    • Realtime/Hyperion UDP receive
    • NTP/time enabled
    • I²C/SPI/ethernet configured
    • Number of physical buttons
  • Key matrix and multi-bus attributes (isMatrix, matrixWidth/Height, bus count)
  • Feature flags as booleans (autoSegments, nightlightEnabled, CCT/whitebalance, gamma correction, etc)
  • All fields are reported as boolean, string, or number (never as bitmask or raw ID)

Describe alternatives you've considered

  • Keeping only raw 2D/matrix telemetry (insufficient for project planning)
  • Reporting runtime, user-action, or privacy-sensitive metrics (explicitly out-of-scope)

Additional context
The specific config values and their extraction logic have been carefully mapped to existing /json/info and /json/cfg API structures. See the accompanying design proposal for the precise field list, type mappings, and JS snippets for extraction. This approach minimizes firmware changes, leverages existing JSON output, and adheres to user privacy by explicit exclusion of live/actionable/personal data.

Activity

  1. added
    configuration
    on Mar 25, 2026
  2. added theissue type on Mar 25, 2026
  3. netmindz commented on Mar 25, 2026

    @netmindz
    MemberAuthor

    Implementation Notes

    Approach

    Two fetches are needed: the existing /json/info (already fetched during upgrade reporting) plus one additional fetch to /json/cfg. All fields are reported as booleans, human-readable strings, or plain numbers — never bitmasks or raw numeric IDs.


    Fields from /json/info (first fetch)

    chip:         infoData.arch                          // e.g. "esp32", "esp8266"
    ledCount:     infoData.leds.count                    // total LED count
    isMatrix:     !!(infoData.leds?.matrix)              // 2D matrix configured
    matrixWidth:  infoData.leds?.matrix?.w               // only when isMatrix
    matrixHeight: infoData.leds?.matrix?.h               // only when isMatrix
    hasRGBW:      !!(infoData.leds?.lc & 0x02)           // any RGBW bus
    hasCCT:       !!(infoData.leds?.lc & 0x04)           // any CCT bus
    ablEnabled:   infoData.leds?.maxpwr > 0              // power limiting configured
    usermodIds:   infoData.um ?? []                      // numeric IDs as fallback only

    Fields from /json/cfg (second fetch)

    LED hardware

    busCount:              cfg.hw?.led?.ins?.length
    busTypes:              (cfg.hw?.led?.ins ?? []).map(b => busTypeToString(b.type))
    cctFromRgb:            cfg.hw?.led?.cr              // CCT derived from RGB
    whiteBalanceCorrection: cfg.hw?.led?.cct            // auto white balance on
    gammaCorrection:       cfg.light?.gc?.col > 1.0     // colour gamma active
    autoSegments:          cfg.light?.aseg              // auto-create segments per bus
    nightlightEnabled:     (cfg.light?.nl?.mode ?? 0) > 0

    Peripherals

    relayConfigured:   (cfg.hw?.relay?.pin ?? -1) >= 0
    irRemoteType:      // mapped string — see IR type table below; omit if not configured
    buttonCount:       (cfg.hw?.btn?.ins ?? []).filter(b => b.type !== 0).length
    i2cConfigured:     (cfg.hw?.if?.['i2c-pin']?.[0] ?? -1) >= 0
    spiConfigured:     (cfg.hw?.if?.['spi-pin']?.[0] ?? -1) >= 0
    ethernetEnabled:   (cfg.eth?.type ?? 0) > 0

    Integrations

    hueEnabled:        cfg.if?.hue?.en ?? false
    mqttEnabled:       cfg.if?.mqtt?.en ?? false
    alexaEnabled:      cfg.if?.va?.alexa ?? false
    ntpEnabled:        cfg.if?.ntp?.en ?? false
    realtimeReceive:   cfg.if?.live?.en ?? false
    e131Multicast:     cfg.if?.live?.mc ?? false
    wledSyncSend:      cfg.if?.sync?.send?.en ?? false
    wledSyncReceive:   !!(cfg.if?.sync?.recv?.bri || cfg.if?.sync?.recv?.col || cfg.if?.sync?.recv?.fx)
    espNowEnabled:     cfg.nw?.espnow ?? false
    espNowSync:        cfg.if?.sync?.espnow ?? false
    espNowRemoteCount: Array.isArray(cfg.nw?.linked_remote)
                         ? cfg.nw.linked_remote.length
                         : (cfg.nw?.linked_remote ? 1 : 0)

    Usermods

    usermods: Object.keys(cfg.um ?? {})
    // e.g. ["Temperature", "4LineDisplay", "Rotary-Encoder", "AudioReactive"]
    // These are the canonical _name strings each usermod registers itself with in addToConfig()
    // Preferred over info.um[] numeric IDs as they are self-describing

    Bus type string mapping

    function busTypeToString(t) {
      if (t === 0)                       return "none";
      if (t === 40)                      return "on-off";
      if (t >= 16 && t <= 39)            return "digital";      // WS2812, SK6812, etc.
      if (t >= 41 && t <= 47)            return "pwm";          // analog RGB/CCT/single
      if (t >= 48 && t <= 63)            return "digital-spi";  // APA102, WS2801, etc.
      if (t >= 64 && t <= 71)            return "hub75";        // HUB75 matrix panels
      if (t >= 80 && t <= 95)            return "network";      // DDP, E1.31, ArtNet
      return "unknown";
    }

    IR remote type string mapping

    const IR_TYPES = {
      0: null,           // not configured — omit field entirely
      1: "3-key",
      2: "24-key",
      3: "24-key-v2",
      4: "40-key",
      5: "44-key",
      6: "21-key",
      7: "6-key",
      8: "9-key",
      9: "json-remote",
    };
    const irRemoteType = IR_TYPES[cfg.hw?.ir?.type ?? 0];
    // include in payload only if irRemoteType !== null

    Combined fetch pattern

    Promise.all([
      fetch(getURL('/json/info')).then(r => r.json()),
      fetch(getURL('/json/cfg')).then(r => r.json())
    ])
    .then(([infoData, cfg]) => {
      const upgradeData = {
        // existing fields
        deviceId:        infoData.deviceId,
        version:         infoData.ver || '',
        previousVersion: oldVersion || '',
        chip:            infoData.arch || '',
        ledCount:        infoData.leds?.count ?? 0,
        flashSize:       infoData.flash,
        psramSize:       infoData.psrSz,
    
        // LED hardware
        busCount:              cfg.hw?.led?.ins?.length ?? 1,
        busTypes:              (cfg.hw?.led?.ins ?? []).map(b => busTypeToString(b.type)),
        isMatrix:              !!(infoData.leds?.matrix),
        matrixWidth:           infoData.leds?.matrix?.w,
        matrixHeight:          infoData.leds?.matrix?.h,
        hasRGBW:               !!(infoData.leds?.lc & 0x02),
        hasCCT:                !!(infoData.leds?.lc & 0x04),
        ablEnabled:            (infoData.leds?.maxpwr ?? 0) > 0,
        cctFromRgb:            cfg.hw?.led?.cr ?? false,
        whiteBalanceCorrection: cfg.hw?.led?.cct ?? false,
        gammaCorrection:       (cfg.light?.gc?.col ?? 1.0) > 1.0,
        autoSegments:          cfg.light?.aseg ?? false,
        nightlightEnabled:     (cfg.light?.nl?.mode ?? 0) > 0,
    
        // peripherals
        relayConfigured:   (cfg.hw?.relay?.pin ?? -1) >= 0,
        buttonCount:       (cfg.hw?.btn?.ins ?? []).filter(b => b.type !== 0).length,
        i2cConfigured:     (cfg.hw?.if?.['i2c-pin']?.[0] ?? -1) >= 0,
        spiConfigured:     (cfg.hw?.if?.['spi-pin']?.[0] ?? -1) >= 0,
        ethernetEnabled:   (cfg.eth?.type ?? 0) > 0,
    
        // integrations
        hueEnabled:        cfg.if?.hue?.en ?? false,
        mqttEnabled:       cfg.if?.mqtt?.en ?? false,
        alexaEnabled:      cfg.if?.va?.alexa ?? false,
        ntpEnabled:        cfg.if?.ntp?.en ?? false,
        realtimeReceive:   cfg.if?.live?.en ?? false,
        e131Multicast:     cfg.if?.live?.mc ?? false,
        wledSyncSend:      cfg.if?.sync?.send?.en ?? false,
        wledSyncReceive:   !!(cfg.if?.sync?.recv?.bri || cfg.if?.sync?.recv?.col || cfg.if?.sync?.recv?.fx),
        espNowEnabled:     cfg.nw?.espnow ?? false,
        espNowSync:        cfg.if?.sync?.espnow ?? false,
        espNowRemoteCount: Array.isArray(cfg.nw?.linked_remote)
                             ? cfg.nw.linked_remote.length
                             : (cfg.nw?.linked_remote ? 1 : 0),
    
        // usermods
        usermods:    Object.keys(cfg.um ?? {}),
        usermodIds:  infoData.um ?? [],
      };
    
      // IR remote — only include if configured
      const irType = IR_TYPES[cfg.hw?.ir?.type ?? 0];
      if (irType) upgradeData.irRemoteType = irType;
    
      return fetch('https://usage.wled.me/api/usage/upgrade', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify(upgradeData)
      });
    });

    Explicitly excluded fields

    Field Reason
    info.opt Bitmask — all meaningful flags decoded above as booleans
    info.leds.lc (raw) Bitmask — decoded into hasRGBW / hasCCT
    cfg.hw.led.ins[].type (raw) Integer — mapped to string via busTypeToString()
    cfg.hw.ir.type (raw) Integer — mapped to string via IR type table
    info.um[] (raw) Integer IDs — superseded by Object.keys(cfg.um)
    info.freeheap, info.pwr, info.fps, info.uptime Runtime state, not configuration
    cfg.def.bri, cfg.def.on Boot defaults — user preference territory
    cfg.if.sync.recv.grp, send.grp Sync group bitmasks
    cfg.if.live.dmx.* DMX mode is an integer enum, very niche
    Colours, effects, presets, brightness User actions, not configuration
  4. DedeHai commented on Mar 25, 2026

    @DedeHai
    Collaborator

    why offload the whole encoding into firmware for something that goes from device to device (database)? if the goal is to get info from config why not load up that cfg.json, strip out any parameters that are not hardware related and just send that json?

  5. netmindz commented on Mar 25, 2026

    @netmindz
    MemberAuthor

    Yeah I don't think we will actually go for all of the above, I'm going to strip back the list a bit.

    I wouldn't want to risk accidentally getting sensitive data if the user added things in their own fork, it also gives greater clarity of what data is being sent

    It will be gzipped so won't be quite as big in the firmware

  6. netmindz commented on Mar 30, 2026

    @netmindz
    MemberAuthor

    Also add file system size and usage

  7. changed the title [-]Proposal: Comprehensive, Privacy-Respecting Usage/Configuration Telemetry (Config Reporting)[/-] [+]Extend the coverage of features in use[/+] on Apr 3, 2026
  8. DedeHai commented on Apr 11, 2026

    @DedeHai
    Collaborator

    I still think the decoding for IR and bus types should be done on server side and just pass the "magic number". It is a bit less maintainable but these types are not likely to change as they need to stay backwards compatible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature Requestconfiguration

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions