Connect a Wi-Fi Router to Alexa

The following shows an example of how to use the capability interfaces to connect a Wi-Fi router to Alexa.

Capabilities

This example router declares the following capabilities.

Capability Purpose Example utterance

ToggleController "Guest Network"

Allows a customer to turn the guest network of the router on or off. Customers can use any of the friendly names provided in their utterances.

"Turn on guest network on the Wireless Router" "Turn on guest Wi-Fi"

ModeController "Traffic Priority"

This particular router supports a traffic prioritization feature that allows a customer to control which type of traffic to priorize.

"Set the Traffic Priority on the Router to Video Games" "Set the Router to Movies"

EndpointHealth

Enables in-depth reporting of the state of the device to the customer through experiences like the Alexa app.

Not applicable.

Alexa

Contains directives and events related to state and error reporting. Make sure to explicitly include this interface and the supported version in the discovery response.

Not applicable.

Discovery

This example router provides the following AddOrUpdateReport.

{
  "event": {
    "header": {
      "namespace": "Alexa.Discovery",
      "name": "AddOrUpdateReport",
      "payloadVersion": "3",
      "messageId": "00000000-0000-0000-0000-000000000000"
    },
    "payload": {
      "endpoints": [
        {
          "endpointId": "appliance-001",
          "friendlyName": "Wireless Router",
          "description": "Wi-Fi Router by Sample Manufacturer",
          "manufacturerName": "Sample Manufacturer",
          "displayCategories": [
            "OTHER"
          ],
          "cookie": {},
          "capabilities": [
            {
              "type": "AlexaInterface",
              "interface": "Alexa.ToggleController",
              "version": "3",
              "instance": "SampleManufacturer.Router.GuestNetwork",
              "capabilityResources": {
                "friendlyNames": [
                  {
                    "@type": "text",
                    "value": {
                      "text": "Guest Network",
                      "locale": "en-US"
                    }
                  },
                  {
                    "@type": "text",
                    "value": {
                      "text": "Guest Wi-Fi",
                      "locale": "en-US"
                    }
                  }
                ]
              },
              "properties": {
                "proactivelyReported": true,
                "retrievable": true,
                "supported": [
                  {
                    "name": "toggleState"
                  }
                ]
              }
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa.ModeController",
              "version": "3",
              "instance": "SampleManufacturer.Router.Modes",
              "capabilityResources": {
                "friendlyNames": [
                  {
                    "@type": "text",
                    "value": {
                      "text": "Traffic Priority",
                      "locale": "en-US"
                    }
                  }
                ]
              },
              "properties": {
                "supported": [
                  {
                    "name": "mode"
                  }
                ],
                "proactivelyReported": false,
                "retrievable": false
              },
              "configuration": {
                "ordered": false,
                "supportedModes": [
                  {
                    "value": "SampleManufacturer.Router.Normal",
                    "modeResources": {
                      "friendlyNames": [
                        {
                          "@type": "text",
                          "value": {
                            "text": "Normal",
                            "locale": "en-US"
                          }
                        },
                        {
                          "@type": "text",
                          "value": {
                            "text": "Regular",
                            "locale": "en-US"
                          }
                        }
                      ]
                    }
                  },
                  {
                    "value": "SampleManufacturer.Router.Gaming",
                    "modeResources": {
                      "friendlyNames": [
                        {
                          "@type": "text",
                          "value": {
                            "text": "Gaming",
                            "locale": "en-US"
                          }
                        },
                        {
                          "@type": "text",
                          "value": {
                            "text": "Video Games",
                            "locale": "en-US"
                          }
                        }
                      ]
                    }
                  },
                  {
                    "value": "SampleManufacturer.Router.Video",
                    "modeResources": {
                      "friendlyNames": [
                        {
                          "@type": "text",
                          "value": {
                            "text": "Video",
                            "locale": "en-US"
                          }
                        },
                        {
                          "@type": "text",
                          "value": {
                            "text": "Movies",
                            "locale": "en-US"
                          }
                        }
                      ]
                    }
                  }
                ]
              }
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa.EndpointHealth",
              "version": "3",
              "properties": {
                "supported": [
                  {
                    "name": "connectivity"
                  }
                ],
                "proactivelyReported": true,
                "retrievable": true
              }
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa",
              "version": "3"
            }
          ]
        }
      ]
    }
  }
}

For more details on state reporting, see Understand State Reporting for a Smart Home Skill.

If the device has additional capabilities, you can add other capability interfaces.