Welcome to Tesla Motors Club
Discuss Tesla's Model S, Model 3, Model X, Model Y, Cybertruck, Roadster and More.
Register

Is there a log of the Powerwall Battery Percentage?

This site may earn commission on affiliate links.
I have had my existing PV + PowerWall installation running for a little over a month.
I have reviewed the available downloaded data.
I have made note of the battery percentage shown on the app at a few different times of day.
Is that percentage logged anywhere?
Because I have TOU - Cost set I have some understandable oddities in the charge/discharge during the week.
I'd like to be able to track the percentage of charge during the day.

I had one Saturday where I was recovering from heavy TOU-Peak usage the previous day.
I saw that the battery hit my 16% reserve, and then the following day, it charged fully, so I could manually estimate my total battery capacity.

I don't see the information in the logs. Is it available from the API, maybe in one of the custom web pages that people have built?
 
You can pull the current capacity estimate from the API but unless you're doing it periodically, like I'm doing, and logging it yourself, I don't think you'd have access to historical capacity likely logged by Tesla but not available through the API.
 
I have had my existing PV + PowerWall installation running for a little over a month.
I have reviewed the available downloaded data.
I have made note of the battery percentage shown on the app at a few different times of day.
Is that percentage logged anywhere?
Because I have TOU - Cost set I have some understandable oddities in the charge/discharge during the week.
I'd like to be able to track the percentage of charge during the day.

I had one Saturday where I was recovering from heavy TOU-Peak usage the previous day.
I saw that the battery hit my 16% reserve, and then the following day, it charged fully, so I could manually estimate my total battery capacity.

I don't see the information in the logs. Is it available from the API, maybe in one of the custom web pages that people have built?

do you have an iPhone? do you use HomeKit? if you set up a homebridge server you can use the package called homebridge-tesla-powerwall:


this code incorporates "fakegato" which is a reverse-engineered ElGato Eve history database. the homebridge package stores up all the powerwall stats locally (or in cloud file storage) and then when you open the Eve app and look at the various devices that the package exports, the history is pulled into the iPhone app as well.

the only weirdness is that it tracks the powerwall SOC as a celsius temperature, 0-100C. this is so that the eve app holds the history. unfortunately the temperature unit setting in HomeKit is global, so if you need F temperatures everywhere else, you'll have to live with the eve "temperature" history for the powerwall SOC reading 212F to 0F.
 
  • Like
Reactions: kairojya
Fakegato is what I needed to read about this morning...

1625584298469.png
 
well then setting up PVOutput would be your next best option.
I don't see anything about battery percentage there.

My SolarEdge provides logging of my production.
Tesla provides logging of my PV production as well.
Tesla provides my home usage, battery usage, grid usage, and the PV production.
What I want to see is a log of the current battery percentage.

I can see some statistics from a Windows browser, but I haven't tried getting a token in order to read that with python to capture my own log.
<edit> The samples in this forum are deprecated.
has the newer authorization. I'm not going to pursue that.
</edit>
I'm at 100% on a Sunday morning, since yesterday was all off-peak.
"nominal_full_pack_energy":27521,
"nominal_energy_remaining":27521,
 
Last edited:
you need to set up this package:


all the interesting stuff shows up in the extended data fields:

Screen Shot 2021-07-11 at 9.31.15 AM.png


that is what happened in my system yesterday.

edit: i am not sure if that script has been updated for the new login token stuff. however, someone did hack the script and post a version in the PVOutput forums. also there's an official Java version made by the PVOutput guy himself:


somewhere on the PVO forum someone did hack Powerwall2PVOutput to handle the new authentication, though i do see in the GitHub repository above there seem to be some commits around authentication. not sure if that is the same as the new token-based authentication though.
 
