Skip to content

Instantly share code, notes, and snippets.

@nbogojevic
Created February 25, 2021 22:59
Show Gist options
  • Save nbogojevic/c41862bcc1a487e9e1c38d9510f1f194 to your computer and use it in GitHub Desktop.
Save nbogojevic/c41862bcc1a487e9e1c38d9510f1f194 to your computer and use it in GitHub Desktop.
Remove all Home Assistant devices from Alexa
// Paste in development console
$x('//div[contains(text(), "Home Assistant")]')
.map((innerDiv) => innerDiv.parentNode.parentNode)
.map((parentDiv) => parentDiv.getElementsByTagName("button")[0])
.forEach((button) => {
fetch(
`https://alexa.amazon.fr/api/phoenix/appliance/${encodeURIComponent(button.getAttribute(
"appliance-id"
))}`,
{
method: "DELETE",
}
);
});
@nbogojevic
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment