Amazon Echo to Raspberry Pi
Asked Answered
I

2

9

How can we direct a Amazon Echo intent to a private/internal https endpoint? Like a raspberry pi running nodeJS.

  1. Using an "Echo Proxy" still requires to have the service accessible from internet (More on Echo Proxy: https://www.reddit.com/r/amazonecho/comments/3blkax/alexa_api_proxy_java/ )
  2. Using "HUE Bridge Emulator" will help you fork the Alexa request to a private(internal only) https server. However, this setup limits usage of Alexa intents to "Turn on" or "Turn off" (and set dim level etc). (More on HUE Bridge Emulator: https://github.com/armzilla/amazon-echo-ha-bridge )

I would love to hear feedback on how can we work around this problem.

EDIT: I now have a stable, working setup of my Pi controlled by Amazon Echo. And this is how it is configured:

  1. Setup AWS Lambda to handle incoming intents from Echo
  2. On Lambda, map a "ACTION KEYWORD" for each intent/slot
  3. On a matching intent/slot, post the ACTION KEYWORD to PubNub channel
  4. Setup my Pi to SUBSCRIBE to PubNub channel for new messages
  5. If Pi receives a matching ACTION KEYWORD on the channel, it triggers a function/script
  6. This function/script in turn has the complete execution logic (example: Open garage door)

I'd love to hear feedback on this method and leaving the question open for others to post simpler/better way to achieve this

Individualist answered 2/6, 2016 at 6:59 Comment(2)
Thanks for your edit. As far as I understand this still requires an external provider (PubNub) Is there really no way to send commands directly from the Echo to a device in the local internal network?Bushtit
There's one way that I have not tried myself yet, but should work. There's a Hue emulator here: home-assistant.io/components/emulated_hue You could have alexa send commands to this emulator and trigger custom actions from there.Individualist
C
0

Another way is to use a service like dataplicity.com. This gives you a url to access your Pi. I use it with Node-RED to have multiple endpoints that I can access from anywhere for my Alexa Skills as well as my chatbots.

Cavalla answered 23/11, 2018 at 8:11 Comment(0)
B
0

This is a relatively old question, but if you'd like to use Alexa to send commands to a local accessory and you don't mind a Bluetooth or BLE connection between the Pi and your Echo device, you might want to take a look at Alexa Gadgets Toolkit (AGT): https://developer.amazon.com/en-US/docs/alexa/alexa-gadgets-toolkit/understand-alexa-gadgets-toolkit.html

With AGT you can setup a Raspberry Pi as a gadget, which is a connected accessory, that you can control through custom directives from a custom skill. There is also support for the gadget to send events to the skill but only while the skill is running.

There are samples on GitHub that should help you turn a Raspberry Pi into an Alexa Gadget with minimal effort: https://github.com/alexa/Alexa-Gadgets-Raspberry-Pi-Samples

You might want to follow this tutorial: https://github.com/alexa/Alexa-Gadgets-Raspberry-Pi-Samples/tree/master/src/examples/color_cycler that has bi-directional communication capabilities between a gadget and a custom skill.

Break answered 23/11, 2020 at 7:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.