Support for Nest Protect

Hi imick
Before I irreversibly move away from the Nest API to the Google one, could I just confirm you are saying that Homebridge approach should still work (including authenticate properly)?
I hope the authentication with the new integration can be made to work as it sounds like the way to go.
regards
George

OK having proceeded with the Homebridge approach on a spare RPi, I can see my question was unnecessary as it caters for both Nest and Google accounts. But it works great and I have learned that I can retrieve the Nest access token from https://home.nest.com/session which I thought had been lost.
Home Assistant picks up the Homebridge server easily and I can see CO and Smoke but not battery, which would be useful, or presence.
Without getting into it too much more, grateful if someone could point out if I can access the battery status as well.
If not, hopefully the Google authentication issue can be resolved as that is the better solution. Sorry I don’t have the smarts to help with that.

I accidentally triggered my smoke alarm by steam from my shower, and I can share that the integration works on that part at least. (for me…).

Hopefully I can find some time in the coming weeks to look for alternative methods, but I am quite busy unfortunately.

1 Like

Just updated HA to 2022.11.3 and had the same issue as listed above:

Unable to prepare setup for platform nest_protect.select: Platform not found (Exception importing custom_components.nest_protect.select).

On reading above I note references to versions 0.3.9/10. My running version is 0.3.7 but I see no way of updating it…am I being stupid.

After a period of time all the entities simply started working again, however brightness is still not available.

Any advice?

@rossk how did you install the integration? If you use HACS, you can easily update. Otherwise you have to download the newest version from GitHub and replace it manually.

Thanks Mick, I installed via add ‘integration’ and not HACS so appear to have no way to update it as it does not show updates.

What was the “this” that ended up working for you?

Hello folks!

I forked ha-nest-protect and tried to add the cookie authentication.

Thank you @imick for the original code!

If someone wants to test it, it is here: GitHub - nicoinch/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.

I was able to test it with the cookie authentication method and 2 devices with battery. I was not able to test if it does not break the current refresh_token authentication.

8 Likes

That worked for me! Thanks so much

Great job, it works!

Thanks!!!

Great work! Would you be willing to do a pull request? I can plan some time coming weeks to review and see how we can incorporate your changes :).

3 Likes

That looks promising until I tried to add the integration. It still asks for an authentication token (and it still denies me)
Where do I put the issue_token and cookie then? It is not (clearly) described in the readme.

It was the plan :blush: I just wanted to get some feedbacks before. As suggested in the last comment, I will try to improve the config flow docs. I would like to get a confirmation that I did not break the refresh_token feature before submitting the PR.

1 Like

The config flow has changed a little bit, now you choose the account type (I choose the first one) and then a form asks for an issue_token and a cookie. The procedure to retrieve them is described in the README.

hey awesome that a solution might be coming soon!

Just curious, for the people have it working, will it break upon updating to this, and then we’ll have to re-authenticate it? Not an issue, but just wondering.

I would like to ensure my changes do not break the integration for people already using it (that is why I ask for a feedback from people using an already configured refresh_token).
When I am enough confident, I will submit a pull request to integrate my changes to the original addon.

I configured it resterday evening and it seem to work but just for 15 minutes if I want it back again, I need to restart HA every time.

Maybe you should write what exactly to test, how and by whom in order to get the results…

I integrated it by imicks fork and I do not even know how to test if it is still working (on HA dashboard everything looks OK, but latest status change is 3 days ago when I rebooted HA for the last time).

And one more question - is it possible to use PIR sensor from Nest protect for HA automations?

I would like someone who has a working version of the integration configured with a refresh_token to test my forked version to ensure the previous authentication method still works (not sure if this is possible as the forked integration may or may not have access to original integration configuration).

Anyway, I will try to submit the pull request today, it may ease the tests.

Concerning the PIR sensor, I cannot confirm as I only have battery devices.

It you encounter any strange behaviour, do not hesitate to look in your logs (Settings>System>Logs) to see if there are errors and share them.