-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Google Home migration?? #95
Comments
Yes, it will (break your API access). Don't do it unless you find a working alternative that can work with the Google API, if there is such a thing (didn't look). |
UGH!!!! Thank you! Stupid Google forced me to migrate grandma's Nest account to Google Home in order to update/add/delete family members (for Nest Protect notifications). Now I cannot add myself back into grandma's house without migrating my own Nest account over Google Home, which apparently is going to break this thing for my own house's thermostat. I wrote a complex application that uses your API code to dump the thermostat data into my online database to track my tank's fuel oil level, graphs, average daily fuel consumption, etc. I really depend on this system since Nest does not have a usage counter built into it anyplace. My circa 1990 Honeywell actually had a resettable hourly usage meter built into it, so Nest takes a huge step backwards in this area. This system I wrote keeps me from having to dip a stick into the oil tank like a caveman. Thanks Google for effing everything up so badly! |
@sparky672 - I totally agree. The moment Google forces me to switch the account is the moment I head to Costco for the Ecobee 4. |
I like the Nest. Not that I'm opposed to switching... but the amount of time I have invested into my custom data acquisition application is ridiculous. Does Ecobee have a similar API where I can get usage data? |
@gboudreau, I thought your PHP class was accessing the same Nest API server as the Nest App so I'm confused about how this can be broken. Is it a matter of the user account? Once the user account is migrated to Google Home, then the API will reject access to that account, while somehow the Nest App is still able to connect? |
@sparky672 > I like the Nest. Not that I'm opposed to switching... but the amount of time I have invested into my custom data acquisition application is ridiculous. Does Ecobee have a similar API where I can get usage data? I don't mind the Nest. I do mind that my data is being held hostage. It looks like Ecobee's API is much more supported: https://www.ecobee.com/home/developer/api/introduction/index.shtml WRT authentication, I'm betting the Google account authentication uses the Google federated login, not the direct authentication. |
And the part that gets the connection is here. I cannot test this out since I have not migrated my Nest account. My grandmother's account was migrated but she only has Nest Protects. Is there anyone here who already migrated their Nest account to Google, who would be willing to experiment with getting this Nest API project working with the Google tokens? |
I am in the same boat.....and have not migrated my nest account. I have been recording multi zones and calculating oil usage with great success. Even ran a special "smart" script last year that adapted to outside conditions and saved 100 gallons over the season. The homeassistant nest project is also stuck.....they all rushed to open API accounts before the cut off. I am not switching units...so I keep looking for a solution. |
I've just been gathering and displaying usage data and calculating levels. Also wrote a script that tries to predict a refill date based on past usage. Never tried controlling it or gathering outside temperatures. I thought about trying to gather outside temps to display next to usage but didn't seem super useful. What did your script do and how did it save your fuel usage? |
Well...I have hydronic heating / oil /multi zone and live in the mid-atlantic which has variable temps in winter. At first nest saved because it does vary "pre heat" times based on learning of the hydronic system. After looking at my graphs, I realized that on a regular basis the heat was fighting the lowest temps of the day and not running during the highest temps. So the script does a little "heat banking" during the peak temps of the day (even when no one is home) and does a little deferment during the coldest. Not real complicated....just heat bank if outside is above a certain temp / defer heating if outside is very cold and normal schedule the rest of the time. Just taking advantage of the non linear nature of heat loss based on the temperature gradient. In operation it was not real noticeable....occasionally a little warmer / colder in the middle of the night than expected (which mirrored the outside climate). |
Interesting. I have hydronic system too. But I also have variable rate electric, which is basically hourly pricing based on the wholesale market. When electricity is cheap at night, I would crank up the electric heaters and save oil. I thought about tying my application into that but never finished figuring out how to get the hourly electric rates. |
I've migrated my account and it broke access. The badnest project (https://github.com/USA-RedDragon/badnest) managed to get google logins working. |
Yes, please! |
The question is if Guillaume is even interested in modifying the code to fix it, at this point. |
Even if not, we can possibly modify it ourselves. |
True, but I'm more of a bash developer (being a SysAdmin) than a php developer. If you wanna have a crack at it, I'll test it out. |
I just checked the code of badnest; the implementation of how to use a Google account is pretty hackish. Expected, until Google releases better API access (early 2020 for enterprises; maybe later for individuals, if ever). I could try to implement this, but to do so, I would need to migrate my Nest account to a Google account; not sure I want to do that until I'm sure I can make it work... If someone who already migrated could provide me with their "issue_token", "cookie" and "api_key", per badnest's instructions, I could try to implement it using those values. (Of note: those values become unusable as soon as you logout from the Nest website, in the browser window that you used to get them. So I would suggest using a regular browser window, not an Incognito one, to get those values, in order to be able to Logout from this session, once I'm done.) |
Don't post these values publicly though. Please contact @gboudreau through a different medium if you're willing to do so. |
Isn't there a more 'correct' way to get a google authentication token to your account than this way? Wouldn't that method break any time you close the browser you used to get the token? That wouldn't be good for any sort of long-standing system, right? |
No. That's the point. This is not officially sanctioned by Google. You're tricking the API into thinking you're getting access via the Nest app.
My understanding is that you're good for as long as you don't log out of your account. My main browser on my primary computer never asks me to log back into Google... I open Gmail.com and there it is - no login prompt... unless of course I click the "logout" or "switch accounts". I also maintain other Google accounts for clients so I'm guessing if I log into those with a different browser, I wouldn't be disturbing my own Google log in. |
Well, yes, I get the 'unofficial-ness' of accessing nest this way, but I'm talking just standard Google auth tokens. Surely there's some application-level way to obtain them that actually IS official, seeing as it's needed for all the other Google application stuff... right? Using the Nest page as the fake API is the unofficial bit. The Google auth token should be well established since it's been around for a while... right? (Please note: I'm claiming no knowledge of how this stuff actually works. Just asking questions that I don't know the answers to) |
When you login on the Nest website, Google uses your session (OCAK cookie) to know which Google account you are logged in as. Using this info, it can then check if you already granted the Nest website access to your Google account. If not, it prompts. If you already granted access, it will use your OCAK cookie (along with some other tidbits) to get a short-lived access token to use the internal Nest API. Since we, as developers, cannot ask to get access to the internal Nest API from Google, we need to 'steal' the info that the Nest website has been able to get from Google, and use those secrets ourselves to connect to the Nest API, and ourselves get the same short-lived access token that the Nest website is able to get. The process might be simplified somewhat, but we can't use the usual Google API methods of getting an access token; Google are not allowing that. |
I'm not sure either. However, since Google is not yet giving anyone API access to Nest data, I doubt anything official they provide could work. Edit: what Guillaume just said ^^^ As a side note, the whole Google thing is still such a totally convoluted mess (cluster-f***):
|
I pushed some kind of test code in the dev/google-account branch. Sending a post to |
Seems to be working! :) This shows you how to instantiate the class, to provide the new information: 26ac4de#diff-93bc3c03503d8768cf7cc1e39ce16fcb Follow the instructions here to get the required values: https://github.com/USA-RedDragon/badnest#example-configurationyaml---when-you-are-using-the-google-auth-login Make sure, for the cookie value, to provide all the cookies on one line:
@Sal-Tepedino : maybe now would be a good time to logout, and re-login, in your browser! |
Instructions copy & pasted here: The values of "issue_token", "cookie" and "api_key" are specific to your Google Account. To get them, follow these steps (only needs to be done once, as long as you stay logged into your Google Account).
|
Pretty sure the |
Similarly, only the
|
Of note: you'll get this, if the cookie ever becomes invalid (because you logged out, or timed out): $ php test.php
Error: Response to login request doesn't contain required access token. Response: '(object) array(
'error' => 'USER_LOGGED_OUT',
'detail' => 'No active session found.',
)'
$ |
I logged into my grandmother's converted Nest account and cannot find |
Apparently breaking the issue_token does not throw a Here is what I ended up with. Not really sure if/how this can be cleaned up or if it's comprehensive enough.
Seems to be working. |
@gboudreau - can we close this issue? |
Yes... everything seems to be working great! The API is staying logged in and my application has been collecting data as normal. Thank you! |
Everything was working fine until today:
I x'd out the personal info above. I went to Chrome and followed the whole procedure again to regenerate the token and cookie, but I'm getting the same error. |
This issue should be resolved by 8c2dd5c |
Yes! Thank you! |
Everything stopped working today. I don't know what's going on since I'm seeing no PHP errors and nothing being reported back from the API. |
My tokens occasionally need to be renewed, if you haven't done that in awhile. My thermostat and protects are showing online and getting data, but getEnergyLatest is returning false due to a 500 error. It's broken in the Nest app though as well. |
I've had one of my thermostats change it's ID on the nest web page to
'DEVICE_#########' (in the URL) instead of the serial number. The other one
is still the serial number. I can't query the 'DEVICE_' one at all. Doesn't
even show up when I do a blank $nest->getDeviceInfo();
Perhaps related to your issue?
…On Sat, Jan 23, 2021 at 12:22 PM bauzer714 ***@***.***> wrote:
My tokens occasionally need to be renewed, if you haven't done that in
awhile.
My thermostat and protects are showing online and getting data, but
getEnergyLatest is returning false due to a 500 error. It's broken in the
Nest app though as well.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#95 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AELMMQO5TFHBLNGBAQMLZ6DS3MAWDANCNFSM4JA7YR3Q>
.
|
I just tried that and it's not working. I was able to get the new tokens but the result is the same. When following the instructions to use an incognito window, I am now getting a "cookies are blocked" message when attempted to log into my Nest account. This was not an issue when I got the token last. |
What's weird is that I have my program written to catch this. If there is something wrong with the token, it would display this error message. Been working over a year and I can test it by deleting the token parameter. However, as of this morning, I am getting absolutely nothing now.
It's blowing right through this code without showing an error message. I just tested it again by putting in a dummy token and get |
I'm not using my device ID at all. I'm just trying to get my data...
|
The issue is that getEnergyLatest is getting 500 errors from Google and thus you're getting "false" returned. It's not you. The app and the website both tell me I have no data for me after 6+ years. Similar reports across Reddit of missing history data. There is a gap where there is no exception thrown. It's a weird case that I'll look into adding some resiliency to once the functionality is restored. |
I had the same thing today...it is not a token issue since I still get current temp data. the energy data is the specific issue (even on the nest app itself)..... and bauzer714 just typed faster than I did... |
ok THANK YOU! I missed your previous response.
Thank you! |
Pr submitted. #134 |
Nest has fixed the endpoint. I now see data. Estimated fix time 1740 UTC. |
Working here too now. The time it was fixed coincides with my Facebook conversation with Google Nest. I'm not taking any credit since they clearly have no clue... but was funny that it started working between these comments.
|
Stopped working today with a 403 error:
Still have access via app and website. Just no access via this API. Anyone else? |
Are you saying get a new token and cookie? Because this URL and error message are coming from the API, and I have no control over the URL being used or do anything with a cache. It was working fine before today. I will redo token & cookie now. |
That wasn't the intention. Your browser is working, I'd confirm which transport URL the web is using. If it's not the one the API is using, then clear the temp cache of your web server to force the API class to newly login. I'm speculating a bit here, it's been awhile since I've had to look into this part. |
I went back a third time and regenerated another new token and cookie. Now I am getting no errors, but the history dump is completely blank.
06AAxxxxxxxxxxx is the serial number for my Nest Protect |
This code is showing no thermostats.
It's coming back completely blank...
|
Just wanted to clean up this thread a bit... I had the same issue as described here: #115 (comment) Here is what I did to resolve the issue:
Energy dump seems to be working. It's show previous 10 days, with only the most recent day (same day as reset) coming up missing. Will edit this when the history resumes. Notes:
|
Google is pushing hard to get me to migrate my Nest account over to Google Home. Before I do that, can anyone tell me if doing such would break my access to this API?
Thank you!
The text was updated successfully, but these errors were encountered: