Brandawg93 / homebridge-nest-cam

View your Nest cams in HomeKit using Homebridge.
https://www.npmjs.com/package/homebridge-nest-cam
GNU General Public License v3.0
212 stars 27 forks source link

[Bug]: nest_token not working #541

Open ralewis85 opened 1 year ago

ralewis85 commented 1 year ago

Describe the bug

I'm using both the Homebridge Nest and Homebridge Nest Cam plugins. The former works, while the latter is not, in homebridge. I am following this part of the guide https://github.com/Brandawg93/homebridge-nest-cam/wiki/Manual-Authentication

This is the same access_token that homebridge-nest uses if you want to grab from existing config

Debug Output

[2/27/2023, 10:40:49 PM] [Nest-cam] Initializing Nest-cam platform... [2/27/2023, 10:40:50 PM] [Nest-cam] Nest authentication failed (code undefined). [2/27/2023, 10:40:50 PM] [Nest-cam] Unable to retrieve access token.

Steps to reproduce

          {
            "nest_token": "<access token>",
            "options": {
                "ffmpegCodec": "libx264",
                "streamQuality": 3,
                "alertCheckRate": 10,
                "alertCooldownRate": 180,
                "alertTypes": [
                    "Motion",
                    "Sound",
                    "Person",
                    "Package Delivered",
                    "Package Retrieved",
                    "Face",
                    "Zone"
                ],
                "importantOnly": true,
                "motionDetection": false,
                "streamingSwitch": true,
                "chimeSwitch": false,
                "announcementsSwitch": false,
                "doorbellAlerts": false,
                "doorbellSwitch": false,
                "audioSwitch": true
            },
            "platform": "Nest-cam"
        }

In comparison I'm using the same access token in Homebridge Nest with the following config, and my thermostat works just fine.

        {
            "name": "Nest",
            "access_token": "<access token>",
            "platform": "Nest"
        }

Device Type

Docker Container

iOS Version

16

Camera Types

Nest Doorbell Wired

Bug Persistence

Consistently

Last Working Version

No response

kennyknight commented 1 year ago

I am also having the same issue:

homebridge-nest-cam v7.5.4

[3/1/2023, 4:31:59 PM] [Nest-cam] Nest authentication failed (code undefined). [3/1/2023, 4:31:59 PM] [Nest-cam] Unable to retrieve access token.

Config excerpt (token masked for security):

{ "nest_token": "g.0.eyJraWQiOiIyMzhiNTUxZmXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXxAwqtcYlx1MDA5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B0iQXx78e-uIkZJyLGMz-iyM5Q", "options": { "ffmpegCodec": "libx264", "streamQuality": 3, "alertCheckRate": 10, "alertCooldownRate": 180, "alertTypes": [ "Motion", "Sound", "Person", "Package Delivered", "Package Retrieved", "Face", "Zone" ], "importantOnly": true, "motionDetection": false, "streamingSwitch": true, "chimeSwitch": false, "announcementsSwitch": false, "doorbellAlerts": false, "doorbellSwitch": false, "audioSwitch": true }, "platform": "Nest-cam" }

Followed the directions in the wiki to the letter but cannot get it to authorize. Am running homebridge-nest v4.6.9 using google auth without issue.

dpacker780 commented 1 year ago

Describe the bug

I'm using both the Homebridge Nest and Homebridge Nest Cam plugins. The former works, while the latter is not, in homebridge. I am following this part of the guide https://github.com/Brandawg93/homebridge-nest-cam/wiki/Manual-Authentication

This is the same access_token that homebridge-nest uses if you want to grab from existing config

Debug Output

[2/27/2023, 10:40:49 PM] [Nest-cam] Initializing Nest-cam platform... [2/27/2023, 10:40:50 PM] [Nest-cam] Nest authentication failed (code undefined). [2/27/2023, 10:40:50 PM] [Nest-cam] Unable to retrieve access token.

Steps to reproduce

          {
            "nest_token": "<access token>",
            "options": {
                "ffmpegCodec": "libx264",
                "streamQuality": 3,
                "alertCheckRate": 10,
                "alertCooldownRate": 180,
                "alertTypes": [
                    "Motion",
                    "Sound",
                    "Person",
                    "Package Delivered",
                    "Package Retrieved",
                    "Face",
                    "Zone"
                ],
                "importantOnly": true,
                "motionDetection": false,
                "streamingSwitch": true,
                "chimeSwitch": false,
                "announcementsSwitch": false,
                "doorbellAlerts": false,
                "doorbellSwitch": false,
                "audioSwitch": true
            },
            "platform": "Nest-cam"
        }

In comparison I'm using the same access token in Homebridge Nest with the following config, and my thermostat works just fine.

        {
            "name": "Nest",
            "access_token": "<access token>",
            "platform": "Nest"
        }

Device Type

Docker Container

iOS Version

16

Camera Types

Nest Doorbell Wired

Bug Persistence

Consistently

Last Working Version

No response

I just ran into the same problem. Since I run Homebridge-Nest for my Thermostat, I found there's actually a different way it has to be done now due to changes that Google has been making changes to the API. If you read the below link on how to connect to Nest it steps you through how to do it, requires a few more steps, but it woks.

https://github.com/chrisjshull/homebridge-nest#using-a-google-account

For Homebridge-nest-cam, I found just replacing the access token section with the settings in the above link bypassed the issue for both plugins. So you'll have something like this:

  {
        "platform": "Nest-cam",
        "options": {
            "ffmpegCodec": "libx264",
            "motionDetection": true,
            "streamingSwitch": true,
            "disableAudio": false
        },
        "googleAuth": {
            "issueToken": "<Your issue token>",
            "cookies": "<Your cookies>"
        }
    },
github-actions[bot] commented 1 year ago

This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 3 days

jradwan commented 1 year ago

Same here. Is this related to the latest Google announcement that the Works With Nest program is being deprecated (along with Dropcams being de-supported)?

In the plug-in, it prompts me to "Click HERE to open the Nest login page." but when I click the link I get:

Access blocked: Nest’s request is invalid

You can’t sign in because Nest sent an invalid request. You can try again later, or contact the developer about this issue.
If you are a developer of Nest, see error details.
Error 400: invalid_request

Details:

Error 400: invalid_request
The out-of-band (OOB) flow has been blocked in order to keep users secure. Follow the Out-of-Band (OOB) flow migration guide linked in the developer docs below to migrate your app to an alternative method.
Request details: redirect_uri=urn:ietf:wg:oauth:2.0:oob
[Related developer documentation](https://developers.google.com/identity/protocols/oauth2/resources/oob-migration)

edit: aargh, nevermind. I forgot about #516. Followed the instructions here and got my cameras working again.

Radstake commented 1 year ago

Quick addition. I could got it to work, but it seems google changed the request url parameters. They have added &include_granted_scopes=true after the home.nest.com . I could not get it to work with the extra scopes parameter. But leaving if out seemed to work.