gboudreau / nest-api

Unofficial Nest Learning Thermostat API
GNU Lesser General Public License v3.0
299 stars 92 forks source link

Google changed one of my two thermostats. No longer shows up with getDevices #135

Closed Sal-Tepedino closed 3 years ago

Sal-Tepedino commented 3 years ago

A week ago, one of my two thermostats stopped reporting data. Investigating showed that it seems to be gone when querying with var_dump($nest->getDevices()); Which lists just one. When selecting the thermostats on the Nest website, one is shown as /thermostat/SERIALNUMBER while the other shows as /thermostat/DEVICE_HEXADECIMAL where the Hex number is not that device's serial number. Attempting to replace the serial with the DEVICE_number didn't work.

bauzer714 commented 3 years ago

@Sal-Tepedino - Unfortunately mine is still using serial so I don't have live data to work with. Can you open Chrome Developer tools and go to the "Network" tab, Type "app_launch" into the top left search box and then expand "updated_buckets" once it updates? The code requires that the keys have a period in them, which is what is used to split to get the device serial. I'm curious what they updated it to.

image

Sal-Tepedino commented 3 years ago

It only seems to show one of the devices. Both are shown on the page, though.

On Mon, Jan 25, 2021 at 4:36 PM bauzer714 notifications@github.com wrote:

@Sal-Tepedino https://github.com/Sal-Tepedino - Unfortunately mine is still using serial so I don't have live data to work with. Can you open Chrome Developer tools and go to the "Network" tab, Type "app_launch" into the top left search box and then expand "updated_buckets" once it updates? The code requires that the keys have a period in them, which is what is used to split to get the device serial. I'm curious what they updated it to.

[image: image] https://user-images.githubusercontent.com/13224936/105769048-39a0bd00-5f2b-11eb-96d7-fe3d0a05407d.png

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/gboudreau/nest-api/issues/135#issuecomment-767128372, or unsubscribe https://github.com/notifications/unsubscribe-auth/AELMMQNYO6ZZOSNNBAGGYPDS3XP4XANCNFSM4WSMJDZA .

zecanard commented 3 years ago

Please see https://github.com/gboudreau/nest-api/issues/115#issuecomment-596142188. I faced this exact issue last year, and the solution was to reset the Works With Nest connection.

Note that this will erase your thermostat’s history associated to your home, unfortunately.

bauzer714 commented 3 years ago

Thanks @zecanard - this seems like a pain. Hopefully it doesn't occur very often.

Sal-Tepedino commented 3 years ago

That did it. It's back to using the serial number instead of the device ID. What's that all about? It just randomly changed one day.

Thanks!

On Mon, Jan 25, 2021 at 5:04 PM bauzer714 notifications@github.com wrote:

Thanks @zecanard https://github.com/zecanard - this seems like a pain. Hopefully it doesn't occur very often.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/gboudreau/nest-api/issues/135#issuecomment-767143648, or unsubscribe https://github.com/notifications/unsubscribe-auth/AELMMQMGIEC3EY2BTA3DBO3S3XTIDANCNFSM4WSMJDZA .

knappster1 commented 3 years ago

I know this issue is closed, but the last time my hourly script worked was at 10 pm central time on Feb 5, so it leads me to believe that around 12 am on Feb 6 that something changed for me. I don't know what the URL used to be, but it is DEVICE_HEX for me at the moment. I only have one nest device, which is the thermostat and I already migrated to google about a year ago, so it is slightly different than @Sal-Tepedino and @zecanard but I've verified the issueToken and cookies are correct multiple times.

Sal-Tepedino commented 3 years ago

If when you view the thermostat on Nest's page the URL has 'DEVICE_IDHERE', where it's the device ID and not the serial, that's what happened to me. After I fixed it on one thermostat, it happened on the other one. The only fix I've found is: Remove the thermostat from the Nest App, then in the thermostat's interface, 'Reset WWN connection' (the exact place this is escapes me, but it's not hard to find). Then re-add the thermostat in the nest app, just like it was a new device.

Not an elegant solution, but it works.

On Tue, Feb 9, 2021 at 9:00 AM knappster1 notifications@github.com wrote:

I know this issue is closed, but the last time my hourly script worked was at 10 pm central time on Feb 5, so it leads me to believe that around 12 am on Feb 6 that something changed for me. I don't know what the URL used to be, but it is DEVICE_HEX for me at the moment. I only have one nest device, which is the thermostat and I already migrated to google about a year ago, so it is slightly different than @Sal-Tepedino https://github.com/Sal-Tepedino and @zecanard https://github.com/zecanard but I've verified the issueToken and cookies are correct multiple times.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/gboudreau/nest-api/issues/135#issuecomment-775958566, or unsubscribe https://github.com/notifications/unsubscribe-auth/AELMMQMKSOOCJTJNJMNLCBTS6E5ZTANCNFSM4WSMJDZA .

zecanard commented 3 years ago

Then this answers the question as to whether this issue can affect Google accounts as well. I had a suspicion that it could, but so far we’d only seen it on legacy Nest accounts. I really have no idea what causes it. It just happens out of the blue for a handful of people.

Sal-Tepedino commented 3 years ago

My account is a Google Account. I migrated it ... last year I think.

On Tue, Feb 9, 2021 at 12:59 PM Phong Le notifications@github.com wrote:

Then this answers the question as to whether this issue can affect Google accounts as well. I had a suspicion that it could, but so far we’d only seen it on legacy Nest accounts. I really have no idea what causes it. It just happens out of the blue for a handful of people.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

knappster1 commented 3 years ago

@Sal-Tepedino yes, the URL is: https://home.nest.com/thermostat/DEVICE_ (followed by 16 hex characters). When I use the script I get an undefined offset: 0 on line 999 of the current nest.class.php file (followed by a slew of other errors). I did a var_dump on $status just after line 1095 and it definitely has my account information, so I am sure that it is able to access my account, but I'm really not sure how to parse the data otherwise. I'm not ready to say that resetting WWN will fix it, but I intend to try this evening and report back. By the way, I saw the WWN reset last night by going to the thermostat, settings, reset, and scrolling down. I almost tried it last night, but there was lengthy warning and I thought I would sleep on it first.

zecanard commented 3 years ago

@Sal-Tepedino Ah, my mistake for assuming 🙃

Sal-Tepedino commented 3 years ago

It sounds daunting with their warning, but there's nothing to it. You delete it from your app, reset WWN, then re-add it to the app. Takes a few minutes and it starts showing up in the var dump again.

On Tue, Feb 9, 2021 at 1:08 PM knappster1 notifications@github.com wrote:

@Sal-Tepedino https://github.com/Sal-Tepedino yes, the URL is: https://home.nest.com/thermostat/DEVICE_ (followed by 16 hex characters). When I use the script I get an undefined offset: 0 on line 999 of the current nest.class.php file (followed by a slew of other errors). I did a var_dump on $status just after line 1095 and it definitely has my account information, so I am sure that it is able to access my account, but I'm really not sure how to parse the data otherwise. I'm not ready to say that resetting WWN will fix it, but I intend to try this evening and report back. By the way, I saw the WWN reset last night by going to the thermostat, settings, reset, and scrolling down. I almost tried it last night, but there was lengthy warning and I thought I would sleep on it first.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/gboudreau/nest-api/issues/135#issuecomment-776132719, or unsubscribe https://github.com/notifications/unsubscribe-auth/AELMMQKN3L73WQUA6VGN6ZDS6F2YTANCNFSM4WSMJDZA .

knappster1 commented 3 years ago

Reset WWN and everything is back to normal now. Thanks for sharing your experiences and helping to resolve this. The navigation was: Settings (gear icon) Reset WWN Connection

sparky672 commented 3 years ago

Please see #115 (comment). I faced this exact issue last year, and the solution was to reset the Works With Nest connection.

Note that this will erase your thermostat’s history associated to your home, unfortunately.

I went through this procedure as detailed in #115 (comment). Deleted thermostat from the account, reset the WWN, and added it back to the account. From what I am seeing, none of my prior history data was lost.

EDIT: Seems that only one day of history was lost. The day that I did this WWN reset is completely missing from the energy dump.