alexa-skills-kitalexa-smart-home-skill

Can my custom Alexa skill turn another vendor's light on and off?


I would like my custom skill to be able to turn a Wemo or TP-Link switch/outlet on and off. Is there some API in the Alexa Skills Kit that lets me turn home devices on and off, similar to how an Alexa Routine can turn devices on and off?


Solution

  • 1.- When creating the skill, choose the "Smart Home" pre-build model

    2.- Set up the endpoint

    3.- Set up the Account linking so the user can link their TPLink or Wemo account

    4.-Take an Alexa Smart Home skill adapter example as a template https://github.com/awslabs/serverless-application-model/blob/master/examples/apps/alexa-smart-home-skill-adapter/index.js

    5.- Choose Alexa Smart Home as the trigger to your Lambda funcion - assuming you will use AWS as backend

    6.- Make sure the two functions below are implemented:

    function handleDiscovery(request, callback)
    function handleControl(request, callback)
    

    7.- The smart home requests will be implemented using API calls to the TPLink and Wemo cloud services accessed by the Account linking info (step 3)

    Good luck !