Gracias por tu visita. Esta página solo está disponible en inglés.

Alexa.Networking.ConnectedDevice Interface

Implement the Alexa.Networking.ConnectedDevice capability interface for devices that connect to a home network controller, such as computers and mobile phones. You can use the Alexa.Networking.AccessController interface to schedule access to the network for a connect device. For an overview of the Alexa networking API, see Understand Networking and Wi-Fi Skills.

The endpointId for a device remains the same when the device moves from one logical network to another on the same router. For example, if a device transitions from a 5-GHz to a 2.4-GHz network on the same router, Alexa expects the same endpointId for the device.

Before you test a skill that uses the ConnectedDevice interface, add a device to the network in the Alexa app. For more information, see Overview of Wi-Fi Skills.

For the list of locales that are supported for the ConnectedDevice interface, see List of Capability Interfaces and Supported Locales.

Discovery

You describe endpoints that support Alexa.Networking.ConnectedDevice using the standard discovery mechanism described in Alexa.Discovery.

The friendlyName field is optional for this interface. If the user sets a name for a device in your app, then provide that name in your discover response; otherwise, don't include friendlyName.

For the full list of display categories, see display categories.

For a device connected to a home network, include a relationships object that identifies the endpoint of the home network.

In addition to the usual discovery response fields, for ConnectedDevice include a configuration object that contains the following fields.

Field Description Type Required
firstConnectionTime When the device first connected to the home network. This information helps a user distinguish between devices with the same friendly name, such as when replacing a mobile phone. DateTime No
staticDeviceInformation.
deviceName
The name assigned to the device in the router application. String Yes
staticDeviceInformation.
hostname
The name of the device, as reported by the device itself. Specify `N/A` if the name is not available. String Yes
staticDeviceInformation.
operatingSystem
The operating system of the device. String No
staticDeviceInformation.
brand
The brand name of the device. String No
staticDeviceInformation.
model
The model of the device. String No
staticDeviceInformation.
macAddress
The MAC address of the device. String Yes
staticDeviceInformation.
dhcp4Fingerprint
The DHCP (v4) fingerprint of the device. String No
staticDeviceInformation.
dhcp6Fingerprint
The DHCP (v6) fingerprint of the device. String No

Discover response example

The following example shows a Discover.Response message for a mobile phone endpoint that supports the ConnectedDevice and AccessController interfaces.

{
  "event": {
    "header": {
      "namespace": "Alexa.Discovery",
      "name": "Discover.Response",
      "payloadVersion": "3",
      "messageId": "<message id>"
    },
    "payload": {
      "endpoints": [
        {
          "endpointId": "<unique ID of the endpoint>",
          "manufacturerName": "<the manufacturer name of the endpoint>",
          "description": "<a description that is shown in the Alexa app>",
          "friendlyName": "<the friendly name of the endpoint, optional for this interface>",
          "displayCategories": ["MOBILE_PHONE"],
          "cookie": {},
          "relationships": {
            "isConnectedBy": {
              "endpointId": "<unique ID of the home network endpoint>"
            }
          },
          "capabilities": [
            {
              "type": "AlexaInterface",
              "interface": "Alexa.Networking.ConnectedDevice",
              "version": 3,
              "configuration": {
                "firstConnectionTime": "2018-05-30T08:15Z",
                "staticDeviceInformation": {
                  "deviceName": "Personal cell phone",
                  "hostname": "Pixel XL",
                  "brand": "Google",
                  "model": "Pixel XL",
                  "operatingSystem": "Android 10",
                  "macAddress": "00:09:5B:EC:EE:F2",
                  "dhcpFingerprint": "1,15,3,6,44,46,47,31,33,249,43",
                  "dhcp6Fingerprint": "1,15,3,6,44,46,47,31,33,249,43,252,12"
                }
              }
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa.Networking.AccessController",
              "version": "3",
              "properties": {
                "supported": [
                  {
                    "name": "networkAccess"
                  }
                ],
                "proactivelyReported": true,
                "retrievable": true
              },
              "configuration": {
                "supportsScheduling": true
              }
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa",
              "version": "3"
            }
          ]
        }
      ]
    }
  }
}