Background

Deako is one of the leading providers of smart light technology. They offer beautiful, highly functional smart switches. They are modular too – Deako switches and dimmers can be installed as plain-vanilla switches at construction time, then swapped out with smart switches upon move-in. For home builders, it’s the best of both worlds – smart-home enabled houses without the extra expense. The Deako smart switches work with Alexa, Google Assistant, and other home automation platforms.

Deako wanted an automated, continuous and comprehensive way to ensure their smart switches were working correctly. To accomplish this, they put together an innovative solution that leverages Bespoken’s API with their own testing process and APIs. The solution is as high-tech and streamlined as Deako’s lighting.

Testing Flow

The process is straight-forward. Deako configured a number of devices in their office that are dedicated to testing. A simple schedule was then created using AWS CloudWatch Events. On a regular interval, the scheduler:
  • Invokes an AWS Lambda that runs Mocha tests written for Node.js
  • Calls the Bespoken API to interact with Alexa. It will issue commands like: “turn off the hallway lamp” – the names such as hallway lamp correspond to devices that are used for testing.
  • Calls the Deako SmartHome API to confirm the device did what it was supposed to – it’s not enough that Alexa says: “turned off the lamp” – it’s important to confirm the entire workflow as part of an end-to-end test.
  • Send the status of the test to DataDog – the results can be visualized over time, as well as notifications can be easily configured to alert developers if there are issues.
It’s an easy to configure testing flow, one that provides a high-degree of confidence in the system and devices being tested, as well as provides immediate feedback if and when there are issues. Using DataDog provides nice-looking, useful reports. Here is a generic example of how they look:

Even without DataDog, though, just by setting up a regular schedule for executing their tests with CloudWatch, Deako gets a history of the tests as well as notifications when there are errors. Leveraging DataDog just makes it that much better, with improved reporting and alerting – in Deako’s case, the customer support team is subscribed to alerts, so they can respond immediately when there is a problem. This helps keep downtime and outages to an absolute minimum.

We see this workflow, with slight variations commonly in Home Automation. To help developers working with Smart Home skills, we even set-up a sample project that incorporates these best practices. Take a look here:

https://github.com/bespoken-samples/smart-home-skill-testing

It closely follows the case study described here, though we leverage Circle CI for the scheduler as opposed to CloudWatch Events. There are many options for this type of scheduler/continuous integration – we like both Circle and CloudWatch, but feel free to use whichever you are comfortable with.

Andrew Mast, Head of Software at Deako, had this to say about the implementation:

The tools from Bespoken have made things easy. We were able to get setup quickly – we got an initial integration done in less than an hour, and it took less than a week implement what we consider to be best practices for testing our devices. The testing and continuous monitoring has reduced downtime and helped improve quality, as well as help our support team be more responsive when there are outages.

Learn More

To learn more about testing for home automation with Bespoken, check out our sample project here – it’s configured to use an approach similar to what is described above.

And feel free to reach out to our team with any questions – [email protected].

Yours in testing,

John Kelvie