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

Thx

The token and cookie are copied from my Homebridge config, so I know it works

Edit are they one time per device? Should I not be using my Homebridge one

Sweet! My nest hello doorbell only gives 10 second updates and no person sensor with badnest so I’m sticking with old school works with nest while a can.

Can you help me please. Shouldn’t it show under my integrations

Sure let me PM you.

So your saying it should show an installable integration after? After I install the repo I see nothing.
Btw does anyone have this working on the latest June hassio release

My log “ File “/config/custom_components/badnest/init.py”, line 48, in setup
region,
File “/config/custom_components/badnest/api.py”, line 52, in init
self.login()
File “/config/custom_components/badnest/api.py”, line 70, in login
self._login_google(self._issue_token, self._cookie)
File “/config/custom_components/badnest/api.py”, line 81, in _login_google
r = self._session.get(url=issue_token, headers=headers)
File “/usr/local/lib/python3.7/site-packages/requests/sessions.py”, line 543, in get
return self.request(‘GET’, url, **kwargs)
File “/usr/local/lib/python3.7/site-packages/requests/sessions.py”, line 530, in request
resp = self.send(prep, **send_kwargs)
File “/usr/local/lib/python3.7/site-packages/requests/sessions.py”, line 643, in send
r = adapter.send(request, **kwargs)
File “/usr/local/lib/python3.7/site-packages/requests/adapters.py”, line 449, in send
timeout=timeout
File “/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py”, line 677, in urlopen
chunked=chunked,
File “/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py”, line 392, in _make_request
conn.request(method, url, **httplib_request_kw)
File “/usr/local/lib/python3.7/http/client.py”, line 1252, in request
self._send_request(method, url, body, headers, encode_chunked)
File “/usr/local/lib/python3.7/http/client.py”, line 1293, in _send_request
self.putheader(hdr, value)
File “/usr/local/lib/python3.7/http/client.py”, line 1225, in putheader
values[i] = one_value.encode(‘latin-1’)
UnicodeEncodeError: ‘latin-1’ codec can’t encode character ‘\u202a’ in position 1102: ordinal not in range(256)
2020-07-01 13:53:58 ERROR (MainThread) [homeassistant.bootstrap] Error setting up integration climate - received exception
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/config_entries.py”, line 780, in async_forward_entry_setup
result = await async_setup_component(self.hass, domain, self._hass_config)
File “/usr/src/homeassistant/homeassistant/setup.py”, line 49, in async_setup_component
return await setup_tasks[domain] # type: ignore
File “/usr/src/homeassistant/homeassistant/setup.py”, line 55, in async_setup_component
return await task # type: ignore
File “/usr/src/homeassistant/homeassistant/setup.py”, line 151, in _async_setup_component
hass, config, integration
File “/usr/src/homeassistant/homeassistant/config.py”, line 780, in async_process_component_config
platform = p_integration.get_platform(domain)
File “/usr/src/homeassistant/homeassistant/loader.py”, line 273, in get_platform
f"{self.pkg_path}.{platform_name}"
File “/usr/local/lib/python3.7/importlib/init.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1006, in _gcd_import
File “”, line 983, in _find_and_load
File “”, line 967, in _find_and_load_unlocked
File “”, line 677, in _load_unlocked
File “”, line 724, in exec_module
File “”, line 860, in get_code
File “”, line 791, in source_to_code
File “”, line 219, in _call_with_frames_removed
File “/config/custom_components/badnest/climate.py”, line 85
def init(self, device_id, api):”

Stopped working last week and getting these errors. Any idea what I need to do to resolve?

> Unable to prepare setup for platform badnest.climate: Unable to set up component.
> 
> July 1, 2020, 1:47:31 PM – setup.py (ERROR) - message first occurred at July 1, 2020, 1:46:53 PM and shows up 3 times
> 
> Only one configuration of abode is allowed.
> 
> July 1, 2020, 1:47:31 PM – Abode (WARNING)
> 
> Error during setup of component badnest
> 
> July 1, 2020, 1:46:53 PM – custom_components/badnest/api.py (ERROR)
> 
> ClimateDevice is deprecated, modify NestClimate to extend ClimateEntity
> 
> July 1, 2020, 1:46:49 PM – Climate (WARNING)

@ne0ark yes, I have 3 x gen1 Nest Protects reporting active statuses on Smoke and CO (OK, Warning or Emergency) and battery health (OK and not sure what else)

I just switched over to use this vs the standard nest integration. I am hesitant to move to the google account worrying something will break. I just added another thermostat to my nest account and it doesn’t show up in either integration but shows in my app and works fine… any ideas? Did google cut off new devices from working somehow? When i login to the home.nest.com I see it there too… wondering if anyone else experienced this.

BTW, this integrtation works great with my 3 other nest thermostats so far.

Just found out about badnest! Kudos to the author! Integration went well with Google 2FA and I now have all 6 of my Nest Thermostats loaded and displayed, however it didn’t find my Nest Hello Camera Doorbell, other people above said it works for them though.

I have the camera section in my config as follows:

camera:
  - platform: aarlo
    ffmpeg_arguments: '-pred 1 -q:v 2'
  - platform: badnest

It didn’t show as an entity or device though and not finding it as an option for a lovelace card. Is there anything else I should have to do in order to get the camera from Nest Hello recognized?

Thanks!

This is my badnest setup. No issues for the door camera or the 3 thermostats that I have.

badnest:
  issue_token: "xxx"
  cookie: "xxxx"
  region: us

climate:
  - platform: badnest
    scan_interval: 10

camera:
  - platform: badnest
sensor:
  - platform: badnest

The platform template is:

platform: template
sensors:
  upstairs_temp:
    friendly_name: "Upstairs Temperature"
    unit_of_measurement: 'degrees'
    value_template: "{{ state_attr('climate.upstairs_thermostat', 'current_temperature') }}"
  downstairs_temp:
    friendly_name: "Downstairs Temperature"
    unit_of_measurement: 'degrees'
    value_template: "{{ state_attr('climate.downstairs_thermostat', 'current_temperature') }}"
  master_temp:
    friendly_name: "Master Temperature"
    unit_of_measurement: 'degrees'
    value_template: "{{ state_attr('climate.master_bedroom_thermostat', 'current_temperature') }}"
  downstairs_humidity:
    friendly_name: "Downstairs Humidity"
    unit_of_measurement: '%'
    value_template: "{{ state_attr('climate.downstairs_thermostat', 'current_humidity') | round(0) }}"
    device_class: "humidity"
  upstairs_humidity:
    friendly_name: "Upstairs Humidity"
    unit_of_measurement: '%'
    value_template: "{{ state_attr('climate.upstairs_thermostat', 'current_humidity') | round(0) }}"
    device_class: "humidity"
  master_humidity:
    friendly_name: "Master Humidity"
    unit_of_measurement: '%'
    value_template: "{{ state_attr('climate.master_bedroom_thermostat', 'current_humidity') | round(0) }}"
    device_class: "humidity"

The cards are: for the camera

  -
    aspect_ratio: 75%
    entity: camera.front_door
    type: picture-entity
  - 

for the thermostats

  -
    cards:
      - entity: climate.upstairs_thermostat
        type: thermostat
      - entity: climate.master_bedroom_thermostat
        type: thermostat
      - entity: climate.downstairs_thermostat
        type: thermostat
    type: horizontal-stack
  - entities:
      - entity: sensor.master_temp
      - entity: sensor.downstairs_temp
      - entity: sensor.upstairs_temp
    title: Temperature Sensor
    type: 'custom:mini-graph-card'
  - 
    entities:
      - entity: sensor.master_humidity
      - entity: sensor.downstairs_humidity
      - entity: sensor.upstairs_humidity
    title: Temperature Sensor
    type: 'custom:mini-graph-card'

I have no issues for any of the devices except for sometimes I have to recreate the cookie and token. You may have to play with the formatting as I use a split yaml file and use package loading.
Hope this helps.

Badnest stopped working a few days ago after several months without problems. I see other people with the same error. Any idea?

badnest001

Thanks for taking the time to post that! Much appreciated. Unfortunately mine is pretty much the same except that I don’t have an entity for my doorbell detected. Or to phrase differently, I don’t have a camera.my_nest_doorbell like you do in my entities and nothing in my states either.

It shows up in my Nest app. Anything I can do to troubleshoot? I can’t find any errors in the logs either

Using nest or google account?
I was having the same issue and had to migrate to a google account to get it going again

Try to reinstall cookie and token.

That solved the problem. Many thanks!

Mine shows up as camera.front_door in developer tools.

Thanks. Not for me unfortunately but then I started wondering if it’s because I already have a binary_sensor.front_door. It’s not a camera, but maybe there’s still a name conflict. So I went into my Nest app and changed the location of the Nest Hello from Front Door to Front Porch. I rebooted home assistant, but still not detected. Will try another reboot in another hour or so.

Do you have anything in your home-assistant.log at all? Anything like the following:

2020-07-07 22:53:51 INFO (MainThread) [homeassistant.setup] Setting up badnest
2020-07-07 22:53:57 INFO (MainThread) [homeassistant.setup] Setup of domain badnest took 5.9 seconds.
2020-07-07 22:58:44 INFO (MainThread) [homeassistant.components.camera] Setting up camera.badnest
2020-07-07 22:58:44 INFO (MainThread) [custom_components.badnest.camera] Adding camera sensors
2020-07-07 22:58:44 INFO (MainThread) [custom_components.badnest.camera] Adding nest camera uuid: hhhhhhhh

No unfortunately :confused:

hmm, ok, do you have any loggers config in your configuration.yaml?

logger:
  default: info
  logs:
    # command_line.switch used for chromecast - super noisy logs
    homeassistant.components.command_line.switch: warning