Some capabilities of the Home APIs for
Android
vary depending on the state of network connectivity and the presence of a hub.

Table 1 and Table 2 indicate which use cases work under different conditions for
different types of devices.

- *Local* refers to a situation where a user is running a controller such as Google Home app (GHA) or a third-party app on the same Wi-Fi network as the device (in other words, when they're in their home).
- *Remote* means that the user is either:
  - Running a controller such as GHA or a third-party app on a separate Wi-Fi network (in other words, when they're away from home), or
  - Using Google Home for web.

| Use Case | Matter Device Type || Cloud Device Type ||
| Use Case | Local | Remote | Local | Remote |
| Use Case |
|---|:---:|:---:|:---:|:---:|
| Commission and add device |   |   | n/a | n/a |
| Add device | n/a | n/a |   |   |
| View device state |   |   |   |   |
| Control device |   |   |   |   |
| Create automation with device |   |   |   |   |
| Run automation with device |   |   |   |   |
[*Table 1: Home APIs connectivity capabilities when the hub is ONLINE*]

| Use Case | Matter Device Type || Cloud Device Type ||
| Use Case | Local | Remote | Local | Remote |
| Use Case |
|---|:---:|:---:|:---:|:---:|
| Commission and add device |   |   | n/a | n/a |
| Add device | n/a | n/a |   |   |
| View device state |   |   |   |   |
| Control device |   |   |   |   |
| Create automation with device |   |   |   |   |
| Run automation with device |   |   |   |   |
| Assign device to different room |   |   |   |   |
| Remove device |   |   |   |   |
[*Table 2: Home APIs connectivity capabilities when the hub is OFFLINE*]

## Hubless Mode

This is a mode which lets users onboard and control Matter
devices without a standalone hub. The user needs to have:

- An Android or iOS phone.
- A Wi-Fi network.
- A Matter Wi-Fi device.

With Hubless mode, the user can use a controller such as an Android phone
to:

1. Set up local Wi-Fi devices.
2. Control local Wi-Fi devices.

Hubless Mode is limited to these two actions. If you need to control devices
remotely, use Google Assistant for voice control, interact with
Thread-only devices, or set up automations, you need a
[supported hub](https://developers.home.google.com/apis/android/sdk#supported_hubs).

| Feature | Standalone Hub | Hubless Mode |
|---|:---:|:---:|
| Set up Wi-Fi devices |   |   |
| Local control |   |   |
| Remote control |   |   |
| Automations |   |   |
[*Table: Hub capabilities comparison*]

### Google Home app and Hubless Mode

The GHA has some limitations with regard to Hubless Mode.

Apart from certain cameras, the GHA doesn't support Hubless
commissioning. For all other Matter devices,
GHA requires a
[supported hub](https://developers.home.google.com/apis/android/sdk#supported_hubs) to commission.

Without a supported hub present, the GHA can only control
certain Matter devices. Any other devices appear as offline
to the GHA and can't be controlled using the
GHA.

The following device types can be controlled by the GHA
when a supported hub isn't present:

- [`DoorLockDevice`](https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/DoorLockDevice)
- [`SmokeCOAlarmDevice`](https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/SmokeCOAlarmDevice)

Partner Home API apps have none of these limitations.

See the [Troubleshooting](https://developers.home.google.com/apis/android/connectivity#troubleshooting) section
for ways to address unexpected or unwanted behavior related to hubs.

## Troubleshooting

The following table enumerates how to address issues arising in various
hub-related scenarios:

| Scenario || Expected behavior || Recommended User Action |
| Matter device state | Hub state | Device Control | Automation | Recommended User Action |
|:---:|---|:---:|---|---|
| ONLINE-PEER or ONLINE-REMOTE | ONLINE (only one valid state) |   |   | No remediation action required. |
| ONLINE-DIRECT | No hub |   |   | Add a hub to the structure and ensure it's on the Wi-Fi network. |
| ONLINE-DIRECT | ONLINE |   |   | Configure the hub to use the same Wi-Fi network used by the phone. Alternatively, add a new hub to the structure and ensure it's on the Wi-Fi network. |
| ONLINE-DIRECT | OFFLINE |   |   | Ensure the hub is plugged in. |
| OFFLINE | No hub |   |   | - If the user is away from home, this is expected. Add a [supported hub](https://developers.home.google.com/apis/android/sdk#supported_hubs) to the home to control devices remotely and set up automations. - If the user is home, ensure the device is plugged in and the phone is connected to the same Wi-Fi as the Matter device. |
| OFFLINE | ONLINE |   |   | Ensure the device is plugged in. |
| OFFLINE | OFFLINE |   |   | Ensure the hub is plugged in. |
[*Table: Troubleshooting scenarios*]