jasonacox / Powerwall-Dashboard

Grafana Monitoring Dashboard for Tesla Solar and Powerwall Systems
MIT License
293 stars 60 forks source link

Missing Strings and/or Configuration issue #292

Open ShawnKimble opened 1 year ago

ShawnKimble commented 1 year ago

I have 2 PowerWall+ and 1 Tesla Inverter for a total of 3 Inverters (3 x 7.6kw = 22.8kW max) fed by 9 strings, three strings to each inverter all fed out through a Tesla Gateway. I started using this Dashboard to further investigate the proper setup of the system as I experianced 10-15 different electricians (yeah it was crazy) durring my install, and had to resolve numerious issues. So I'm still not 100% sure everything is configured correctly, and unclear if the default configuration of this dashboard should pick up all 9 strings or not.

System Details I have the dashboard up and running on Ubuntu 18.04.6, the Dashboard seems to be working fine, but under localhost:8675/strings, I only see 8 Strings, of which two read zeros.

Why do I not see all 9 strings, and what configuration edits might I need to capture everything? I also find it odd that I see 8 strings, with 6 active, unless this dashboard only can see the 6 strings of data from the PowerWall+ and nothing from the standalone Tesla Inverter.

{
    "A": {
        "Connected": true,
        "Current": 1.95,
        "Power": 836.0,
        "State": "PV_Active",
        "Voltage": 431.20000000000005
    },
    "A1": {
        "Connected": true,
        "Current": 1.22,
        "Power": 403.0,
        "State": "PV_Active",
        "Voltage": 333.70000000000005
    },
    "B": {
        "Connected": true,
        "Current": 7.88,
        "Power": 2540.0,
        "State": "PV_Active",
        "Voltage": 328.1
    },
    "B1": {
        "Connected": true,
        "Current": 3.73,
        "Power": 1369.0,
        "State": "PV_Active",
        "Voltage": 382.6
    },
    "C": {
        "Connected": true,
        "Current": 8.41,
        "Power": 2257.0,
        "State": "PV_Active",
        "Voltage": 271.2
    },
    "C1": {
        "Connected": true,
        "Current": 8.99,
        "Power": 2904.0,
        "State": "PV_Active",
        "Voltage": 338.90000000000003
    },
    "D": {
        "Connected": false,
        "Current": 0.0,
        "Power": 0.0,
        "State": "PV_Active",
        "Voltage": 0.10000000000000142
    },
    "D1": {
        "Connected": false,
        "Current": 0.0,
        "Power": 0.0,
        "State": "PV_Active",
        "Voltage": -2.3
    }
}

Thanks for any help!

ShawnKimble commented 1 year ago

I've learned that the Gateway operates on 192.168.91.1, and the standalone inverter is on 192.168.92.1. Is there a way to connect to both of these and get all the data from the three other strings?

I think in the above, D strings are the fourth string that is missing from each inverter, and that then makes sense about this setup.

jasonacox commented 1 year ago

Hi @ShawnKimble, that's an elaborate setup!

The issue is that Powerwall-Dashboard and the pypowerwall API is designed to only talk to one gateway. I made the (bad) assumption that Tesla would aggregate all Powerwalls into the same gateway interface. This has come up before and is tracked in https://github.com/jasonacox/Powerwall-Dashboard/issues/148.

There is a way for you to customize your setup to see everything and have it store everything in the same dashboard. It will require customizing the setup... thinking through it:

Ok, before we we go too far, It would be interesting to confirm that the string data is separate like we suspect. You could run this python script to pull string data for each:

import pypowerwall

# Connect to Powerwalls
pw1 = pypowerwall.Powerwall("192.168.91.1","password","email")
pw2 = pypowerwall.Powerwall("192.168.92.1","password","email")

print("String Data from GW 192.168.91.1: %s\n\n" % pw1.strings(True))
print("String Data from GW 192.168.92.1: %s\n\n" % pw2.strings(True))

# Or show raw vitals
# print(pw1.vitals(True))
# print(pw2.vitals(True))
ShawnKimble commented 1 year ago

Thanks Jason, here's what I get....

When on my local network, the script fails to connect. If I connect to the Gateway as my wifi, I get this

String Data from GW 192.168.91.1: {    "A": {
        "Connected": true,
        "Current": 0.9400000000000001,
        "Power": 362.0,
        "State": "PV_Active",
        "Voltage": 369.40000000000003
    },
    "A1": {
        "Connected": true,
        "Current": 4.14,
        "Power": 1220.0,
        "State": "PV_Active",
        "Voltage": 269.90000000000003
    },
    "B": {
        "Connected": true,
        "Current": 5.78,
        "Power": 2017.0,
        "State": "PV_Active",
        "Voltage": 321.40000000000003
    },
    "B1": {
        "Connected": true,
        "Current": 3.2600000000000002,
        "Power": 1462.0,
        "State": "PV_Active",
        "Voltage": 346.70000000000005
    },
    "C": {
        "Connected": true,
        "Current": 5.62,
        "Power": 1489.0,
        "State": "PV_Active",
        "Voltage": 242.4
    },
    "C1": {
        "Connected": true,
        "Current": 7.8100000000000005,
        "Power": 2339.0,
        "State": "PV_Active",
        "Voltage": 250.3
    },
    "D": {
        "Connected": false,
        "Current": 0.0,
        "Power": 0.0,
        "State": "PV_Active",
        "Voltage": -0.5999999999999996
    },
    "D1": {
        "Connected": false,
        "Current": 0.08,
        "Power": 0.0,
        "State": "PV_Active",
        "Voltage": -1.0999999999999996
    }
}

String Data from GW 192.168.92.1: None

If I connect to the Tesla standalone inverter as my wifi connection, I get this

StringData from GW 192.168.91.1: None
String Data from GW 192.168.92.1: None
jasonacox commented 1 year ago

A few things:

  1. I would recommend accessing your Powerwall gateways via their local IP instead of their built in WiFi access point (I found those access points to be very unstable but maybe they are better now). You can find your Powerwalls' local IPs using the scan feature of pypowerwall:

    python3 -m pypowerwall scan
  2. I suspect your second gateway ("standalone inverter") is not a Powerwall+. that means you will not get string data from that unit. The Powerwall+ is the only one that reports individual string data. Sorry about that. I don't know why Tesla did that.

Based on that new info, I do wonder what you are currently getting with the Dashboard. Do the solar production values (kW) seem to match what you see in the Telsa App? If so, that would indicate that the Powerwall+ is aggregating the solar data from the standalone inverter too. If so, that is good news and your current setup will work. Unfortunately, as mentioned in 2 above, you won't see individual string details from your standalone inverter.

ShawnKimble commented 1 year ago

I'm not sure why this is the result I got, as I'm on my local network, and I know that the wifi's in the Gateway and Inverter are also set to connect to this wifi, yet scan picks up nothing.

On your dashboard I match the app, so the standalone inverter must be rolling it's string data up to the gateway somehow. The six strings that show though, don't total the grand total, so I guess you might be able to subtract those two and make a "Hidden String" that represents the strings that are not part of the Powerwall+


Scan local network for Tesla Powerwall Gateways

    Your network appears to be: 192.168.1.0/24

    Enter Network or press enter to use 192.168.1.0/24:

    Running Scan...
      Host: 192.168.1.1 ... OPEN - Not a Powerwall
      Host: 192.168.1.7 ... OPEN - Not a Powerwall
      Host: 192.168.1.33 ... OPEN - Not a Powerwall
      Done

Discovered 0 Powerwall Gateway
ShawnKimble commented 1 year ago

To clarify the "Current State" box on the Dashboard matches the overall "Power Flow", which matches the app. The other graphs, including the primary "Energy Useage" are all off by the missing string data.

jasonacox commented 1 year ago

The 192.168.9x.x addresses look like the ones that you get when you attach to the Powerwall Gateway Wifi access point directly. Based on the scan, it seems like your local network should be assigning addresses within the 192.168.1.x range instead. If you are able to get pypowerwall to work, try to browse to http://grafana:8675/api/networks (change 'grafana' to the address of your dashboard) and see what IP addresses the gateway has assigned to the various networks (it will be a JSON payload).

