tomhollander / PowerwallCompanion

Windows UWP app for monitoring your Tesla Powerwall 2 battery
9 stars 7 forks source link

Telsa info missing in License.cs #16

Closed peppersass closed 7 months ago

peppersass commented 7 months ago

While waiting for your answer on whether an Energy export file can be generated for a Day, I decided to try it by adding the line "await SaveEnergyInfo(file);" under ViewModel.Period == "Day" in exportButton_Tapped in ChartPage.xaml.cs. I can get the app to build and run, but it fails to authenticate because all of the Telsa license constants in License.cs are set to null.

The comment on TeslaAppClientId is "Register an app at developer.tesla.com", so I created a Tesla developer account. But is it OK for me to register PowerWall Companion under my developer account? Also, it says I need to specify OAuth grant details for the app, as well as select API and Scopes, neither of which I know. If you're OK with source users registering the app with Tesla, can you provide that information?

Needless to say, none of this was necessary with previous versions, at least up to v3.6. I believe I was able to build and run v4.7, too, but don't have those versions anymore. Is this is a new Tesla authorization requirement?

tomhollander commented 7 months ago

Yes this is how Tesla's new Fleet API works. I know it's not ideal for people who want to tinker with the app, but it's out of my control (the old owners API will stop working soon).

You are free to register your own Powerwall Companion app on the Tesla developer site and use your own keys. The client ID and secret will be shown to you in the portal; the redirect URI can be anything (eg test://test). Note there are a few steps required to properly register the app - this is described in Tesla's developer docs and I won't be providing any support here.

peppersass commented 7 months ago

Thanks, Tom. Looks like everything I need to know can be found here: https://www.tesla.com/developer-docs. Completely understand your position on support.