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

Thank you, I appears the issue was trying to log into old nest account with google credentials. I do not have that type of account so it might have slipped since I have no way to test it. I did some cleanup, in the update, it should be clearly distinguished. You can try it with HACS update.

Wow, thanks for the quick response! I updated the integration through HACS and then restarted HA. Unfortunately, what I see in the logs is the same exact thing…? I’m not sure if there is anything more for me to do, that I may have missed. And unfortunately, I’m not a Python developer, so even though you say you’re a novice, you have expertise beyond me. But I am willing to learn!
I have no idea how where to find this code on my system, or how to debug it, but I will help in any way I can as I do want to learn and also try to get this installed. Probably not relevant to this discussion, so if you want to message me directly I will get to work on figuring this out.

Thanks again for the changes and update.

Are you authenticating with email and password or token ?

There’s clearly something with the old nest platform response upon login. Seems they don’t return the variable in JSON anymore. Unfortunately, I do not have the old account, never had, so it’s kinda tricky. Literally a guessing game. I could check other libraries if any of them was updated recently to accommodate any changes in that matter, but if not, then you would need to figure out what is the response coming from the login.

I use a username and password at home.nest.com. It then sends a verification text with a 6 digit code. Maybe that is what is making it incompatible?
I think I’ll bit the bullet and upgrade my account to Google. Then we should be in the same situation.
Thanks for the help,

Oscar, got it to work! I ended up migrating my account to Google (well, actually that was not possible…I had to delete my Nest account and create it under Google, and re-add all my devices, but I digress). I then followed the instructions on your github page to get the values for issue_token and cookie. A couple of differences though that you may want to update on your main instruction page:

  • Step 7 says “…ending with nest.com”. Mine had some more text, which I left in.
    Mine ended with ss_domain=https://home.nest.com&include_granted_scopes=true

  • Step 10 says "…copy the entire cookie (beginning OCAK=... or __Host-GAPS=).
    Mine began with __Secure-3PSID=

Once I added those two values and restarted Home Assistant, I saw log messages indicating it worked!

I did see some of these errors in the log though (about 20 of them), but I don’t think they are a problem?

2022-02-21 19:51:09 ERROR (MainThread) [homeassistant.components.sensor] Platform badnest does not generate unique IDs. ID 18B4300000309E05_co_status already exists - ignoring sensor.bedroom_master_protectco_level
2022-02-21 19:51:09 ERROR (MainThread) [homeassistant.components.sensor] Platform badnest does not generate unique IDs. ID 18B4300000309E05_smoke_status already exists - ignoring sensor.bedroom_master_protectsmoke_level

Sensor data in Developer Tools looks like your screenshot above, so I think I am in business. Now I just have to figure out what best to do with it all! What did you do with yours?

Thanks!

I am glad you’re in business!
It’s possible that the old account login changed somehow. I will update the steps based on your feedback, but I am by no means the official developer of the component haha :slight_smile:
Thanks for the logs. I think it’s happening because a few of the entities are possibly named the same in sensor.* type and binary_sensor.* type, so unique ID’s collided. I am not sure how big of a deal it is but will look into it. I didn’t see them in my logs …

I also have a sensor watching the replacement date, the battery health and the two monitoring co and smoke status.

1 Like

My biggest advantage of using this integration is that I have another couple of occupancy sensors. Protect has a motion sensor integrated, its cool-down time for API update is very long like 15min, but it can act as good occupancy.

