TONI KLOPFENSTEIN: Building a smart home integration
can be complicated.
You need to define exactly what device types and traits you'll
be using, compile the application, and test it.
The Google Home Playground makes it easier
to get started with this process with a GUI
that enables you to quickly prototype your integration.
Let's take a closer look.
E. JOHN FEIG: The Google Home Playground
is a zero code tool for testing out
Google Home integrations with devices
that live in your web browser.
You can click around to create any device that
is supported in our list of supported device types
and traits in the developer documentation
and see how Google interacts with them.
We expect this to help developers
in the early stages of planning and design
to understand what behavior is expected on various Google Home
and Assistant surfaces.
Additionally, it should help your bug filing,
and we'll talk about that later on.
To get started, open up the Google Home app on your phone
and do account linking with the following steps.
Click the plus icon at the top left corner,
select Setup Device works with Google,
Search for the action, Google Home Playground,
select the action, and the home app
will direct you to the sign-in page
and ask for authorization to complete account linking.
Once you complete account linking,
the default virtual devices will show up in the Google Home app
for you to play with.
Now, go to the Google Home Playground in your web browser
and click the Sign in with Google button
at the top right corner to sign in with the account that
matches the account you used in the Google Home app.
After you sign in, the Google Home Playground
will show your virtual devices stored in Home Graph.
The web UI contains three panels from left to right.
First, the Device List shows all of your virtual devices.
You can select a certain virtual device to view its information
as well as create and remove virtual devices via this panel.
The Device Info panel presents the selected virtual devices
information, including basic information, supported traits,
and trait attributes and states.
You can also edit information on the panel.
Finally, the Log Area displays the interaction
between the Google Home Playground and Home Graph.
You can expand the logs and inspect the request
and response payloads for troubleshooting.
On the Device List panel, select the virtual device to view.
The Device Info panel would show its information
in Home Graph categorized into four tabs.
Basic Information displays non-trait specific attributes
of the device, including the device type, ID, and names.
The Trait List is the supported traits of the device.
Attributes show trait-specific attributes of the device.
And finally, States show all the device states.
Besides viewing a virtual device's information,
you can also directly edit its information
stored in Home Graph via the Device Info panel.
In order to modify supported traits,
switch to the Traits tab and click the Edit button.
A panel will pop-up and show the available traits
to add to the device's current supported traits.
Use the arrow buttons in between to add and remove
supported traits of the device.
In order to modify a device's attributes,
switch to either the Basic Information or Attributes tab
and edit the attribute directly.
Once you're done editing, press Enter or move
focus away from the input field and the Google Home Playground
will apply your attribute and update Home Graph.
To modify the device states, switch to the States tab
and edit the state directly.
The Google Home Playground will apply the state change
to Home Graph.
In order to create a new virtual device,
go to the Device List panel and click the plus button
at the bottom.
A panel will pop up and guide you step by step
through the device creation.
You'll be asked to select a device type and input device
name for the new device.
Once you complete the steps, the Google Home Playground
will update the created devices information
and states as the default values into Home Graph.
In order to remove a virtual device, on the Device List
panel again, hover over the device and a trashcan icon
should appear.
Click the trashcan icon.
An alert we'll ask you to confirm the device removal.
Once you confirm to remove a device,
the Google Home Playground will remove the device also
from Home Graph.
Let's talk about the logs.
When you play with virtual devices,
the Google Home Playground automatically
applies the change to Home Graph.
The interactions with Home Graph are
recorded in the logs panel, where you can expand each entry
and inspect the Home Graph API request and response payloads.
The logs are represented as a JSON array.
For each object in that array, you
have three components, A uri, which
is the URL of the home Graph API call;
a request, which is the request body of the Home Graph API
call, see the document for format of each method;
and a response, which is the response body of the Home Graph
API call.
And again, take a look at the documentation
to understand the format of each method.
The Google Home Playground should
help you file better bugs that are easier for us to get fixed.
Set up the devices in the Playground
to match the devices you're having an issue with.
Reproduce the issue, export your Playground file,
file a bug in the public Buganizer for smart home,
attach the Playground file, and provide repro steps,
along with the expected behavior and any other relevant details.
If you're not able to reproduce the issue in the Google Home
Playground, it might be worth taking a second look
at your code.
TONI KLOPFENSTEIN: To start testing your integrations
using the Playground, check out the resources below.
If you have any questions or if you
want to see what everyone else is building, join us on Reddit
or follow us on Twitter.
Thanks for watching.