home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.35k stars 29.89k forks source link

Nest SDM API not accepting fan and thermostat commands #96180

Open DocBrownInSpace opened 1 year ago

DocBrownInSpace commented 1 year ago

The problem

About a month ago, the Nest integration’s fan and temperature control stopped working. Oddly enough, the mode (i.e. heat/cool/eco/etc) still works. I tried completely deleting the Nest integration, and recreating the Google Cloud project. The situation didn't improve. The same Client ID/Secret works perfectly fine with the Google Assistant SDK integration.

Here is how I’m calling the fan, the GUI controls also don’t work:

  - service: climate.set_fan_mode
    data:
      fan_mode: "on"
    target:
      entity_id:
        - climate.firstfloor

I turned on debug logging, nothing obvious there. Just an entry showing the SDM API being called:

2023-06-15 18:17:38.761 DEBUG (MainThread) [google_nest_sdm.auth] request[post]=https://smartdevicemanagement.googleapis.com/v1/enterprises/{GUID}/devices/{GUID}:executeCommand
2023-06-15 18:17:38.761 DEBUG (MainThread) [google_nest_sdm.auth] request[post json]={'command': 'sdm.devices.commands.Fan.SetTimer', 'params': {'timerMode': 'ON', 'duration': '43200s'}}

I reported this as well on the community forum, and looks like others are having the same issue: https://community.home-assistant.io/t/nest-fan-and-temperature-control-stopped-working/582424

My home has 3 gen2 Nest Thermostats and 7 gen2 Nest Protects.

What version of Home Assistant Core has the issue?

2023.7.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Nest

Link to integration documentation on our website

https://www.home-assistant.io/integrations/nest

Diagnostics information

2023-06-15 18:17:38.761 DEBUG (MainThread) [google_nest_sdm.auth] request[post]=https://smartdevicemanagement.googleapis.com/v1/enterprises/{GUID}/devices/{GUID}:executeCommand 2023-06-15 18:17:38.761 DEBUG (MainThread) [google_nest_sdm.auth] request[post json]={'command': 'sdm.devices.commands.Fan.SetTimer', 'params': {'timerMode': 'ON', 'duration': '43200s'}}

Example YAML snippet

- service: climate.set_fan_mode
    data:
      fan_mode: "on"
    target:
      entity_id:
        - climate.firstfloor

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 1 year ago

Hey there @allenporter, mind taking a look at this issue as it has been labeled with an integration (nest) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `nest` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign nest` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


nest documentation nest source (message by IssueLinks)

allenporter commented 1 year ago

The Google API appears to be ignoring the fan commands -- so this isn't a home assistant bug AFAICT.

allenporter commented 1 year ago

I recommend filing an issue in the issue tracker here: https://developers.google.com/nest/device-access/support

allenporter commented 1 year ago

Also, I would recommend you also ask all the other end users to report their issue as well so that they can have more data points and accounts to look at. When I have reported issues before it really helps for individual users to report details including their accounts, timestamps, and actions involved.

I also recommend turning up debug logging to capture events received. Show example of a command that does work (and the events received in the logs) and an example of a command that does not work (and the events NOT received in the logs showing that it was not reflected)

dschafer commented 1 year ago

@DocBrownInSpace You've got more detailed logs than I, so it probably makes sense for you to file the Google issue, but once you do so I'll post there as well so it's clear that it's a general issue and not something specific to your account or setup.

DocBrownInSpace commented 1 year ago

I've created a bug report with Google. If you're also experiencing this issue, please add a comment to this report:

https://issuetracker.google.com/issues/290592590

knwpsk commented 1 year ago

There's another open Google bug ticket here, and they've assigned it, and they're asking for troubleshooting details. They ask for a Project ID and other details that (I think?) need to come from the HA developer. Can someone reply on the google tickets? Thanks!

https://issuetracker.google.com/issues/288327296

allenporter commented 1 year ago

There's another open Google bug ticket here, and they've assigned it, and they're asking for troubleshooting details. They ask for a Project ID and other details that (I think?) need to come from the HA developer. Can someone reply on the google tickets? Thanks!

https://issuetracker.google.com/issues/288327296

No, this is your project you created. You can refer to the Nest SDM API instructions or home assistant instructions where it shows you how you created these.

knwpsk commented 1 year ago

ah you're right, @allenporter , thanks for the reminder

z3ugma commented 1 year ago

I'm experiencing the same problem. If anyone would be willing to detail a "standardized procedure" for reporting the results of the SDM API command back, I'd follow it and chime in those Google bug tickets.

FWIW I'm pretty experience with Google Cloud Console and if anyone else knows how to get logging out of the SDM API in GCP I'd help monitor those logs

allenporter commented 11 months ago

@z3ugma This is how I do it:

jawilson commented 10 months ago

This issue (of Google's making) is incredibly annoying. I've managed a slight workaround in the meantime using the Google Assistant SDK integration:

service: google_assistant_sdk.send_text_command
data:
  command: "Set apartment fan to {{ fan_mode }}"

"Apartment" is the name of my Nest Thermostat in the Google Home app. For whatever reason, it doesn't seem to be working for turning the fan off, but turning it on works fine. While asking the assistant through a Nest speaker to turn it off responds affirmatively and the SDK test command doesn't error, nothing actually happens on the Nest itself. I believe you can also set the amount of time for the fan to run, by default (for me) it runs for 15 minutes.

issue-triage-workflows[bot] commented 7 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

DocBrownInSpace commented 7 months ago

This is still an open issue. Confirmed in version 2024.2.2. Google is aware of the issue and confirmed they are working on it. No ETA on their end.

issue-triage-workflows[bot] commented 4 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

DocBrownInSpace commented 4 months ago

This is still an open issue. Confirmed in version 2024.5.4. Google is aware of the issue and confirmed they are working on it. No ETA on their end. (Yup, exact same update as back in February...)

allenporter commented 3 months ago

Google team has fixed a separate issue but is reporting here that the "fix reaches the production this or next week." Very cool.

knwpsk commented 4 weeks ago

Lovely. Only took them a year+ to address the API that they broke.

I threw away all of my Nest thermostats. Ecobee is stable.

coolhand72 commented 4 weeks ago

Just tested again, climate.set_fan_mode = off still does not work.