Could you link me to the integration you are currently using, @OscarHanzely? I started working on a Nest Protect integration a while ago (https://github.com/iMicknl/ha-nest-protect), but I would love to join forces, since I have limited time.

I just forked the existing badnest integration, the sources are listed in repo: https://github.com/OscarHanzely/badnest

Didn’t really have time myself to build anything, what I really wanted just working motion/occupancy detection and basic sensors. So I just upgraded it a bit. There is no official support really atm.

1 Like

@OscarHanzely Does your integration work with the Nest Doorbell as well? I have been looking for a way to use my nest thermostat and doorbell in home assistant without using the Paid Nest Integration. I am very interested in trying to set up your integration with my HA.

I cannot verify it, have no doorbell myself. If the original integration supported it, then maybe. I am not actively maintaining the project, I just took the broken stage and fixed/extended the nest Protect sensors. There is a camera support so it may work …

Honestly, I would use the official nest integration for anything that works there. Only use badnest for Protect until they release support.

One-time $5 fee is peanuts for the officially supported integration.

Same here… I still have some hope that one day it will be added to the SDM API. By the way, @OscarHanzely, you could give GitHub - iMicknl/ha-nest-protect: Nest Protect integration for Home Assistant. This will allow you to integrate your smoke, heat, co and occupancy status real-time in HA. a try as well.

It uses partly the same API as badnest I believe; however it uses another endpoint for real-time updates. So changes should be faster (3 - 5 seconds).

That’s great I will try it. Does it include some attributes for the device sensor ? Like its IP/mac address for example? That’s one thing I added in my improvement so I can tell which device on the network is which without the need to disconnect or trigger it. I also pulled the dates of manufacturing and replace_by so It can have automation when replace by will be coming close to alert.
Diagnostic also checks the last test statuses

component_wifi_test_passed: true
component_co_test_passed: true
component_smoke_test_passed: true
component_speaker_test_passed: true
component_led_test_passed: true
last_audio_self_test_end_utc_secs: 2022-03-09T13:50:38

It is not added to the state attributes, but the mac address is set as the identifier. This will make sure that your Nest Protect devices can be shared with multiple integrations. In my case, the Unifi integration will add a diagnostic entity (Home / Away) to my Nest Protect device.

image

All other states you mean are added as diagnostic sensors. I see we miss the led_test and wifi_test, but they can be added easily.

1 Like

@imick I just scratched my badnest integration and replaced it with your version. It is sooo much better for nest protect! Easy to configure and does provide similar functionality.

I am happy that someone is maintaining the integration for nest protect as Google dropped it.

If you will be adding more sensors to diagnostic, like those tests, please add a sensor that detects if the mains power is connected now tired protect. That will tell you when the power outage was detected. Tince they are the only devices that can tell me that in house without becoming unavailable, this is a cool feature. (of course if you have battery backup on your Home Assistant server)

1 Like

@imick A couple quick questions

  1. Is there a reason why CO Status shows “Off” while Smoke Status shows “Clear”? In badnest they both show the same “OK”. When I see CO Status “Off” my first thought is it’s not monitoring for CO.
  2. Is there a list or example of the states for CO, heat and smoke when alarming so I can modify my automations if needed?

Nice work on this integration! Very simple to setup and provides so much more than badnest for protect users! Thanks

If you update to the latest Home Assistant version, this is fixed. I fixed a bug in the HA core so that CO sensors now show up correctly. This was happening for all CO sensors, thus not only Nest Protect.

Not really, currently it is just a binary sensor, which can be on or off. The front-end will show this as ‘clear’ or other states, based on the device class. Currently a warning trigger is not implemented yet, since I wasn’t aware of that in the first place.

Does someone here use the Google authentication and do you own a thermostat? I am looking to bring temperature sensors to the Nest Protect integration. (needs probably a rename). The goal is to support all features that are not present in the SDM API, via the custom component.

If you could test https://github.com/iMicknl/ha-nest-protect/archive/refs/heads/enhancement/kryptonite_temperature_sensors.zip, that would be great. Just unzip this file and place custom_components/nest_protect in your custom_components folder. Let me know if you see any temperature sensors and perhaps share you diagnostics information as well.

@imick yes I have a google account on my nest and own a thermostat and protects. I replaced the exsiting nest protect with the unzipped one, restated HA. But no new entities show up, still at 2 devices and 40 entitites

One other thing I wanted to ask is, does this work with the Nest Thermostat. That is one thing I have really been wanting to get working on my Home Assistant. Being able to control the temp in my house on HA.
Could I install and setup this integration
https://github.com/OscarHanzely/badnest
or
iMicknl/ha-nest-protect: Nest Protect integration for Home Assistant. This will allow you to integrate your smoke, heat, co and occupancy status real-time in HA. (github.com)

One of these integrations to control my Nest Thermostat. and eventually maybe possibly even my nest doorbell. If i have to do that 1 time 5$ fee that is totally fine I just didnt want to have to pay something monthly.
Thank you!