Alexa, ask PEI Power for a Summary

About a year ago, when Amazon unleashed the ability for third-party developers to create skills for its Echo speaker devices, the first one I created was a skill that allowed you to ask questions about Prince Edward Island’s electricity load and generation.

But I never took the skill to certification (the review process by which Amazon certifies a skill and makes it available to everyone), and so while I continued to use it myself in “developer mode” on our Echo, nobody else could.

I decided to follow through on the last few bits of the skill development a couple of weeks ago, so that others could benefit. And at the end of last week I received a notification that the skill is now live for all Echo users in the U.S. and Canada.

This means that, if you own an Amazon Echo device, you can now ask it things like this:

  • Alexa, ask PEI Power for a summary
  • Alexa, ask PEI Power about the wind
  • Alexa, ask PEI Power for the load
  • Alexa, ask PEI Power for the peak load in 2014
  • Alexa, ask PEI Power for the peak load in December 2017
  • Alexa, ask PEI Power for the peak load yesterday.

Behind the scenes, this skill looks like this:

{
  "languageModel": {
    "intents": [
      {
        "name": "AMAZON.CancelIntent",
        "samples": []
      },
      {
        "name": "AMAZON.HelpIntent",
        "samples": []
      },
      {
        "name": "AMAZON.StopIntent",
        "samples": []
      },
      {
        "name": "GetLoad",
        "samples": [
          "the load"
        ],
        "slots": []
      },
      {
        "name": "GetPeak",
        "samples": [
          "the peak on {Date}",
          "peak on {Date}",
          "peak {Date}",
          "peak load on {Date}",
          "the peak load on {Date}",
          "highest load on {Date}",
          "maximum load on {Date}",
          "the maximum load on {Date}",
          "high load on {Date}",
          "the high load on {Date}",
          "the highest load on {Date}",
          "the peak load {Date}"
        ],
        "slots": [
          {
            "name": "Date",
            "type": "AMAZON.DATE"
          }
        ]
      },
      {
        "name": "GetSummary",
        "samples": [
          "a summary",
          "the report",
          "a report",
          "an update"
        ],
        "slots": []
      },
      {
        "name": "GetWind",
        "samples": [
          "the wind"
        ],
        "slots": []
      }
    ],
    "invocationName": "p. e. i. power"
  }
}

That’s a JSON representation of the skill on the Amazon end; when an Echo device sends a query, Amazon tries to figure out which “utterance” (like “an update” or “a report” or “the wind”) the user is looking for, sends a request to a PHP script on my server that queries the same load and generation data I scrape from the Province of PEI website for other purposes, and my server then returns a script for the Echo to read back to the user.

It’s fundamentally a pretty simple ecosystem to develop skills for; there are some fiddly bits on the initial setup my skill got kicked back to me several times for seemingly minor inconsistencies like “you called the skill p. e. i. power but your sample utterance used the phrase p.e.i. power,” but I managed to resolve those quickly.

If you have an Echo, please take this skill for a ride and let me know what you think.

Comments