To clarify the "Current State" box on the Dashboard matches the overall "Power Flow", which matches the app. The other graphs, including the primary "Energy Useage" are all off by the missing string data.

That's confusing. The "Current State" box and "Power Flow" use the same data as the "Energy Usage" graph (it is just a time series plot of that current state data). Can you post a screenshot?

ShawnKimble commented 1 year ago

I've tried to get these all at the same timestamp or close, this shows the tesla app, the overall dashboard, the dashboard detail at 13:19 timestamp, the string detail and the stand alone tesla inverter that is not part of the dataset of the dashboard.

The strings add up to 8,216kW from the PowerWall Plus (2x) and then 1,730kW from the Tesla Inverter = ~9,946kW. So all of the string data does seems to roll up into the primary graph. (I think my prior comment was a timing issue and clouds making it hard to get static numbers)

App Data Dashboard Dashboard at 13-19 String Detail Tesla Stand Alone Inverter 1538000-00-F

ShawnKimble commented 1 year ago

Cycling all 3 inverters on and off, I can confirm that the third standalone inverter is piggybacked onto the PW2+ data feed.

jasonacox commented 1 year ago

Nice! 👍 That's great news that you are getting the aggregate data. It is a shame about the not getting all the string data, but at least you know.

By the way, I wonder what is happening to your power flow animation? It doesn't look like pypowerwall is proxying and translating it correctly:

image

I wonder if has to do with the odd networking where your Powerwalls are not showing up on your local network? In my case, I hardwired my gateway (ethernet cable) since Wifi was too finicky. 😄

ShawnKimble commented 1 year ago

The values don't always match because the graph is point in time, and powerflow is instant. I was able to find the local network connection 192.168.1.39 to the gateway, so hopefully that's a bit more stable.

My biggest issue is that with 30kW of panels, and 22kW of inverter, I've never seen more than 15kW instant, and often see 12-14kW as my max. I do have some shade issues, but currently the sun is directly overhead and both sides of my South/North roof are lit up. Trying to get more details to confirm actual solar tile counts and areas match the actual plan, and what the string setup actually is, because I feel like some optimization could be done.

Thanks for the assistance, it's been great being able to get more details!

jasonacox commented 1 year ago

Awesome @ShawnKimble ! Having the dashboard has helped me debug several issues as well. It's also gratifying to see it all working. 😁

On the stand alone inverter, I wonder if that has a local LAN IP address as well? Since the string data is showing up here, there may be a way to scrape that from the site (essentially that is how we determined the API endpoints for the Powerwall too).

If you click on the WiFi setting in the graphic, does it give you the LAN IP address? You might try pointing pypowerwall at that IP address to see if you get any data, or less trivial, examine the web page source code/calls to see what APIs it is using to get the string data. My only fear is that it is using a protobuf payload which would require a .proto translation file (like we have for the gateway).

image
ShawnKimble commented 1 year ago

The Inverter has a local IP, but it states you can't configure from that access point (see below). It also requires a physical power cycle to login, otherwise the interface locks connections out.

It seems to pool the data from a "v1" POST request to this endpoint, but I can't figure out how to get the json payload, as when I explore this url I get a response error. "wsgi handler failed" http://192.168.92.1/tedapi/v1

This one works, and give me back the Part ID and Serial Number, which seem to be needed to pull the above request. http://192.168.92.1/tedapi/din

NetWork details Inverter

2023_06_14_09_21_32_Tesla_Solar_Inverter

Inverter Webpage

ShawnKimble commented 1 year ago

Found a few more endpoints:

http://192.168.1.5/api/1/vitals
http://192.168.1.5/api/1/wifi_status
http://192.168.1.5/api/1/lifetime
http://192.168.1.5/api/1/version
http://192.168.1.5/tedapi/v1

These all provide and error response "wsgi handler failed"

This works http://192.168.1.5/service

Service Update

jasonacox commented 1 year ago

Wow, nice discovery! Keep trying all the URLs you find in the Chrome developer tool "Network" tab.

wsgi handler failed

That is the "web server gateway interface" - likely indicating that you need to authenticate to be authorized to access that endpoint. You might try combinations of https://192.168.1.5/api/login/Basic which is the endpoint on the gateway used to log in (what pypowerwall uses).