A Foray into Alexa Skills: Part 1

Karen Go
3 min readJul 1, 2019

--

I am a bit obsessed with my dog. But how could you not be when you wake up to this bundle of floof snuggled in bed each morning?

Despite loving my dog to pieces, it’s hard to keep track of who fed him and when especially when there is more than one person in the house with very different morning schedules. There have been times when Zeus has skipped breakfast entirely 🥺 and several days in a row where he’s eaten an early breakfast plus a hearty brunch an hour or two later 🥳. And, even when I’m the only one feeding him, I can’t remember if I fed him in my sleepy daze that morning or not and as a result, Zeus’ waistline has grown a bit because of it. 👵🏼

I looked into various solutions: a handy “Did You Feed The dog?” tracker (almost 900 reviews!?), divvying up meals (you do breakfast, I do dinner, which quickly fell apart when Zeus is waiting at his bowl in the morning or whenever there is change in schedule), texting each other when either of us feeds Zeus (easy to forget when rushing out of the house), or verbally telling the other while the other is more than half-asleep. Alas, none of these were convenient or reliable enough to work with our lifestyle.

If only there was someone in the house who was always paying attention to when Zeus was fed… but wait, Alexa is *always* listening…(!)

A quick search on Alexa skills showed two Alexa Skills that have been developed, one of which has 200+ reviews and 4 stars (promising!). Looking into the description, the Alexa invocation commands are quite silly: “Alexa, ask the dog about dinner,” “Alexa, ask the dog if he is hungry,” “Alexa, ask the dog if we fed her.”

I’m 99% sure that Alexa isn’t asking the dog. I’m also <100% sure that I can make a custom Alexa skill to suit my needs and where Alexa is smart enough to know that I’m asking it (her?) whether I’ve fed Zeus, not “the dog.”

So, here’s my first foray into Alexa custom skills — part uno!

Building out my use cases:

  • [Priority 0] Users can tell Alexa that they are feeding the dog and Alexa will store this information with a timestamp
  • [P0] Users can ask Alexa what time the dog was last fed and Alexa will respond with the time and day (yesterday/today)
  • [P1] Users can have multiple dogs and each dog can have a profile of what times they need the be fed. (This would be particularly useful for dogs that require medication with their food.)
  • [P1] Alexa can remind the user if a dog has not been fed at their specified time
  • [P2] Alexa can tell the User who last fed the dog
  • [P2] Create different names for “Feeding” sessions, such as medications or the last time the dog got their flea prevention treatment (which I tend to lose track of).

I suppose I’ll need some models in my design. There is the Dog model, which can have many Feedings, and the User model, which can conduct many Feedings. The Feeding model joins the Dog and the User. Dogs will have a name and a schedule (Hash object) and Users will have a name. The Feeding model will have a type (meal, flea prevention, meds, etc.), a timestamp (date/time), and the dog ID and user ID. Alexa documentation also tells me I need an Interaction Model, which I’ll figure out as I go?

At this point, I’ve only skimmed through the table of contents for the Alexa Skills Kit documentation, and with my novice programming skills, I have no idea how I will make this work or if any of this is possible. Stay tuned to see how this journey progresses in my next post.

Are there any other use cases I should consider? What are the different phrases you would use to tell Alexa you’re feeding your dog? Or different ways that you would ask her when you last fed your dog? Comment below!

--

--

Karen Go

Full Stack Software Engineer in Seattle, WA (Rails + React JS)