Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for Amazon Smart Plug #2154

Merged
merged 2 commits into from
Dec 30, 2023

Conversation

alams154
Copy link
Contributor

This feature allows the user to control Amazon Smart Plugs from the Alexa Media Player integration via switches in Home Assistant.

The feature is valuable since these devices cannot be added to Home Assistant and require complex workarounds. For example, one implementation requires the use of various plugins used in conjunction (VoiceMonkey for routine triggers, Node-RED for state management and HTTP request methods, and Emulated Hue for state synchronization).

@alandtse
Copy link
Owner

Thanks. As a note this will be added after we raised minimum version to 2024.1.b0 so when I merge it you won't see it until you've updated.

@alams154
Copy link
Contributor Author

Sounds good, thanks for all the hard work!

@alandtse alandtse merged commit 4bc31a3 into alandtse:dev Dec 30, 2023
1 check passed
@jvcsw
Copy link

jvcsw commented Jan 4, 2024

Thanks, but how it works?

@alams154
Copy link
Contributor Author

alams154 commented Jan 4, 2024

Thanks, but how it works?

image

Make sure you have "Include devices connected via Echo" enabled. If your Amazon Smart Plug is correctly setup with your Amazon account on the Alexa app, the plug should automatically be discovered as a switch. It will show up as a switch entity under the integration.

image

@jvcsw
Copy link

jvcsw commented Jan 5, 2024

ok, thanks

@saberstop
Copy link

Hello, awesome work! At this point is the state of the plug expected to be working? I find that I am able to control the smart plug, but it won't actually update the state in Home Assistant if I use something other than HA like Alexa to turn on/off the plug. Thanks!

@alams154
Copy link
Contributor Author

alams154 commented Jan 6, 2024

Yep, I noticed that yesterday that the state wasn’t working. I have some ideas on how to fix that which I’ll try implementing tomorrow. I’m pretty new to Home Assistant development so I’m learning as I go. I think the same problem exists with lights added by Alexa Media Player too, which is where I got my implementation from.

I think the main thing is the entity is missing an update/async_update function. Depending on how the AlexaApy and Alexa handles state changes it might have a decent amount of delay in state changes.

I’m basing this off of the Wyze HACS integration which has about a 20 second delay from when you change it in Wyze and when you see the change in Home Assistant.

@IceBotYT
Copy link

I know this is late, but thank you so much for this! I've just had this smart plug lying on my shelf for over a year now so to see it working finally is so satisfying to see. Can't wait to make more automations with it!!

@NonaSuomy
Copy link

does this work with amazon light switches/dimmers as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants