> Documentation index: https://developers.home.google.com/apis/llms.txt

The Sample App showcases the basic capabilities of device access and control
using the Home APIs for the device types it supports.

Once account authorization is complete and a structure has been selected, the
Sample App loads all local devices found in that structure.

> [!NOTE]
> **Note:** If a structure doesn't already exist, the permission flow lets the user create one without having to use Google Home app (GHA).

If the device is in
a room, it will be listed under that room. The Sample App supports these device
types:

- Color Temperature Light
- Dimmable Light
- Door Lock
- Extended Color Light
- Fan
- Google Border Router
- Google Camera
- Google Doorbell
- Occupancy Sensor
- On/Off Light
- On/Off Plug-in Unit
- Temperature Sensor
- Thermostat
- Window Covering

<br />

## Actions on existing devices and automations

The Sample App consists of two tabs - **Devices** and **Automations**. Each tab
provides information about the structure and lets you perform tasks.

### Devices tab

The **Devices** tab (Figure 1) shows the rooms in the structure
(Bathroom, Den, Office) and the devices for each room, along with the status
of each device. You can also disconnect your device or update permissions by
clicking the
more_horiz icon at the top right of the screen (Figure 2).
![Devices tab of the Home iOS APIs Sample App.](https://developers.home.google.com/static/apis/ios/images/ios-sample-app-device-tab.png) *Figure 1*: Devices tab view ![Device controls of the Home iOS APIs Sample App.](https://developers.home.google.com/static/apis/ios/images/ios-sample-app-disconnect-device.png) *Figure 2*: Disconnect or update permissions

> [!NOTE]
> **Note:** The app subscribes to its devices and will automatically update whenever a device state changes by another app.

### Automations tab

The **Automations** tab (Figure 3) shows a list of all automations for the
structure. Each automation shows its starters and actions. Multiple
starters and actions are supported.

Tap an automation to view its details, as shown in the example in Figure 4.
In this detailed view, you can see the detailed description of the starters,
conditions, and actions.
![Automations tab of the Home iOS APIs Sample App.](https://developers.home.google.com/static/apis/ios/images/ios-sample-app-automations-tab.png) *Figure 3*: Automations tab view ![Detailed view of a selected automation.](https://developers.home.google.com/static/apis/ios/images/ios-sample-app-automation-details-screen.png) *Figure 4*: Detailed automation view

## Create an automation

To create a new automation, tap the **+Add** button from the automations list
view (Figure 3). The next screen will show a list of suggested automations.
Select the automation you want (Figure 5). If nothing auto-populates, then the
structure doesn't contain the sufficient devices needed for automation.
For example, if you would like to turn on the fan and light, the structure
should contain both the fan and light devices, otherwise the automations
won't display.

After selecting your automation, you will see the
*Starters, Conditions and Actions* (Figure 6). Click **Save** to add your
automation (Figure 7).
![Sample app screen for suggested automations](https://developers.home.google.com/static/apis/ios/images/ios-sample-app-automation-suggestions.png) *Figure 5*: Automation suggestions ![Sample app screen of automation.](https://developers.home.google.com/static/apis/ios/images/ios-sample-app-save-automation-screen.png) *Figure 6*: Save automation ![Sample app screen of created automation.](https://developers.home.google.com/static/apis/ios/images/ios-sample-app-automation-created-screen.png) *Figure 7*: Automation created

## Edit an automation

To edit the Automation name and description, from the detailed automation view
(Figure 4), click the settings icon and click **Edit name** (Figure 8). As
shown in Figure 9, edit the name and description and go back once completed
(Figure 8). To save, click the settings icon and then click **Save**.
![Sample app screen for selecting edit name button.](https://developers.home.google.com/static/apis/ios/images/ios-sample-app-select-edit-screen.png) *Figure 8*: Edit automation name ![Sample app screen for editing name and description of automation.](https://developers.home.google.com/static/apis/ios/images/ios-sample-app-edit-automation-name-screen.png) *Figure 9*: Name and description editor

## Delete an Automation

To delete an automation, go to the automation overview (Figure 7). Swipe
left on the automation you want to delete and click the
delete icon (Figure 10).
![Sample app screen for deleting an automation.](https://developers.home.google.com/static/apis/ios/images/ios-sample-app-delete-automation-screen.png) *Figure 10*: Delete an automation

## Generic automation editor

The generic editor lets you select any devices in the structure to use in
starters and actions, with supporting traits as conditions, when creating
automation scripts.

To add a generic automation, tap **Generic Automation** from the Automation
Suggestions screen (Figure 5).

On the next screen, you can edit the name and description of the automation.

### Add starter candidate

To add a starter candidate, tap **Add Starter and Condition** (Figure 11). The
starter candidate screen displays available starters in the structure
(Figure 12). Select one of the starter candidates to continue (Figure 13).
![Generic automation editor screen showing the Add Starter and Condition button](https://developers.home.google.com/static/apis/ios/images/ios-sample-app-generic-editor.png) *Figure 11*: Generic Editor screen ![List of starters candidates.](https://developers.home.google.com/static/apis/ios/images/ios-sample-app-starter.png) *Figure 12*: List of starter candidates ![Starter selection screen displaying available traits for the chosen device](https://developers.home.google.com/static/apis/ios/images/ios-sample-app-select-trait.png) *Figure 13*: Select a starter

> [!NOTE]
> **Note:** Only [`OnOffTrait`](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/OnOffTrait.md.txt) and [`LevelControlTrait`](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/LevelControlTrait.md.txt) are supported for starters (Figure 14 and Figure 15).

Select **Turns on or off** or **Changes brightness** (Figure 14 and
Figure 15) and either toggle on or off or change the brightness. Once you are
done with the configuration, tap **Done** to return to the generic editor
screen. You will see your selected starter on the generic editor screen
(Figure 16).
![Turn lights on or off.](https://developers.home.google.com/static/apis/ios/images/ios-sample-app-on-off-toggle.png) *Figure 14*: Turn the light on or off ![Brightness slider controls for configuring a level control starter](https://developers.home.google.com/static/apis/ios/images/ios-sample-app-value.png) *Figure 15*: Change brightness ![Generic automation editor showing the newly added starter in the list](https://developers.home.google.com/static/apis/ios/images/ios-sample-app-added-starter.png) *Figure 16*: Starter added

### Add action candidate

To add an action candidate, tap **Add Action** (Figure 17). The
**Action Candidates** screen displays available action candidates (Figure 18).
Select one of the action candidates to continue (Figure 19).
![Generic automation editor showing the Add Action button below the starter](https://developers.home.google.com/static/apis/ios/images/ios-sample-app-added-starter.png) *Figure 17*: Add action ![List of action candidates](https://developers.home.google.com/static/apis/ios/images/ios-sample-app-action.png) *Figure 18*: List of action candidates ![Action selection screen displaying supported traits for the chosen device](https://developers.home.google.com/static/apis/ios/images/ios-sample-app-select-action.png) *Figure 19*: Select an action

> [!NOTE]
> **Note:** Only the [`OnOffTrait`](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/OnOffTrait.md.txt) is supported for actions (Figure 20).

![Turn lights on or off](https://developers.home.google.com/static/apis/ios/images/ios-sample-app-no-level-control.png) *Figure 20* : `LevelControlTrait` is not supported for actions

Select **Turns on or off** and choose to have the device turn on or off. Tap
**Done** to return to the generic editor screen (Figure 21). Tap **Save** to
create the automation (Figure 22). Your automation will display on the
automation tab (Figure 23).
![Turn lights on or off](https://developers.home.google.com/static/apis/ios/images/ios-sample-app-action-on-off.png) *Figure 21*: Turn the light on or off ![Added starter and action.](https://developers.home.google.com/static/apis/ios/images/ios-sample-app-save.png) *Figure 22*: Added starter and action ![Automations tab displaying the newly created generic automation](https://developers.home.google.com/static/apis/ios/images/ios-sample-app-saved-generic-automation.png) *Figure 23*: Generic automation created