Does anyone know or have a working example of what the lambda function would look like to grab onto a twitter feed and read back the most recent tweet? I got my garage door responding to Alexa but would like to be able to ask what the status of the door is. I am thinking I could have my Arduino post to twitter what the status of the door is, and then set up a skill so alexa could pull the most recent twitter post stating the status of the door. This would be a very minimal skill but I am looking for some degree of notification/status from the Echo. If anyone is interested, I can do a you tube video of what I have going so far.
That seems a rather convoluted approach. But twitter's API is documented here:
https://dev.twitter.com/rest/public I didn't use this for Tweet Poll. I used IBM's Insights for Twitter. But was interested in tweets in the aggregate, not individually. If I were you, I would rethink your approach. Unless you are just doing this for self amusement as a hobbyist, this won't scale.
Thanks, I agree that the twitter feed probably wont do what I was hoping for. I am looking for a way to add a status update so that if the echo is asked it will respond with the state of the door. Currently I don't have that. I can make the garage go up and down, but the echo has no idea what the current state of the door is. The twitter idea was mostly cause I have seen examples of the arduino yun posting to twitter. I have seen some videos on SONOS where a the echo reads the metadata of a sudo file, while a Rest url is sent to the Sonos to play the song. Maybe something like that could be done. Edit the metadata of a file to reflect the status of the door. Or maybe there is an easier solution out there? This is all just a hobby approach with me :) I appreciate your input. thanks
Your problem is an interesting one - you essentially have something that is entirely stateless, except you need to store exactly 1 bit of data (a boolean representing open or closed). With that use case, spinning up a data store of any kind is going to be massive overkill. Using Twitter as a boolean datastore is kind of crazy, but admittedly it probably meets your use case pretty well. I'm sort of curious, though - your lambda is calling out to the arduino controlling your garage door, right? Is there not a way for you to query the arduino for the door's state?
Hello Galactoise! There are ways to query the door's state, but none that I have found so that Alexa can query it. If the amazon echo adds the ability to review previous events on a google calendar I think I might be able to get this hammered out pretty easy. Maybe I could log the status to dynamodb and have a lambda function that would parse the most recent entry, but I am not sure how that would look or if dynamodb is even something the alexa skills can use. Be one good example if they did. take care!