Device Actions Overview

With the Google Assistant SDK, you can embed the Google Assistant into your own device, making it function similarly to a Google Home. However, your device may have unique hardware capabilities that Google Home does not have: for example, it may have a unique LED display with customizable brightness and color settings.

Device Actions are a set of tools and APIs that allow you to extend what the Assistant can do, in the devices you develop, to take full potential of their hardware capabilities.

Built-in Device Actions

Google has created a wide range of common Built-in Device Actions for everyday products, including lights, appliances, and cameras. With these actions, you harness the power of the Google Assistant's natural language processing to control your device. For example, a device with a light can be turned on in different ways:

  • Ok Google, turn on the light.
  • Hey Google, turn my light on.
  • Ok Google, turn on my living room light.

Of course, you can create your own device that responds to commands for many Smart Home traits like:

  • Ok Google, set the brightness to 50%.
  • Hey Google, set the temperature to 98 degrees.

Custom Device Actions

You can also create Custom Device Actions for your own unique hardware. For these actions, you define the grammar and commands:

  • Ok Google, blink my light 5 times.
  • Hey Google, move left.

Learn more about incorporating these actions using the Library or Service.

How it works

The device has the Google Assistant SDK installed on it along with credentials for accessing the Google Assistant Service. The device sends out the spoken request (Turn on.) and asks the service to turn on the device's onboard LED. The device also sends its model and device instance identifiers so the service can determine how to best respond in context to the request.

The service uses Automatic Speech Recognition (ASR) to determine what words were spoken by the user, Natural Language Processing (NLP) to analyze and understand the meaning of the request from these words, and device matching to provide context for the request. This context is important because it defines the actions the device supports and how these actions should be fulfilled.

The service then responds with text that is spoken back to the user (Sure.) along with the device-specific command. The device knows how to handle this command: it turns on its LED!

Device Actions LED Example

Get started

The SDK lets you prototype devices quickly by embedding the Google Assistant into your device and then letting you add unique functionality with Device actions. You can prototype your device using the Python library, or in other platforms and programming languages using the service. Can't decide which one to use? Take a look at the Compatibility and feature support table to see the differences.