Monitoring Tesla’s Powerwall2 on PVOutput.org

If you’ve got a Powerwall2, Tesla lets you keep an eye on it via their iOS or Android App, (and now Windows 10 App) which means it’s only visible on compatible phones/tablets (or a PC if you want to put up with running an Android emulator), and it only provides today, yesterday, last week, and last month snapshots.

Screenshot 2017-12-07 13.14.09

 

If you want to see more detailed usage and keep historical data, a webpage that you can leave running on a spare screen would provide another simple way to do this. For our usage, PVOutput.org, which has been running as a solar tracking site for some years now, has been recently upgraded to deal with PW2 data.

Screenshot 2017-12-20 12.34.42

In the graph above, you can see the home power use as a red line, battery discharging and charging as blue, solar-system output as the yellow area, battery charge level as the green line, and power imported/exported as the purple area.

This graph starts at midnight on the left – you can see the battery discharging in blue as my PHEV charges, then once the PW2 hits 8% SOC (state of charge), the gateway switches to the grid (purple), and then as the sun comes up, the yellow shows the Solar generation above the line, with the PW2 charging below the line. The real-time graphs are available here. Read on to see how to set your PW2 up on PVOutput.

 

Prerequisites
A PW2 with wifi enabled
A wifi router that the PW2 can connect to
Admin access to your router to find out the IP of your PW2
An always-on Windows PC with internet access on the same network as the PW2

Get connected to the PW2
Your PW2 has a wifi AP in it that can connect to your network. It may be enabled and connected to your network already – go to your router’s DHCP Connected Clients page and look for an entry like “TEG-xxxx” (where xxx is your PW2’s serial number). If you see one like this, copy it’s IP address and paste it in to a browser tab, and you should get a current-status display from the PW2 as follows – if you do, skip to the next bolded subheading:

 

Screenshot 2017-12-07 13.17.07

 

If your PW2 is not connected to your wifi, you need to associate it to your Wifi router, using the wizard from the PW2 page above – the login details are the installer email and the serial number of the PW2. There is a network socket in the Gateway, behind the cover, and you may need to give the PC a static IP to connect to it.

Confirm the PW2 is outputting raw data
Enter the following address : http://x.x.x.x/api/meters/aggregates in a browser window (replacing x.x.x.x with your PW2’s IP), and you should see the instant data like this:

 

 

The text may be unformatted if you are using an older browser, but the data itself will be read by a separate tool provided by PVOutput, so you just need to confirm you are getting this data at that IP.

Entering http://x.x.x.x/api/system_status/soe in a browser should return you the charge-state percentage as follows:

If you got these pages successfully, move on to making an account at PVOutput.org.

Configuring the graphing options at PVOutput.org
Create an account at PVOutput here: https://pvoutput.org/register.jsp – it’s free for simple solar system uploading, but PW2 needs to use Extended Data values that are part of the Donation Features, so donate some Paypal to unlock these, at least $15. Fill in your details and visit the settings page : https://pvoutput.org/account.jsp

Towards the bottom, enable API access and generate a new key – this is what the software on your PC will use to identify you when it uploads data.  Under “Registered Systems”, click “Add System”, fill in what details you know and save.

You should now have a new system on the bottom of the settings page – edit the system, and fill in your Energy Tariff Times and costs if you are on TOU.

Now go to the Extended Data section, and fill in the details as per the screen below – these are the labels for the graphs for the values that the PW2 will be exporting.

Screenshot 2017-12-19 11.18.20

For the Battery Flow, Home Load, Grid Flow, and Solar Generation, click the cog on the right, and set the modifier to “Divide by 1000” to scale the data correctly. Click the Area / Line to change it’s state to suit your needs, and click the colour blob if you want to pick an alternative colour for any of the graphs.

Save, and from the bottom of the settings page, bookmark the link with your system’s name (that’s what you’ll click on to see the graphs), and keep this page open as you’ll need to copy the API key and System ID in the next step.

Grabbing the data from the PW2 and uploading it to PVOutput.org
On the always-on Windows PC, visit the link below to download the free PVPOutput Integration software: https://bitbucket.org/pvoutput/pvoutput-integration-service/downloads/org.pvoutput.integration.v1.5.2.zip

and unzip it to a folder in your root directory. There’s discussion about the PW2 at their forums, where new versions are posted: https://forum.pvoutput.org/t/powerwall-extended-parameters/298/34

Follow the install instructions first step to install the service.

Edit the conf/pvoutput.ini text file, and paste in the API Key from the bottom of https://pvoutput.org/account.jsp. Paste the System ID to SID=xxxxx from that page also, uncomment the format and change it to powerwall, and uncomment the direction=in., save and close pvoutput.ini.

Open the conf/powerwall.ini and paste the following to replace all the text there, substituting x.x.x.x with your PW2’s IP:

