The Surf Checker Amazon Echo Skill

In some ways, I really dislike the Amazon Echo. The shape, the “Alexa” action word, the timer skill are a copy of my “great” plans to start a voice-controlled revolution.  In 2014, six months before the Amazon Echo was released, I had found a few cool DIY voice control projects on the internet.

With much enthusiasm, I upgraded these projects to create ERICA, the Raspberry Pi controlled assistant.  It had a timer to allow you to use it when cooking and of course, it also had a surf report that provides the surf height, and overall condition for any surf spot in Southern California.  I also created a few games for the kids to play with so I was almost famous with my circle of friends.  My second version was going to be made into a coffee can so the speaker, Raspberry Pi, and power supply could be optimally packaged. When the Amazon Echo was released in November of 2014, in the shape of a coffee can, with an ALEXA (not ERICA) action word,  advertising the timer feature ( among other skills) It was as if they were listening to my very thoughts and copying my plans.

Where ERICA was going to be placed… usurped by the Amazon Echo

The only thing the Echo didn’t have when released was a surf report.  Well, they had not copied everything, I reflected with some consolation.  In full disclosure, the multi-microphone approach on the Amazon Echo is great for far-field audio pickups and is far superior to my homegrown solution with a single microphone.    In addition, the Amazon Echo was right on with the idea that voice will be an interface we will use in the future for AI and computer type functions. So it has been close to three years since it was released and there was no way I was going to pay $170 to Amazon for a product they copied from me.  (And others from the internet 🙂 ).  The Amazon DOT , at $50, was a little more palatable, but still, I resisted. My wife’s birthday was coming up, and I like to get her the latest electronics, so the Echo idea came up.  It was with great reluctance that I finally purchased one.  My excuse is that it is for my wife.

Now that my Wife has one, how can we make it better? Getting it to provide my local surf report immediately came to mind.  A little research and a day of programming got it done. This hack describes how I wrote and published the Surf Checker skill for the Amazon Echo.  In this skill I let Alexa give you the surf report for many major spots in Southern California.

To create your own skill, you will need two accounts from the Amazon ecosystem.  The first is an Amazon developer account  to create the Echo Skill and an Amazon web services account to host the source code for the SKILL using a Lambda function. The lambda account is free as long as you monthly usage is below a certain level.

I recommend you use the many youtube videos on the subject of writing an Alexa skill to see the basic steps.  Amazon also has some great step by step resources.

The Lambda function was written in python using an Amazon Alexa Skill template and modifying it to provide a surf report class of objects.  The complete Lambda code is located on Github at AlexaSurfReport .   In addition, the standalone python code is also on Github at SurfReport. This stand alone python code provides the surf report class and will be used for other projects and the testing of advanced features in the future.

One feature that took some time to understand was how to change the Alexa response depending on how many times you interacted in a session.  This is handy so that you can be helpful on the first utterances, but then provide less help later on since the listener as already heard the details.     This was done in the Lambda code with a NumberOfTries variable stored in the session attribute.   When the first response is executed in a session, the session attribute is created.   It is then rewritten each response in the session.     This way you can adjust the response as a function of session tries.

After you go through all the details and steps from Amazon,  you submit the skill for certification.  the goal here is to ensure the skill has some basic quality control.    It took several iterations before mine was certified.

Good luck with your skill.    Check out the Surf Checker and let me know what you think.  I’ll be updating the skill as time permits with even more features.   Leave a note below if you want to be added to my beta user list.