I have an "Amazon Smart Plug" connected to home WiFi, and it is controllable right now using two mechanisms:
- From my Echo Show device, I can turn the plug on and off using the touchscreen or Alexa voice control.
- Using the Alexa app on mobile devices, I can turn the plug on and off.
I would like to add a third way to turn the plug on and off, and that third mechanism calls a Lambda function.
So, I need an API that allows me to do the appropriate authentication, and then be able to do something like this via Lambda:
- Enumerate the devices connected to my Alexa account.
- Find the device I'm interested in by its friendly name or underlying ID/serial.
- Get the current status of the plug (powered on or powered off).
- If it's off, turn it on; if it's on, turn it off.
Does such an API exist? I know there are similar APIs for LIFX devices and so on, but these are directly connected Amazon Smart Plugs that only integrate with Alexa itself and Echo devices.
I just need a pointer to the relevant API, as there are a lot of APIs out there for things I'm not looking for that seem to obscure the Google results, like the Alexa Skills API which is for designing new capabilities into the voice assistant -- not what I'm going for. I can figure out the code once I find the right API.