Brandawg93 / homebridge-nest-cam_old

Use your Nest Cam as IP camera in HomeKit.
Apache License 2.0
92 stars 14 forks source link

[NestCam]Failed to request access token. Unexpected API Error - 405 #40

Open cbeale opened 5 years ago

cbeale commented 5 years ago

Hi -

Having an issue with NestCam, trying to add it to my existing homebridge setup.

Homebridge starts up and then I get

"[NestCam]Failed to request access token. Unexpected API Error - 405"

I added it as shown in the guide.

Is this known? I saw one person comment about it but no resolution was given.

Thanks

black01gt commented 5 years ago

I had to reboot my Homebridge 20 mins ago and am now getting the same thing. Maybe a Nest issue?

The-Exalted commented 5 years ago

Hi there, having the same issue. Also can't add cameras as accessories in home app.

Novice user here (just started today) but thankful for help.

iandronowicz commented 5 years ago

Worked like charm for more than 5 months, stopped working since yesterday. Restarted homebridge a couple of times but no luck: I think it has something to do with the plugin authentication with near. Something must have changed in the API.

felsmann commented 5 years ago

Glad I jumped on here before I started tinkering, same issue here

morilm commented 5 years ago

HI

Same error here

[NestCam]Failed to request access token. Unexpected API Error - 405

KhaosT commented 5 years ago

The API probably changed recently. I can take a look this weekend.

coxfrederic commented 5 years ago

My camera's stopped updating, I'm not getting any errors but I can only assume it is a general issue, thanks @KhaosT for taking a look at it.

landocarlesien commented 5 years ago

I have the same error

PiLLoX commented 5 years ago

Same issue here !

NajibNour commented 5 years ago

Same here!!

OscarGorog commented 5 years ago

Hey KhaosT,

Having the same issue... When will this be fixed? (when is your weekend) as I love this and would love to keep using it!

Thanks in advance.

malonecentral commented 5 years ago

Same

Rens93 commented 5 years ago

Same here, also tried to delete and add new cameras but now I even can’t add my cameras again :(

QandnotU commented 5 years ago

Same. Glad I came here before I started dismantling Homebridge in the quest to fix. Don't remove the cam as a possible fix, you won't be able to add it back until this gets resolved.

KhaosT commented 5 years ago

Hi, I have created v0.0.12 to fix the issue. Please check the readme and make change to your config accordingly.

cbeale commented 5 years ago

thanks.

im getting

"{"url":"/session","message":"400 Bad Request"}curl: (6) Could not resolve host:" from the curl command however

KhaosT commented 5 years ago

did you copy the whole thing correctly?

cbeale commented 5 years ago

nm. it worked to get token on the pi. was getting that error on macos.

harryohalloran commented 5 years ago

How do I handle a password to generate the token if I have an “!” in my password? Looks like it’s not working correctly due to the character.

On Dec 15, 2018, at 8:40 PM, cbeale notifications@github.com wrote:

nm. it worked to get token on the pi. was getting that error on macos.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/KhaosT/homebridge-nest-cam/issues/40#issuecomment-447613139, or mute the thread https://github.com/notifications/unsubscribe-auth/AHaL3fOx4c-MyshS8fmeJpFiDAQ7It26ks5u5bKhgaJpZM4ZQnMt.

KhaosT commented 5 years ago

I tried with ! and it's working for me... if not, try use %21 in place where it suppose to be !

cbeale commented 5 years ago

I got it added to homebridge and it added the camera as a motion sensor. How can I add it so it shows up with other cameras and displays the video?

Thanks so much for your work!

KhaosT commented 5 years ago

@cbeale if you go to Home app, add new accessory, the camera should show up?

OscarGorog commented 5 years ago

Where did you put the "!" mark?

harryohalloran commented 5 years ago

Strange, after I enter the email and pass with the ! in the pass, here is what I get:

 --data-urlencode “password=passwordpriortotheexclamationpointhomebridge -Ipasswordaftertheexclamationpoint"

{"error":"access_denied","error_description":"invalid user credentials","instance_id":"a97454fe-5a72-43e6-871d-2a874cd94ec6"}

On Dec 15, 2018, at 8:54 PM, cbeale notifications@github.com wrote:

I got it added to homebridge and it added the camera as a motion sensor. How can I add it so it shows up with other cameras and displays the video?

Thanks so much for your work!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/KhaosT/homebridge-nest-cam/issues/40#issuecomment-447613658, or mute the thread https://github.com/notifications/unsubscribe-auth/AHaL3e5ZMW8ULrl84_XYJQd6oGKle-wcks5u5bXggaJpZM4ZQnMt.

OscarGorog commented 5 years ago

where do you put the "!" mark???

KhaosT commented 5 years ago

@harryohalloran I'm confused, where is that -l coming from? the full command should be something like curl -X "POST" "https://home.nest.com/session" -H 'User-Agent: iPhone iPhone OS 11.0 Dropcam/5.14.0 com.nestlabs.jasper.release Darwin' -H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' --data-urlencode "email=a@b.com" --data-urlencode "password=blabla!!!!123"

OscarGorog commented 5 years ago

where do you put the "!" mark??? I can see if it works

NajibNour commented 5 years ago

Works like a charm no issues with (0.0.12 update)

Thank you !!!

cbeale commented 5 years ago

@KhaosT I removed the bridge from my phone and re added it. All 13 accessories connected to the homebridge added/configured themselves and the camera only adds itself as a motion detector and not as a camera.

KhaosT commented 5 years ago

@cbeale if it's configured properly, you should see a separate camera accessory in there. If it's not showing up for you, please open a separate issue so we don't spam everyone else in the thread.

image

harryohalloran commented 5 years ago

All good, looks like a specific combination of characters I had in my password was causing the issue. Changed the password and got it working correctly.

On Dec 15, 2018, at 9:09 PM, Khaos Tian notifications@github.com wrote:

@cbeale https://github.com/cbeale if it's configured properly, you should see a separate camera accessory in there. If it's not showing up for you, please open a separate issue so we don't spam everyone else in the thread.

https://user-images.githubusercontent.com/1725664/50049550-d9c56000-009c-11e9-90e3-4ae26de6d351.png — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/KhaosT/homebridge-nest-cam/issues/40#issuecomment-447614316, or mute the thread https://github.com/notifications/unsubscribe-auth/AHaL3degfrQMilC6W_0DB8nzIlfTVkgqks5u5bligaJpZM4ZQnMt.

black01gt commented 5 years ago

Thanks everything works great now.

I did notice in the output it stated expires in Jan 15 right after the token. guess ill have to get a new token then?

"expires_in":"Tue, 15-Jan-2019 03:39:52

KhaosT commented 5 years ago

@black01gt Huh this is interesting... I'm not seeing the expires_in for access_token for account with 2FA enabled, and I'm not exactly sure if there is a way to refresh access token automatically... Please report back if this stop working after the expiration date.

black01gt commented 5 years ago

I don't have 2FA enabled. Should I enable it and get a new token?

KhaosT commented 5 years ago

If you hate manually refresh token every month, maybe give that a try?

black01gt commented 5 years ago

Thanks again. all set.

iandronowicz commented 5 years ago

I cannot get the token with 2fa enabled: I get {"status":"INVALID_INFO"}

iandronowicz commented 5 years ago

Never mind: it was character error, I was copying and pasting the code in Notes, and it changed the " char to another thing... I got the access token now, but Homebridge crashes and says:

ERROR LOADING PLUGIN homebridge-nest-cam: [12/16/2018, 1:50:21 AM] Error: Cannot find module './Hello.js'

iandronowicz commented 5 years ago

again, if anyone finds the same errors as me: I tried uninstalling the npm package and re installing it. It wouldn't install with sudo (as I always do it) I tried without sudo and it worked.

WORKING, thanks!!

Rens93 commented 5 years ago

[NestCam]Failed to request access token. Unexpected API Error - 403

When I use the code in terminal I get the next error:

{"url":"/session","message":"400 Bad Request"}/homebridge #

morilm commented 5 years ago

All working fine with 0.12 version...

I have used the curl command on this post as the one in the github didn't worked for me.

waxlabo commented 5 years ago

I got the access_token but I am not sure how to read it? Does it end before / or "?

waxlabo commented 5 years ago

Oh nevermind. I was copying the wrong access_token all along.

coxfrederic commented 5 years ago

This is not working for me. I added my access token without and afterwards with 2FA but both are not working. I'm not getting any errors ... what can be wrong? I get an access token returned but it does not seem to be valid

coxfrederic commented 5 years ago

Do I need a Nest API developer account or something?

coxfrederic commented 5 years ago

My access token is something like - [Tian: Removed access token]

KhaosT commented 5 years ago

@coxfrederic can you create an new issue in this project and post log homebridge print at start?

QandnotU commented 5 years ago

I've updated the plugin and regenerated the token and added it to the config. All looks good in Homebridge, but I'm having trouble adding the camera back in. Any tips and tricks would be greatly appreciated.

KhaosT commented 5 years ago

@QandnotU can you create a new issue in this project and post log homebridge print there?

felsmann commented 5 years ago

[NestCam]Failed to request access token. Unexpected API Error - 403

When I use the code in terminal I get the next error:

{"url":"/session","message":"400 Bad Request"}/homebridge #

I am having this issue as well, how did you resolve it?