I've been looking at the Amazon Alexa devices and wondering if they could be used with a WiFi enabled Espruino device.
The Alexa works with AC switch devices but uses a offsite server as part of the link.
Is there a way to have Alexa send a message to an Espruino device though my local router?
A different idea uses the speech to text available in Android to send the message.
I've used online service to find the IP address of my router, but how do you get a message to a specific device connected to the router (a sub-address)?
I don't have code for doing this on an Espruino, but what I do at my place is have a Raspberry Pi running this code:
The clock call is (as you might be able to guess) a call that goes straight to an Espruino based device without much of an API. The hardware is so twitchy on that thing that I'm afraid to dig around in there to connect to board and upload new code.
Note that the pong part of it (used to control my pingpong lights, and set them to one of 100 specific scenes, telling it the scene number as if it was the brightness of a Hue lightbulb) doesn't quite work currently.
Whole thing generally works well.
Thanks DrAzzy. It looks like it uses a local router based address. Is that correct?
I've done some digging and came up with this possible solution;
It makes use of Google IFTTT and a local tunnel
IFTTT is used to connect the Echo (Google IFTTT) it’s a Google product and goes beyond Amazon products
To expose the server code to the Internet they used a tunnel
The code for tunnel
It looks like @DrAzzy's hub uses the fauxmo library to fake WeMo devices. Looking at the code, it uses UDP so would be tricky to emulate on an Espruino (at the moment) - but having a Pi as a server is what I do too, and works pretty well.
I'm not sure IFTTT is actually a Google thing? Anyway it looks like IFTTT has good support on Alexa and Assistant, and you can use the 'maker' endpoint to send an HTTP request.
The issue is getting that in to your house - hence the tunnel. Often you IP address will change every so often (mine does), so it gets even more painful. If you have access to a server where you can put up some code to act as a relay between Alexa and your home, that'd really be the way forward...
I think the local tunnel and IFTTT approach is madness; in fact avoiding the use of anything that required an outside service other than Alexa itself (which doesn't require a hole in the firewall, since it initiates the connections) was a key design requirement for me...
You're communicating between a device in your house, the Echo, and another device in your house.... And you're going to go outside the house, then make a call back in from the outside internet through a hole you've poked in your firewall?!
Thanks @DrAzzy @Gordon. It looks like the PI is the way to go.
One question remains about the URL or IP address that Echo uses to touch the PI.
will get your router's web IP address.
How to you get the router to send an Echo message on to the PI?
Do you use the DNS to do this when the PI boots?
Use a service like this:
This runs as a unix daemon, and updates your chosen dns name with the current up address of your pi. You choose a sub-domain off the main domains they offer, and they is what you register with other services.
Don't worry about formatting, just type in the text and we'll take care of making sense of it. We will auto-convert links, and if you put asterisks around words we will make them bold.
For a full reference visit the Markdown syntax.
© Espruino, powered by microcosm.
Report a problem