Last edited:
I just pull it every few minutes from the gateway using a simple PS script and plot it out. The anomaly on Friday was that I only check for token expired and that was the day Tesla decided to downgrade the firmware resulting in an unexpected response until I manually created a new token. (Yes I know it should be watts*100 - just can't be arsed to correct the text)

socweek.png
 
  • Like
Reactions: astrorob
I set up the local PW_Datalogger.py from Powerwall2PVOutput
That gathers some data to an sqlite database. I can extract that to provide the simple graph I want to see.

It also exposes how unstable my Powerwall Gateway connection is.
On a fairly regular basis, I get several HTTPSConnectionPool errors, that usually self-heal.
Today, I discovered that I wasn't gathering data, just "Sleeping 5 minutes" messages every five minutes for a few days.
I would think that both of these would be handled gracefully in the python code. Maybe "something else" should be done after sleeping five minutes for some length of time.
For now, I have wrapped a Linux cron script to send email to me if I get 10 sleeps in the log, or 10 Connection errors, within an hour.
I don't know what is causing today's sleeps from an "except Exception" in the code.

I looked at adding my solar PV and Powerwall to the PVOutput site, but that looked like it required more than 20 minutes of my attention, so I decided to just work locally, but if there is a dummy tutorial on setting up the PVOutput site, I would do that. I'd share some data, and see much prettier charts.

Generating my simple chart occasionally is probably more time consuming that joining PVOutput, but I know my steps.
 
Are you using wired or WiFi.
I have a WiFi extender with some LAN ports just on the inside of the wall where the Powerwall is mounted. It didn't stay connected via WiFi to that extender very well at all. I connected the WiFi to the router in another room, and it is much more stable.

I don't want to poke a hole in the wall to run a wire to the gateway. Other than my local logging, how would I know the WiFi connection is dropping, or even running on cellular most of the time? I suppose the Tesla app data is buffered. My router was down for a few hours, and there's no gap in the Tesla app.
 
I set up the local PW_Datalogger.py from Powerwall2PVOutput
That gathers some data to an sqlite database. I can extract that to provide the simple graph I want to see.

It also exposes how unstable my Powerwall Gateway connection is.
On a fairly regular basis, I get several HTTPSConnectionPool errors, that usually self-heal.
Today, I discovered that I wasn't gathering data, just "Sleeping 5 minutes" messages every five minutes for a few days.
I would think that both of these would be handled gracefully in the python code. Maybe "something else" should be done after sleeping five minutes for some length of time.
For now, I have wrapped a Linux cron script to send email to me if I get 10 sleeps in the log, or 10 Connection errors, within an hour.
I don't know what is causing today's sleeps from an "except Exception" in the code.

I looked at adding my solar PV and Powerwall to the PVOutput site, but that looked like it required more than 20 minutes of my attention, so I decided to just work locally, but if there is a dummy tutorial on setting up the PVOutput site, I would do that. I'd share some data, and see much prettier charts.

Generating my simple chart occasionally is probably more time consuming that joining PVOutput, but I know my steps.

i ran that code for months without problems until authentication was required to get the stats. at that time someone posted a hack to the PVO forums which i have been using since then:


however it looks like the original was updated to play nice with the new auth scheme as well.

i sometimes see errors that cause the hacked script to terminate, but i just launch it inside a while loop and so it restarts with no problems.

i don't know if it can be said with 100% certainty that the wifi connection is your problem. for my part i am using wifi and the base station is not necessarily close to the TEG, but the network i am using is lightly loaded and is dedicated to IoT garbage.

i'm not sure about a tutorial for PVO, but the PW2PVO GitHub site gives the screenshots of how it expects PVO's extended data fields to be configured to mesh with the script. beyond that i think pretty much all you have to do is create an account on PVO, then create a system on PVO, get the API key and system ID for your system and put those into the python script. the rest of the time sink on PVO would be entering tariffs etc. but that is optional.
 
  • Like
Reactions: ClarDold
I have a WiFi extender with some LAN ports just on the inside of the wall where the Powerwall is mounted. It didn't stay connected via WiFi to that extender very well at all. I connected the WiFi to the router in another room, and it is much more stable.

I don't want to poke a hole in the wall to run a wire to the gateway. Other than my local logging, how would I know the WiFi connection is dropping, or even running on cellular most of the time? I suppose the Tesla app data is buffered. My router was down for a few hours, and there's no gap in the Tesla app.
In my case I just could not bring up the gw web browser reliably. With the extender it seems to work 100% of the time. My cheap router shows both the assigned IP address of the wired connection and the DHCP assigned wireless one. Any either address works when it's connected via the ethernet extender and cable.
 
  • Like
Reactions: ClarDold
I just pull it every few minutes from the gateway using a simple PS script and plot it out. The anomaly on Friday was that I only check for token expired and that was the day Tesla decided to downgrade the firmware resulting in an unexpected response until I manually created a new token. (Yes I know it should be watts*100 - just can't be arsed to correct the text)

socweek.png
Hi, What FW are you currently on? My PW upgraded to 21.20.2 and broke my PS script that I was using to access it’s SOC as in your post. I’ve not solved the latest authentication issues yet.