Skip to content
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

Month and second Week chart and export incomplete for March of any year #15

Closed
peppersass opened this issue Jan 30, 2024 · 3 comments
Closed

Comments

@peppersass
Copy link

Strange issue. Chart and export for Month of March, any year, displays/contains the header and only data for the first day of April. Chart and export for the second week of March, any year, contains the header and only data for first day of the following week. Month exports work properly for all other months of the year. Haven't verified if that's also true for second Week exports for other months, but willing to bet it is. [I checked March of 2021, 2022 and 2023, the only years for which there's data for my installation.]

I don't see anything obvious in the FetchEnergy or Export code that could cause this. I'd insert breakpoints to check what goes to Tesla and what comes back, but I'm having some issues Debugging the app under VS. Working on that.

Anyway, sounds like it could be a problem with Tesla's database or server. If you determine that's the case, do you have a support contact to report it?

Beware the Ides of March!

Note: I use the Month energy data to calculate energy flow and cost if I were to discontinue my utility's battery program and go back to Fixed rates (i.e., whether the batteries save money.) I'm working on using energy flow to calculate cost savings from solar, but that's more complicated. Unfortunately, I can't fill in the missing March data from the Tesla app. It only provides Power data for Month and Week, not Energy data. That brings up a question: Is it possible to get Energy data for a Day? If so, I'd suggest having a checkbox on the Chart page to select export of either Power or Energy data.

@peppersass
Copy link
Author

On further investigation, I believe this is a PowerWall Companion bug. In the course of trying to solve issues setting up my own version of the app (see below), I stumbled across the Netzero app (iOS, Android and Web versions.) I used the web version of Netzero to downloaded my Energy data for March 2023, and it was complete.

To answer the question I posted about downloading Energy data for a Day, it turns out Netzero can do that. In fact, it only downloads Energy data for all time periods. FWIW, the data provided by the Power alternative can be derived from the Energy data.

BTW, I managed to setup a developer account, get the client ID, secret, etc., and was able to run PowerWall Companion up to the point where it did the first API calls. It fails saying the app must be registered in the current region. After reading the rather opaque Tesla doc and poking around online, I've been unable to determine what needs to be done to fix that. Between this problem and the SyncFusion license problem, I'm giving up on customizing the app. For now, I'll just use Netzero to fill in the missing data.

@tomhollander
Copy link
Owner

Hey, thanks for the additional info. I don't think this is so much a bug in Powerwall Companion as a bug in the Tesla APIs that Powerwall Companion uses. I understand that NetZero uses a different API which is not documented and I haven't yet figured out how to use.

@tomhollander
Copy link
Owner

Fixed in v5.3.2. Turned out to be caused by the transition to daylight savings time - the URL needed to use different time zone offsets for the start and end dates. Relevant code changes: https://github.com/tomhollander/PowerwallCompanion/blob/master/PowerwallCompanion/ChartPage.xaml.cs#L160

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants