AprilNEA/OpenLogi · error

multiple standalone lights match --device

Error message

multiple standalone lights match --device {query}; use a more specific value

What it means

With a `--device` query supplied, if the substring filter matches two or more lights, `select` cannot pick a unique target and throws this error. The message instructs the user to make the query more specific rather than choosing arbitrarily.

Solutions

  1. Lengthen the query so it matches exactly one light (e.g. use more of the serial number).
  2. Use the device identity/serial substring instead of the shared display name.
  3. List devices first to see which candidates the query collides with.

Example fix

// before — ambiguous prefix
$ openlogi light set-brightness 40 --device "litra"
error: multiple standalone lights match --device litra; use a more specific value

// after
$ openlogi light set-brightness 40 --device "9A7C"
Defensive patterns

Strategy: validation

Validate before calling

let q = device_query.to_ascii_lowercase();
let count = devices.iter().filter(|d| {
    d.display_name.to_ascii_lowercase().contains(&q)
        || d.address.identity.to_ascii_lowercase().contains(&q)
}).count();
if count > 1 {
    eprintln!("'{device_query}' is ambiguous ({count} matches); use a serial substring");
}

Prevention

When it happens

Trigger: Passing a `--device` substring that case-insensitively matches the display name or identity of more than one standalone light while running `set_power`, `set_brightness`, or `set_temperature`.

Common situations: Two identical Litra units with near-identical names and a generic query like `--device litra`; a query that is a prefix shared by several serials; a name query that matches both a Glow and a Glow-connected variant.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


AI-assisted analysis of AprilNEA/OpenLogi@e846e6f4b4 (2026-09-13). Data as JSON: /api/errors/356ff980b461829d. Report an issue: GitHub.

Appendix: source

Thrown at crates/openlogi-cli/src/cmd/light.rs:204

            _ => Err(anyhow!(
                "multiple standalone lights found; select one with --device"
            )),
        };
    };
    let query = query.to_ascii_lowercase();
    let mut matches = devices.iter().filter(|device| {
        device.display_name.to_ascii_lowercase().contains(&query)
            || device
                .address
                .identity
                .to_ascii_lowercase()
                .contains(&query)
    });
    let Some(device) = matches.next() else {
        return Err(anyhow!("no standalone light matches --device {query}"));
    };
    if matches.next().is_some() {
        return Err(anyhow!(
            "multiple standalone lights match --device {query}; use a more specific value"
        ));
    }
    Ok(device)
}

#[cfg(test)]
mod tests {
    use super::select;
    use openlogi_core::device::{DeviceKind, RawDeviceAddress, StandaloneDevice};

    fn device(name: &str) -> StandaloneDevice {
        StandaloneDevice {
            address: RawDeviceAddress {
                vendor_id: 0x046d,
                product_id: 0xc900,
                usage_page: 0xff43,
                usage_id: 0x0202,

View on GitHub (pinned to e846e6f4b4)