Legacy Nest

The Legacy Nest integration has worked solidly for years. Lately, I have noticed latency and some API calls fail. Has it been changed and why? This is an error that has appeared lately. Sometimes the service call works, sometimes it doesn’t.

Logger: homeassistant.core
Source: components/nest/legacy/climate.py:324
First occurred: 1:20:25 PM (1 occurrences)
Last logged: 1:20:25 PM

Error executing service: <ServiceCall climate.set_fan_mode (c:26886d9887cff6af489edd552cbe3784): fan_mode=On, entity_id=[‘climate.entryway’]>
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/core.py”, line 1511, in catch_exceptions
await coro_or_task
File “/usr/src/homeassistant/homeassistant/core.py”, line 1530, in _execute_service
await handler.job.target(service_call)
File “/usr/src/homeassistant/homeassistant/helpers/entity_component.py”, line 209, in handle_service
await self.hass.helpers.service.entity_service_call(
File “/usr/src/homeassistant/homeassistant/helpers/service.py”, line 663, in entity_service_call
future.result() # pop exception if have
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 896, in async_request_call
await coro
File “/usr/src/homeassistant/homeassistant/helpers/service.py”, line 700, in _handle_entity_call
await result
File “/usr/src/homeassistant/homeassistant/components/climate/init.py”, line 462, in async_set_fan_mode
await self.hass.async_add_executor_job(self.set_fan_mode, fan_mode)
File “/usr/local/lib/python3.9/concurrent/futures/thread.py”, line 52, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/src/homeassistant/homeassistant/components/nest/legacy/climate.py”, line 324, in set_fan_mode
self.device.fan = fan_mode.lower()
File “/usr/local/lib/python3.9/site-packages/nest/nest.py”, line 354, in fan
self._set(‘devices/thermostats’, {‘fan_timer_active’: mapped_value})
File “/usr/local/lib/python3.9/site-packages/nest/nest.py”, line 206, in _set
response = self._nest_api._put(path=path, data=data)
File “/usr/local/lib/python3.9/site-packages/nest/nest.py”, line 1874, in _put
return self._request(‘PUT’, path, data=data)
File “/usr/local/lib/python3.9/site-packages/nest/nest.py”, line 1866, in _request
raise APIError(response)
nest.nest.APIError: blocked

I maintain the nest integration, and have been preserving the legacy integration (e.g. adding tests to keep it working as the sdm API integration evolves). The original author isn’t on the project.

Nothing has changed in the legacy integration code base.

Googling this, it seems like the API is just rate limiting you:

But I have no idea really.

I would recommend upgrading to SDM as in the next release I marked the legacy nest integration is deprecated and giving folks a few months to move off. (Upgrade, or move the code to a custom component, whatever)

Thanks for the reply. It looks like I’ll be moving to SDM then.

I tried the Nest SDM Integration following the Nest docs twice and both times when I get to authorizing the integration, it fails on a google web page that says “Something Went Wrong”. contact the developer. I’m guessing at why and will try another email address as my google account is actually using my apple me email which has issues with other platforms.

Hi,
This page has helpful hints if you get error messages from Google: Partner Connections Manager Error Reference  |  Device Access  |  Google Developers – in that case, it means the project id does not match for some reason?

I’d also recommend checking out the video linked form the integration page which is pretty good. Let me know if you need any other help.

Hello, I see the Works with Nest is now deprecated. I didn’t pursue the new integration as it does not include Nest Smoke detectors. Shouldn’t Works with Nest be available until the new integration supports everything?

1 Like

Hi. The legacy works with nest integration currently doesn’t have a maintainer. I maintain the nest integration overall and have been trying to keep it working. The code has few automated tests though i tried to add some, and I don’t even have a legacy works with nest account so I can’t really even test it out if i wanted to. The SDM API likely won’t add all the missing features of the works with nest api, and that really isn’t a factor in the decision.

Edit: The complexity starts to get really high managing the configuration for legacy works with nest as we extend nest with new features especially things like moving away from yaml, etc to make nest onboarding easier.

I would definitely recommend someone in the community move the code to a custom component and continue maintaining it. If someone is interested in doing this i’m happy to help them, though assume my help won’t be needed.

6 Likes

Adding to @allenporter’s words, the legacy Nest API is quite different and supporting a single integration for both is not doable. I am happy to see the (new) SDM integration in core and hopefully Google will just add support for more devices to their new SDM API.

Besides that;
I am currently working on a custom integration to get the Nest Protect’s in Home Assistant and the begin is there. Since this uses the legacy API, this could perhaps be extended to all other missing devices as well.

However, I won’t have the time and bandwidth to work on this a lot, especially not to extend it besides Nest Protect devices. There are currently already some other contributors (regarding Nest Protect), however anyone is welcome to help.

2 Likes

Thanks, I too have no time to put towards this right now and may consider getting off the Google platform altogether rather than expend effort that likely will be repeated in the future.

Is it possible to have legacy and new Nest integrations configured at the same time?

Have same question. Because old legacy integration needs a old Nest account that is not transferred to new google account. The new integration needs the new google account type and require you to move to google platform… (When I open the NEST app on my iOS its always asking me to switch…and always press NOOOOO… otherwise everything broke apart)

It could be possible if someone made a new custom component with a different id. Right now they both exist in the same component.

1 Like

I might be over simplifying this, but would it be as easy as copying the 2021.12.10 Nest component to the custom_component directory and giving giving it a different identity like:

nest (the current/new one)
nest_legacy (Nest API)

I would really like to officially separate the two if that is what is needed, but don’t know what identifiers need to be updated to make them separate.

Thanks.

If you rename you’ll likely need users to rename stuff in the configuration.yaml. Anyway, just i’d recommend trying things out, and maybe other folks in the community e.g. subscribed to this thread can help test, etc

I’m confused now… What I know you can’t use 2 intergrations. Because old one works only.with “works with best” accounts and the new one works only with accounts that are migrated to Google…
So I stay with HA version that supports old intergration because then I have my NEST thermostat and protects

I would certainly help test it.

I’m wondering if my issues trying the SDM version were due to the fact that I still use the old Nest login poudenes describes from my phone. I think we will be forced down this route as it looks like google will be dropping the old API at some point even if HA didn’t. I find it funny that the feature that got me started in all this is now going away. I needed a way to control an ornamental fireplace that is supplemental heat in the basement wirelessly. I have ‘dummy’ Nest thermostat just powered and use its hvac_state to manipulate esphome relays. It took some time to arrive at this 5 years ago and of course I have added 50+ other smarts since.

1 Like

My impression is that using a nest account doesn’t work, yes., I have no real idea though since I’ve never had one, and was never allowed to use works with nest API.

Thanks, where would one find the code that uses the old API if one wanted to create a custom component? I’m stepping into uncharted territory here.

The only problem is, if you have to authorize the app again, you won’t be able to cause the nest website gives you an error. I am not sure you can retrive the authorization somehow.
I ended using a homebridge docker + nest plugin with my old nest account and I am able to control my thermostat from HA with my legacy account: The Best Nest ↔ Home Assistant Integration via HomeBridge // Better than the "Official" - YouTube (actually you don’t really need portainer, you can use the homebridge docker directly if you want to)

1 Like