I made a crappy Nest Thermostat integration that will work as a stopgap until alternatives come out

Can I help with finding the EU URL, as it is what I use? If you point me in the right direction I may be able to find it.

Have you looked under thermostat card?

Thanks for this good work @USA-RedDragon !

My Nest thermostat works very well with Badnest.
However, I’ve 3 cameras and none works. I’ve use a picture-glance card. Do you have a sample conf ? I live in France (I don’t know if it’s necessary but I’ve seen there are different URL for cam).

Update for camera.jardin fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 270, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 450, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/badnest/camera.py", line 106, in update
    self._device.update()
  File "/config/custom_components/badnest/api.py", line 390, in update
    props = self.get_properties()
  File "/config/custom_components/badnest/api.py", line 412, in get_properties
    return r.json()[0]
IndexError: list index out of range

By the way, I received 7 emails from Nest when I relaunched HA… I don’t know if it’s normal or not.

Just an update…

I just left the cards and didn’t touch them, but today for some reason everything works again. Hmmmm, I don’t know what changed?

I have created a pull request with the EU camera URL and a config to set a region. I have never written anything in python or anything for HA before though so it might be awful and if that’s the case then feel free to take the URL from the pull request and write your own code instead. Thanks so much for creating this!

1 Like

Awesome work. I just took the URL and changed it, 3 cameras all now in HA. Amazing!

I’ve started having issues with it failing to work as well. I’m looking into it now. I also have plans to add support for the nest protect

Unfortunately, you’ll get emails about logins whenever the token expires, since it re-auths

I just rewrote the whole API, making it a lot less prone to error, and making it much easier to add support for more Nest products. Today I added preliminary Nest Protect support under the sensors platform.

Residents of the EU and other non-US camera users now have the ability to specify their two character country code for the Nest API (e.g. ‘us’ for the United States and ‘eu’ for the European Union, more probably exist)

This marks release 4.0.0 and it’s the first time I’ve added a features section to the readme. This should be much more stable now.

Massive hat-tip to:

  • @deadman96385 for the help with adding Nest Protect support
  • @gboudreau for pointing out that one of the config entries was pointless
  • and @vinodmishra for adding the country code support for Nest Camera users

Changes

Features

Bug Fixes

  • Add region config and use it to use correct camera URL @Tomiam (#28)

Maintenance

2 Likes

You might need to change the name to bloodygoodnest.

1 Like

Still getting an error on my Nest Hello

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 418, in start
    resp = await task
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/real_ip.py", line 40, in real_ip_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 73, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 136, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 122, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/camera/__init__.py", line 492, in get
    if not camera.is_on:
  File "/config/custom_components/badnest/camera.py", line 68, in is_on
    return self._device.device_data[self._uuid]['online']
KeyError: 'online'

Thanks for creating this custom component! Great work!
Unfortunately i have the same issue with my camera’s.

Same error for all my cameras : Nest Indoor x1 / Nest Outdoor x2

Just change ‘online’ to ‘is_online’ on line 68 of camera.py. That will fix it.

1 Like

Great! That did the trick. Thanks!

The static image works ! But when I click on it, the preview doesn’t.
Any bug ?

4.0.1 is released to fix the regression I had in the camera. There have been some reports of the API feeling slower, I’m aware of this issue, and there should be a minor release coming this evening to fix this

1 Like

Oh I see now.

Man I can’t thank you enough for this!!

This group here is an amazing bunch.

1 Like

You might need to change the name to bloodygoodnest.

I prefer to think of this as a message to nest.
like “bad dog”
:slight_smile:

@USA-RedDragon fantastic work here.

1 Like

Good point. goodsensordespitenestbeingfheads is probably a bit wordy.