url=http://x.x.x.x/api/meters/aggregates

poll=30

direction=in

voltage=instant_average_voltage

v7=battery.instant_power

v8=load.instant_power

v10=site.instant_power

v12=solar.instant_power

soc-url=http://x.x.x.x/api/system_status/soe

soc-parameter=v11

In the above text, the v-parameters are the available data sets that PVOutput will accept, but you can vary the content by changing the part after the “=”. Have a look in the original copy of the powerwall.ini file if you want to know the kinds of params each power type can export.

Save and go to the BIN folder, and run “start-service.bat” as an Administrator. Now, give it 10 minutes or so and you should start to see graph data appearing at the page you previously bookmarked at PVoutput.org. Note that you need to click the right-most blob under the graph / above the date to expose the Extended Data graph.

More info if you want it

PVOutput has a default generation / consumption display and summary page, but the above config only lets you see all the PW2 values under the Extended Data page, and with only the gross consumption (red) value on the default display.

You can, however, make another copy of the PVO Integration service just for exporting the solar generation data, so both generation (green) and consumption (red) are plotted and measured on the default PVO page.

Screenshot 2018-01-08 11.39.54

To do this, go to the BIN folder, and stop the service. Go back up one level, and copy the entire contents of the PVO Integration folder. Go back up another level, and make a new folder next to the original PVO Integration folder, with a different name. Open this folder and paste the original PVO Integration files/folders in. You can go back to the original PVO Integration folder / BIN, and start the original service again now.

All the following edits are done to the new copy of PVO Integration you just made.

Go up one level, and make a new folder for the output logs also, eg logs-output.

Go to the CONF folder, and edit “pvoutput.conf” – look for “# Name of the service” and change the name slightly – I just added a 1 to it. Do the same for “# Display name of the service”.

Now edit “pvoutput.ini” and change ‘dir=c:/logs” to the log directory you made above, eg: “dir=c:/logs-output”.  Scroll down and change “direction=in” to “direction=out”.

Now edit “powerwall.ini” and change it’s “direction=in” to “direction=out“. 

Close and save all these files, and go to the BIN folder to run the batch files to install, and then start, the new PVO service.

You should see log files in your new logs-output directory a few minutes later, and then the default PVOutput page will start populating 10 mins after that, with instant generation and total generation values in dark/light green.

Note that the consumption graph is the gross consumption of power used by the home (not including battery charging), and it does not take into account contributions from the battery powering the home. You can only currently see the net grid imports/exports under the Extended Data page.

  1. #1 by Francis on January 15, 2018 - 9:01 am

    In the section “Get connected to the PW2”, you stated “If your PW2 is not connected to your wifi, you need to associate it to your Wifi router, using the wizard from the PW2 page above”. So how do you get to the wizard if it’s not connected to the WiFi? Is there a way to connect to the gateway via cable?

    Like

    • #2 by Michael on January 15, 2018 - 9:32 am

      Yes, there is a network socket inside the gateway. You may need to assign a static IP to the PC you connect to it.

      Like

      • #3 by Francis on January 15, 2018 - 10:03 am

        Once I configured it to connect to our home wireless router, will it then break its 3g connection to Tesla? I’m guessing that’s how it’s sends the data over to Tesla at the moment. I suppose it should still be able to talk to Tesla via our wireless network.

        Like

      • #4 by Michael on January 15, 2018 - 10:22 am

        I have seen other people mention that they have both connections active. The Wifi network will let it talk to Tesla – mine only used the Wifi when they set it up, and I can’t tell if they ever enabled 3G – the later installs had way more 3G antennas on their gateways than mine did anyway.

        Like

  2. #5 by Chris on January 26, 2018 - 10:41 pm

    I set up dual PVO services as per your instructions and it worked perfectly first time. It looks like I am #7 showing up on PVOutput.org in the greater Houston, TX area, and perhaps one of only a few with the PW2 installation. It is winter here, and since my system was powered on last week I have not required any grid inputs. Thanks very much.

    Like

  3. #6 by Steve on February 9, 2018 - 5:32 pm

    Thanks for posting this, it is very helpfull.

    It seem like it might need some updates for .5.2. The biggest was that in pvouput.ini, you need the uncomment the format and change it to powerwall, and uncomment the direction=in.

    Like

  4. #7 by Marco Papa on March 11, 2018 - 2:59 pm

    Any idea if there is work being done for a MacOS version of the always-on software?

    Like

    • #8 by Michael on March 11, 2018 - 5:55 pm

      Not seen any yet. Windows has an app now. Powerwall Companion though

      Like

  1. Australian Powerwall2 Update – 3 months on | MikesGear
  2. Australian Tesla Powerwall 2 Review | MikesGear
  3. More Powerwall Monitoring Options… | MikesGear
  4. Installing Solar in Nevada - Floating Boats

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

%d bloggers like this: