Google Assistant Home Control Actions – Introduction
During Google I/O 2017, Google launched its’ Assistant voice-enabled AI platform for iPhone. Google also released more Google Actions developer tools, including a console to configure “Home control” actions. Until now, developers like us had to fill out a form and wait for people from the Google Home Control Actions team enable a development skill.
Google Home Control actions functionally serve the same purpose as Amazon Alexa Smart Home skills – allowing users to control their smart devices, such as plugs, lights, and thermostats with voice. Much like Alexa, Google supports account linking with OAuth. Google Home Control action, also sends one of the predefined intents. Just like with Alexa Smarthome, Home Control does not support custom utterances.
Coding for processing Google actions may be hosted on Google Cloud, or anywhere else. Commands are sent as HTTP requests. Essentially, Home Control actions processing software for Google Cloud is a custom Express.JS application middleware. Our client decided to host the development code on Google Cloud and the production version on AWS Lambda. To move our Google Cloud project to AWS Lambda hosting, we used an existing piece of software – AWS Serverless Express.
Your wrapper AWS Lambda code might look like: 'use strict';
Home Control actions API comes down to three (3) intents: SYNC – called when an account is linked using OAuth, QUERY to read the state of the devices and EXECUTE to perform control commands on behalf of the users. The SYNC intent is roughly a functional equivalent of Alexa Smart Home DISCOVERY. Unlike Alexa Smarthome API version 2, invoking different control intents depending on the desired action, Google Home control has only one control intent with specific action requests being passed in the payload, like "command": "action.devices.commands.OnOff". The device capabilities are called traits in Google terminology, for example, to support power control, devices must have action.devices.traits.OnOff.