Support for Amazon smart plug
I recently bought an Amazon smart plug as a bundle with a new Echo dot. I'm sad to see that I can't add an Amazon smart plug to Home Assistant. I've gone ahead and proxied the requests and here are my findings:
To turn on/off the plug, it makes a PUT request to https://na-api-alexa.amazon.com/api/phoenix/state
with the following data:
{
"controlRequests": [
{
"entityId": "<id for the smart plug in UUID format>",
"entityType": "APPLIANCE",
"parameters": {
"action": "<turnOn or turnOff>"
}
}
}
}
It includes some cookies with the following names:
Cookie names
- `at-main`
- `sess-at-main`
- `session-id`
- `ubid-main`
- `x-main`
- `session-id-time`
- `session-token`
- `csrf`
- `i18n-prefs`
I hope this is enough information! Feel free to let me know if you need more information.