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

Discussion: How to get status information from your Powerwalls

This site may earn commission on affiliate links.
I'd like to have a spreadsheet to track solar data and a TMC search brought me to this excellent thread. Since I didn't find a simple spreadsheet I thought it would be nice if TeslaFi applied their skills to a branch of the program dedicated to Tesla Energy. I just submitted a request at TeslaFi asking if they would consider creating a solar version of TeslaFi to track solar panels/roof and Powerwalls. Please consider upvoting it on TeslaFi. Here is a link.
 
Last edited:
Does anyone have an updated method to access this data to determine degradation?

This post:


Has several dead links.
 
Does anyone have an updated method to access this data to determine degradation?

Well, depends on what you are trying to do. Are you trying to retrieve the current capacity of your PW2 and track it over time?

The “simplest” way is to use the API for the local PW2 Gateway via a web browser (or coding equivalent thereof). You need to find the IP address of your Gateway on your local network (often something like 192.168.0.xxx or 10.0.1.xxx) - the admin page of your home internet Router should reveal it as one of the connected devices (TEG - Tesla Energy Gateway).

Open a web browser and go to that IP address (https://192.168.0.xxx). The device you are using for your web browser must be connected to the same network as the PW2 Gateway e.g. WiFi to the same modem your Gateway is connected to. You will be asked to enter your Tesla account email address and the password is the last 5 characters (numbers & letters) of the serial number of your Gateway. You’ll then get a status screen like this:

IMG_0580.jpeg



To get the current system status parameters, you need to type this address in the address bar of your web browser:

This will return a JSON object containing a bunch of system status parameters. One of them is “nominal_full_pack_energy”, which is the current capacity of your PW2 in Watthours. Mine currently shows 9912 or 9.912 kWh.

All this can be automated if you know how to code, and it doesn’t rely on the Tesla API which appears will be locked down in the coming months to support paid access only.
 
  • Helpful
Reactions: n.one.one
Well, depends on what you are trying to do. Are you trying to retrieve the current capacity of your PW2 and track it over time?

The “simplest” way is to use the API for the local PW2 Gateway via a web browser (or coding equivalent thereof). You need to find the IP address of your Gateway on your local network (often something like 192.168.0.xxx or 10.0.1.xxx) - the admin page of your home internet Router should reveal it as one of the connected devices (TEG - Tesla Energy Gateway).

Open a web browser and go to that IP address (https://192.168.0.xxx). The device you are using for your web browser must be connected to the same network as the PW2 Gateway e.g. WiFi to the same modem your Gateway is connected to. You will be asked to enter your Tesla account email address and the password is the last 5 characters (numbers & letters) of the serial number of your Gateway. You’ll then get a status screen like this:

IMG_0580.jpeg



To get the current system status parameters, you need to type this address in the address bar of your web browser:


This will return a JSON object containing a bunch of system status parameters. One of them is “nominal_full_pack_energy”, which is the current capacity of your PW2 in Watthours. Mine currently shows 9912 or 9.912 kWh.

All this can be automated if you know how to code, and it doesn’t rely on the Tesla API which appears will be locked down in the coming months to support paid access only.
Thanks for the details! To clarify, the password the last 5 digits of the "TSN" value? And not the "Paswsord" value underneath on the gateway sticker?
For what it's worth, neither of these values worked...also, the 'change password" link requires you to enter the current password???

Edit: got it. It's actually just the last 5 digits of the "password" value.
 
All this can be automated if you know how to code, and it doesn’t rely on the Tesla API which appears will be locked down in the coming months to support paid access only.
@Vostok can you expand on this impending API lockdown. My use of the Powerwall depends entirely on being able to set the mode and backup reserve percentage using the API, the Tesla algorithm is unable to predict my weather (for solar generation) or domestic consumption adequately especially over winter. Do you have information that API access via the cloud (Tesla "mothership") is going to be blocked?
 
Since I've spent some time looking at Tesla's API, I can provide some more context here. There are currently three different APIs: Owner API, Fleet API, and Gateway API.

1) Tesla Owner API

This is Tesla's "cloud" API. It's what the official Tesla app uses to monitor and manage your cars and solar/powerwall system. It's not documented by Tesla, but has been mostly reverse-engineered (API documentation). You log in using your Tesla credentials and issue API tokens. This is what third-party services use today (e.g. TeslaFi for cars or Netzero App for solar/powerwall). There are also open-source projects that allow you to authenticate and use the API, e.g. TeslaPy.

Tesla recently announced a new Fleet API to make this an official API. In the announcement they mentioned the Owner API is reaching end of life some time in 2024.

2) Tesla Fleet API

The newly announced API. Currently free, but they will announce pricing tiers in 2024 (hopefully including a free tier).

One issue: there are no energy APIs currently documented in the Fleet API, only vehicle APIs. However there are hints in the documentation that energy support is coming, e.g. the energy_device_data authorization scope for OAuth.

3) Gateway API

This is the API and UI used when connecting directly to the Tesla Gateway or Powerwall+ (either on your local network or using the TEG wifi network). It's what Tesla recommends using when offline. Powerwall-Dashboard uses this API to generate charts, and Netzero App has a section that uses this API too. Installers use the UI to monitor and commission systems.

The API has also been reverse engineered (API documentation). You can also use pypowerwall to programmatically access it. This API can get your realtime energy flow, detailed information about your system (e.g. Powerwall degradation or solar string production). It can also control some aspects of the system like battery reserve and mode (note for @xWren).

Tesla has made the gateway UI a bit less accessible in their push to get installers to use the Tesla Pros app. But hopefully the API remains accessible.
 
Since I've spent some time looking at Tesla's API, I can provide some more context here. There are currently three different APIs: Owner API, Fleet API, and Gateway API.

Nice summary, have a recommend from me!

One issue: there are no energy APIs currently documented in the Fleet API, only vehicle APIs. However there are hints in the documentation that energy support is coming, e.g. the energy_device_data authorization scope for OAuth.

I think it’s more than a hint… the Fleet API docs say:

Energy Product Information: energy_device_data will enable access to Energy flow history, saving forecast, tariff rates, grid import, calendar, site status, time of use, and ownership.

Energy Product Commands: energy_cmds will enable commands like update storm (but presumably also enable every other command one can issue to a PW2 under the Owner API. Otherwise, what would be the point?).

OK, full control of PW2 is not guaranteed at this point, but I’d be bold enough to predict it will come.
 
@offandonagain thank you for that great summary.

@offandonagain pointed me at the Gateway API as a route to controlling some aspects such as Powerwall reserve percentage and mode, and I would love to be able to control the hardware that I own locally rather than via the cloud. Lack of local control is a huge design flaw since the cloud servers are not always accessible e.g. internet outages (my end), server outages (Tesla end).

However my understanding is that to change a setting locally I have to also power cycle the system. Maybe Tesla introduced this in an effort to keep the cloud as the master or at least in sync? Since I use automated scripts to change settings twice a day - at 0:31 and 4:29 forcing the Powerwall to charge from grid in my cheap tariff period to suit my anticipated usage and solar generation - it isn't viable to bump the system power.

But perhaps I am wrong, if I am then someone please tell me.

Energy Product Commands: energy_cmds will enable commands like update storm (but presumably also enable every other command one can issue to a PW2 under the Owner API. Otherwise, what would be the point?).

OK, full control of PW2 is not guaranteed at this point, but I’d be bold enough to predict it will come.
@Vostok I can only hope that Tesla Owner API isn't deprecated before full control of PW2 is supported by Fleet API, and that there is a free owner tier. The when is a question, Tesla dates so often slip (or they publish broken stuff). They have recently messed about with the Tesla Owner API removing 'powerwalls' endpoints, using energy_sites instead, perhaps part of a release plan.
 
However my understanding is that to change a setting locally I have to also power cycle the system. Maybe Tesla introduced this in an effort to keep the cloud as the master or at least in sync?

Ah, looks like Tesla has been making changes here and it's no longer easy to set mode and backup reserve with the gateway API. However, the new Tesla Pros app can change these settings, and in my case at least does not require flipping the Powerwall switch. The new API will need to be decoded first though.

@Vostok I can only hope that Tesla Owner API isn't deprecated before full control of PW2 is supported by Fleet API, and that there is a free owner tier. The when is a question, Tesla dates so often slip (or they publish broken stuff). They have recently messed about with the Tesla Owner API removing 'powerwalls' endpoints, using energy_sites instead, perhaps part of a release plan.

I got in touch with Tesla's engineering team and was assured that (1) energy endpoints are coming to the Fleet API and (2) Owner API will not be deprecated until that happens. No details on timeline or content though.
 
  • Like
Reactions: xWren
My newly installed PW2 charges full to 15,140 Wh. Maybe its just a question of watching that and working out the degradation over time because I would assume that it will start to lower the max it can charge over time. This value is coming from Home Assistant which uses the API to get this as opposed to just the %, which the Tesla app shows.
 
Nice summary, have a recommend from me!



I think it’s more than a hint… the Fleet API docs say:

Energy Product Information: energy_device_data will enable access to Energy flow history, saving forecast, tariff rates, grid import, calendar, site status, time of use, and ownership.

Energy Product Commands: energy_cmds will enable commands like update storm (but presumably also enable every other command one can issue to a PW2 under the Owner API. Otherwise, what would be the point?).

OK, full control of PW2 is not guaranteed at this point, but I’d be bold enough to predict it will come.
The energy endpoints have worked in the Fleet API for the last month or so but were undocumented. Today I noticed they are finally described in the docs: Tesla Fleet API

Interestingly they don't document either calendar_history?kind=power or telemetry_history?kind=graph, even though they both work. The latter returns an encoded protobuf which I haven't figured out how to use yet, but it's what the Tesla app uses to build the historical graphs.
 
Last edited:
My Gateway (23.36.3) disabled local access with this message:

Switch to Tesla Pros for a better commissioning experience​

The current experience is no longer supported

It is the same while connected through TEG* or local network. Is there a workaround or cloud access is the only option available?
 
  • Informative
Reactions: Vostok
My Gateway (23.36.3) disabled local access with this message:

Switch to Tesla Pros for a better commissioning experience​

The current experience is no longer supported

It is the same while connected through TEG* or local network. Is there a workaround or cloud access is the only option available?

Interesting… I’m still on 23.28.2 so I don’t know.

All my PW2 scripts use the Owner API so I won’t be affected until the Owner API is decommissioned. I’m hoping there will be a free tier in the Fleet API and I will port my scripts over.
 
My Gateway (23.36.3) disabled local access with this message:

Switch to Tesla Pros for a better commissioning experience​

The current experience is no longer supported

It is the same while connected through TEG* or local network. Is there a workaround or cloud access is the only option available?
Click Continue and then click Upgrade Later and you'll be back to the normal screen.
 
  • Like
Reactions: Will792
Really don’t know why they can’t just let us keep the same local access as before, perhaps with a api-key…
Seems like there is local access thru app for off grid and no internet access. App asks you to pair device to powerwall first time you go off grid, or at least it use to.
If we all start hitting Tesla’s web site it will be a lot off bandwidth, so would be best to keep local access for mining data.
 
Last edited:
The Fleep API replaces the "cloud" API (aka Owner API) which is what the Tesla app uses (and also Netzero app); not the Gateway API which is what Powerwall-Dashboard uses. I wrote in more detail about the different APIs here: Discussion: How to get status information from your Powerwalls

The Gateway API has unfortunately been getting less useful over time: they removed some APIs in the latest firmware version and completely disabled access for Powerwall 3 unless the TEG wifi is used.
 
Really don’t know why they can’t just let us keep the same local access as before, perhaps with a api-key…
Seems like there is local access thru app for off grid and no internet access. App asks you to pair device to powerwall first time you go off grid, or at least it use to.
If we all start hitting Tesla’s web site it will be a lot off bandwidth, so would be best to keep local access for mining data.

The Tesla app doesn't access the gateway locally, everything goes through the cloud. The additional pairing step is probably just for extra authentication for more critical operations (off-grid, charge-on-solar).

The Tesla Pros app does access the gateway locally, but it:
1) Is targeted at installers, not customers (although it doesn't currently enforce that).
2) Requires one to connect to the TEG wifi, which makes it hard to automate API access (e.g. polling data like the Powerwall-Dashboard does).

I do think it's important Tesla lets customers access their data locally. It matters when there's a larger Tesla backend or internet outage; for us data nerds, there's also more information available locally: per-string data, battery degradation.