Before proceeding with account authorization, make sure that you have:
- The Google Home app (GHA) installed on your mobile device, set up with at least one home (structure) on your Google Account.
- At least one of these supported device types for the sample app
in the home:
- Color Temperature Light (on and off, brightness)
- Contact Sensor (boolean state)
- Dimmable Light (on and off, brightness)
- Extended Color Light (on and off, brightness)
- Generic Switch
- Occupancy Sensor (occupancy sensing)
- On/Off Light (on and off, brightness)
- On/Off Light Switch
- On/Off Plug-in Unit (on and off)
- On/Off Sensor
- Two devices for testing the sample automation.
Prior to using devices through the Home APIs, they must controllable from GHA.
Run the sample app
Run the sample app. The first time running it, you'll be asked to allow access to a home on your Google Account. This grants the sample app permission to access and control the structures and devices in that home.
The app's default permission behavior will differ depending on whether or not the app was registered on the Google Home Developer Console.
If an app is not registered in the Developer Console, it will be in an unverified state. This is recommended for testing use of the Home APIs:
Only users registered as test users in the OAuth console can grant permissions for the app. There is a limit of 100 test users for an unverified app.
An unverified app will have access to devices of any device types that are supported by OAuth for the Home APIs (the list of device types in the Developer Console). All devices in a structure will be granted.
If an app is registered in the Developer Console and has been approved for access to one or more device types, and brand verification has been completed for OAuth, it will be in a verified state. This state is required for launching an app to production:
- Test user limits no longer apply. Any user can grant permission to the app.
- The user can only grant permission to the device types that were approved in the Developer Console.
Tap Allow access to a chosen home:
- If there are any homes connected to your account, choose a home to
grant permission to. If no devices are
found in the chosen home, you can either:
- Tap Allow access to another home to select a different home.
- Set up a device of your choosing
in that home using the Google Home app (GHA). Remember, only
these device types have support for control in this sample app:
- Color Temperature Light (on and off, brightness)
- Contact Sensor (boolean state)
- Dimmable Light (on and off, brightness)
- Extended Color Light (on and off, brightness)
- Generic Switch
- Occupancy Sensor (occupancy sensing)
- On/Off Light (on and off, brightness)
- On/Off Light Switch
- On/Off Plug-in Unit (on and off)
- On/Off Sensor
- If there are no homes connected to your account, you will get a screen
with a message of There are no structures for the selected account.
- Swipe back to return to the main sample app view.
- To set up a home, use the GHA. Then attempt to grant permission to the sample app again.
The permissions flow can be revisited at any time by selecting the profile icon
in the upper-right of any sample app screen.Once you have successfully granted permission to a home that features devices, you will be taken to the devices view. You can control the devices and observe their state changes through the sample app.