AlexxIT/go2rtc · error

wyze: API error

Error message

wyze: API error: %s - %s

What it means

The Wyze device-list API returned a result code other than '1' (success), so the request logically failed despite an HTTP response. The code and message from the API are surfaced; raised in GetCameraList (also via GetCamera).

Solutions

  1. Re-login to refresh the access token
  2. Check the specific code/message and correct request parameters
  3. Retry on transient service errors
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at pkg/wyze/cloud.go:191 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of AlexxIT/go2rtc@c245815e75 (2026-09-07). Data as JSON: /api/errors/0d66982852a6624e. Report an issue: GitHub.

Appendix: source

Thrown at pkg/wyze/cloud.go:191

	resp, err := c.client.Do(req)
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()

	body, err := io.ReadAll(resp.Body)
	if err != nil {
		return nil, err
	}

	var result deviceListResponse
	if err := json.Unmarshal(body, &result); err != nil {
		return nil, fmt.Errorf("wyze: failed to parse device list: %w", err)
	}

	if result.Code != "1" {
		return nil, fmt.Errorf("wyze: API error: %s - %s", result.Code, result.Msg)
	}

	c.cameras = nil
	for _, dev := range result.Data.DeviceList {
		if dev.ProductType != "Camera" {
			continue
		}
		if dev.DeviceParams.IP == "" {
			continue // skip cameras without IP (gwell protocol)
		}

		c.cameras = append(c.cameras, &Camera{
			MAC:          dev.MAC,
			P2PID:        dev.DeviceParams.P2PID,
			ENR:          dev.ENR,
			IP:           dev.DeviceParams.IP,
			Nickname:     dev.Nickname,
			ProductModel: dev.ProductModel,

View on GitHub (pinned to c245815e75)