Skip to main content

Overview

Scans the /24 subnet derived from the server’s api_origin setting and returns all Nest devices found on port 8080. For each device found, it reports whether the device is already configured to point at this server.

Endpoint

POST http://your-server:8082/api/scan-network
No request body needed.

Response

Success (200 OK)

{
  "devices": [
    {
      "ip": "192.168.1.42",
      "device_name": "Nest Thermostat",
      "cloudregisterurl": "http://192.168.1.100:8000",
      "configured": true
    },
    {
      "ip": "192.168.1.55",
      "device_name": "Nest Thermostat",
      "cloudregisterurl": "https://home.nest.com",
      "configured": false
    }
  ],
  "subnet": "192.168.1.0/24"
}

Response Fields

FieldTypeDescription
devicesarrayFound Nest devices
subnetstringThe subnet that was scanned
devices[].ipstringDevice IP address
devices[].device_namestringDevice name as configured on the thermostat
devices[].cloudregisterurlstringCurrent server URL the device is pointed at
devices[].configuredbooleantrue if device is already pointed at this server

Error (400 Bad Request)

{"error": "Cannot derive subnet: api_origin has no hostname"}
{"error": "Cannot resolve 'my-server' to an IP address. Set api_origin to use an IP address instead of a hostname."}

How It Works

The scan:
  1. Derives the subnet from your server’s API_ORIGIN setting (e.g., http://192.168.1.100:8000 → scan 192.168.1.0/24)
  2. Concurrently probes all 254 hosts for a Nest local API on port 8080 (GET /cgi-bin/api/settings)
  3. Returns devices that responded, comparing their cloudregisterurl to your server’s origin
The scan requires API_ORIGIN to be set to an IP address (not a hostname), or the hostname must be DNS-resolvable from the server. If API_ORIGIN uses a domain name that can’t be resolved, the scan will fail with an error.

Typical Workflow

Example

curl -X POST http://your-server:8082/api/scan-network

POST /api/configure-nest

Point a discovered device at this server

POST /api/register

Register a device after configuring it