Skip to content

Commit 9bc3f33

Browse files
allenporterCopilot
andauthored
Add extensive Nest Pub/Sub troubleshooting instructions (#41688)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 1e97d74 commit 9bc3f33

File tree

1 file changed

+82
-25
lines changed

1 file changed

+82
-25
lines changed

source/_integrations/nest.markdown

Lines changed: 82 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -766,31 +766,88 @@ Changes for things like sensors or thermostat temperature set points should be i
766766

767767
##### Resolution
768768

769-
To learn more about how Google Pub/Sub works see the [Pull subscription workflow documentation](https://cloud.google.com/pubsub/docs/pull#pull-workflow). To investigate subscription related issues follow these steps:
770-
771-
- Check the logs for any relevant error messages.
772-
- View stats about your subscriber in the [Cloud Console](https://console.cloud.google.com/cloudpubsub/subscription/list). The stats include the number of messages published by your devices, and how many have been acknowledged by your Home Assistant subscriber. You can also `View Messages` to see examples of published. Many old unacknowledged messages indicate the subscriber is not receiving the messages and working properly or not connected at all.
773-
- Note that it is normal to see info messages such as *API error in streaming pull: 503 The service was unable to fulfill your request. Please try again* as part of the streaming pull flow. The pull requests are long
774-
running requests that will send an error after a few minutes and then are retried as needed. These are described in more detail in the [Pull subscription workflow documentation](https://cloud.google.com/pubsub/docs/pull#pull-workflow).
775-
- Enable verbose logging by adding some or all of these to your {% term "`configuration.yaml`" %} depending on where you are having trouble:
776-
777-
```yaml
778-
779-
logger:
780-
default: info
781-
logs:
782-
homeassistant.components.nest: debug
783-
homeassistant.components.nest.climate_sdm: debug
784-
homeassistant.components.nest.camera_sdm: debug
785-
homeassistant.components.nest.sensor_sdm: debug
786-
homeassistant.helpers.config_entry_flow: debug
787-
homeassistant.helpers.config_entry_oauth2_flow: debug
788-
google_nest_sdm: debug
789-
google_nest_sdm.device: debug
790-
google_nest_sdm.device_manager: debug
791-
google_nest_sdm.google_nest_subscriber: debug
792-
google_nest_sdm.event: debug
793-
```
769+
- To learn more about how Google Pub/Sub works see the [Pull subscription workflow documentation](https://cloud.google.com/pubsub/docs/pull#pull-workflow). The steps in the following section will:
770+
771+
1. Verify the Nest Device Access Console is configured with a Pub/Sub topic for publishing messages
772+
2. (Optional) Verify topic message publishing. These steps are available for some topic configurations.
773+
3. Verify Pub/Sub subscription message routing
774+
4. Verify Home Assistant is receiving messages on the Pub/Sub subscription
775+
776+
- **Verify the Nest Device Access Console configuration**
777+
778+
1. Visit the [Device Access Console](https://console.nest.google.com/device-access/project-list)
779+
2. Click the Home Assistant device access project
780+
3. Verify the *Pub/Sub topic* is *Enabled*. If not, follow the integration configuration instructions.
781+
4. If the Pub/Sub topic starts with `projects/<your cloud project>/topics/home-assistant-` then you are using a topic created by Home Assistant. You may follow the steps in the next section to verify the topic.
782+
5. If the Pub/Sub topic starts with `projects/sdm-prod/topics` then you are using a topic created by the Device Access console. This is the old way, but works completely fine. You should skip the next section.
783+
784+
- **(Optional) Verify topic message publishing.** Skip this section if using a topic name starting with `projects/sdm-prod/topics`
785+
786+
1. Visit the Pub/Sub Topics [Cloud Console](https://console.cloud.google.com/cloudpubsub/topic/list)
787+
2. Click the Home Assistant Topic ID matching the Device Access Console configuration.
788+
3. View the *Subscriptions* tab and confirm there is a Subscription ID. This will be verified in the next section.
789+
4. Click the *Metrics* tab and set the zoom to *6 hours* or *1 day*.
790+
5. View the *Published message count*. This counts messages published by the device to the topic. If the number of messages is not what you expect then it indicates:
791+
- A problem with the device connecting to Google: Verify the device works in the Google Home App.
792+
- An issue with the SDM API: This requires [Device Access Support](https://developers.google.com/nest/device-access/support) to diagnose or address.
793+
794+
- **Verify Pub/Sub subscription message routing**
795+
796+
1. Visit the Pub/Sub Subscriptions [Cloud Console](https://console.cloud.google.com/cloudpubsub/subscription/list)
797+
2. Click the Home Assistant Subscription ID
798+
3. Confirm the *Topic name* is the same as in the Nest Device Access Console above.
799+
4. View the *Metrics* tab in the bottom panel, which includes:
800+
801+
- *Delivery metrics*: The *Publish message count* shows messages are published on the topic that are routed to the subscription. You may need to scroll down to see this.
802+
- *Oldest unacked message age* shows messages not being fully received by the Home Assistant nest integration. See the next section for diagnosing this.
803+
804+
5. Click the *Messages* tab
805+
6. Click *Pull* to see a sample of received messages published on the topic. These correspond to messages optionally verified by the *Published message count* in the previous section. If there are no messages published then it indicates either:
806+
807+
- A Subscription misconfiguration: Confirm the *Topic ID* matches the Device Access Console. If they do not match, then follow the integration configuration instructions to resolve this.
808+
- A problem with the device connecting to Google: Verify the device works in the Google Home App.
809+
- An issue with the SDM API: This requires [Device Access Support](https://developers.google.com/nest/device-access/support) to diagnose or address.
810+
811+
7. Click the arrow for a received message to *View all row content* to make it easier to see the full contents of the received messages. You may confirm the message contains the information you expect to see and corresponds with messages received by Home Assistant in the next section.
812+
813+
- **Verify Home Assistant is receiving messages**
814+
815+
1. Enable debug logs for the Nest integration. See [Debug logs and diagnostics](/docs/configuration/troubleshooting/#debug-logs-and-diagnostics) for instructions.
816+
2. View the raw logs
817+
3. Successfully received event messages will appear in debug logs similar to the following:
818+
819+
{% details "Example debug log: Received 1 message" %}
820+
{% raw %}
821+
```text
822+
2025-11-08 09:15:57.620 DEBUG (MainThread) [google_nest_sdm.streaming_manager] Received 1 messages
823+
2025-11-08 09:15:57.621 DEBUG (MainThread) [google_nest_sdm.event] EventMessage raw_data={'eventId': 'xxxxxx-yyyy-zzzz-aaaa', 'timestamp': '2025-11-08T17:15:56.470930Z', 'resourceUpdate': {'name': 'enterprises/...'}}
824+
2025-11-08 09:15:57.621 DEBUG (MainThread) [google_nest_sdm.device] Processing update xxxxxx-yyyy-zzzz-aaaa @ 2025-11-08 17:15:56.470930+00:00
825+
2025-11-08 09:15:57.621 DEBUG (MainThread) [google_nest_sdm.device] Trait update {'sdm.devices.traits.ThermostatMode': {'mode': 'COOL', 'availableModes': ['HEAT', 'COOL', 'HEATCOOL', 'OFF']}, 'sdm.devices.traits.ThermostatEco': {'availableModes': ['OFF', 'MANUAL_ECO'], 'mode': 'OFF', 'heatCelsius': 4.4444427, 'coolCelsius': 24.444443}, 'sdm.devices.traits.ThermostatTemperatureSetpoint': {'coolCelsius': 25.997345}, 'name': 'enterprises/<project id>/devices/<device_id>'}
826+
2025-11-08 09:17:14.406 DEBUG (MainThread) [google_nest_sdm.subscriber_client] Sending streaming pull request (acking 1 messages)
827+
```
828+
{% endraw %}
829+
{% enddetails %}
830+
831+
4. Subscription pull requests are long running, and reconnect every few minutes. This is normal and you will see debug messages like `API error in streaming pull` and then `Event stream connection established`. The [Pull subscription workflow documentation](https://cloud.google.com/pubsub/docs/pull#pull-workflow) describes how this works in more detail. The following debug logs indicate the Subscription connection is working properly.
832+
833+
{% details "Example debug log: Event stream connection established" %}
834+
{% raw %}
835+
```text
836+
2025-11-08 09:19:50.827 DEBUG (MainThread) [google_nest_sdm.subscriber_client] API error in streaming pull: 503 The service was unable to fulfill your request. Please try again. [code=8a75]
837+
2025-11-08 09:19:50.828 DEBUG (MainThread) [google_nest_sdm.streaming_manager] Disconnected from event stream: API error when streaming iterator: 503 The service was unable to fulfill your request. Please try again. [code=8a75]
838+
2025-11-08 09:19:50.830 DEBUG (MainThread) [google_nest_sdm.streaming_manager] Reconnecting stream in 10.0 seconds
839+
...
840+
2025-11-08 09:20:00.837 DEBUG (MainThread) [google_nest_sdm.subscriber_client] Sending streaming pull request for projects/<your cloud project>/subscriptions/home-assistant-prod
841+
...
842+
2025-11-08 09:20:01.004 DEBUG (MainThread) [google_nest_sdm.streaming_manager] Event stream connection established
843+
2025-11-08 09:20:01.004 DEBUG (MainThread) [google_nest_sdm.subscriber_client] Starting streaming iterator
844+
```
845+
{% endraw %}
846+
{% enddetails %}
847+
848+
5. Confirm the Subscription ID from the `Sending streaming pull request` message in the debug logs match the Subscription ID verified above in the cloud console. If they do not match, then follow the integration configuration instructions to resolve this.
849+
850+
- When reporting issues for the Nest integration please include details such as messages published by the device and details from the debug log.
794851

795852
## Removing the integration
796853

0 commit comments

Comments
 (0)