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

I don't understand my Solar Inverters grid status (Simultaneously offline and online?) -- Powerwall Animation broken #577

Open
Nexarian opened this issue Jan 29, 2025 · 6 comments

Comments

@Nexarian
Copy link

Nexarian commented Jan 29, 2025

Alerts (taken at night from TEDAPI)

[
  "PVAC_a014_PVS_disabled_relay",
  "PVS_a059_MciOpen",
  "SolarRGMMeterComms",
  "SystemConnectedToGrid",
  "FWUpdateSucceeded",
  "SystemIslandedActive"
]

The conflict is "SystemConnectedToGrid" and "SystemIslandedActive" (these two never change, the inverters always have both)

"SystemConnectedToGrid" is coming from /status, and "SystemIslandedActive" is being added by the pypowerwall alerts code because the status JSON contains key/value pairs such as:
"ISLAND_GridState": "ISLAND_GridState_Grid_Uncompliant",
"ISLAND_GridConnected": "ISLAND_GridConnected_Island",
"PINV_GridState": "Grid_Uncompliant",

This is confusing the animation so it believes I'm offline and doesn't render. I'm pretty sure my system IS connected to the grid (though if it's correctly connected I'm not sure), as I am sending power back through the meter socket (I verify this independently with an Emporia Vue).

So my system is both connected to the gride AND offline? I think we might need to tweak this... Is this perhaps because I have 2x standalone solar-only inverters and no battery? So perhaps parts of the system will report not connected to the grid because the Gateway in the inverter COULD also work in a Powerwall but the relevant hardware isn't there?

@Nexarian
Copy link
Author

More information:

curl http://localhost:8685/api/system_status/grid_status | jq
{
  "grid_status": "SystemIslandedActive",
  "grid_services_active": null
}

Yet in alerts:

{
    "control": {
        "alerts": {
            "active": [
                "SystemConnectedToGrid",
                "FWUpdateSucceeded"
            ]
        },

Something to do with a Tesla Solar inverter and not a powerwall in TEDAPI mode? Does "Islanded" mean something different for just inverters?

@jasonacox
Copy link
Owner

What do you see in http://localhost:8675/tedapi/status ?

I have:

"SystemConnectedToGrid",
"FWUpdateSucceeded",
"GridCodesWrite",
"PodCommissionTime"

@Nexarian
Copy link
Author

"control": {
    "alerts": {
      "active": [
        "SystemConnectedToGrid",
        "FWUpdateSucceeded"
      ]
    },
    "batteryBlocks": [],
    "islanding": {
      "contactorClosed": true,
      "customerIslandMode": "BACKUP",
      "gridOK": true,
      "microGridOK": true
    },

One thing I've noticed, in the full status, there are blocks like this:

                    "PINV_Status": {
                        "PINV_Fout": 0,
                        "PINV_GridState": "Grid_Uncompliant",
                        "PINV_Pout": 0,
                        "PINV_State": "PINV_Off",
                        "PINV_Vout": 0,
                        "isMIA": true
                    },

and

            "ISLANDER": {
                "ISLAND_AcMeasurements": {
                    "ISLAND_FreqL1_Load": 0,
                    "ISLAND_FreqL1_Main": 0,
                    "ISLAND_FreqL2_Load": 0,
                    "ISLAND_FreqL2_Main": 0,
                    "ISLAND_FreqL3_Load": 0,
                    "ISLAND_FreqL3_Main": 0,
                    "ISLAND_GridState": "ISLAND_GridState_Grid_Uncompliant",
                    "ISLAND_VL1N_Load": 0,
                    "ISLAND_VL1N_Main": 0,
                    "ISLAND_VL2N_Load": 0,
                    "ISLAND_VL2N_Main": 0,
                    "ISLAND_VL3N_Load": 0,
                    "ISLAND_VL3N_Main": 0,
                    "isComplete": false,
                    "isMIA": true,
                    "lastRxTime": "0001-01-01T00:00:00Z"
                },
                "ISLAND_GridConnection": {
                    "ISLAND_GridConnected": "ISLAND_GridConnected_Island",
                    "isComplete": false
                }
            },

But we're searching for status like this:
grid_state = lookup(status, ["esCan", "bus", "ISLANDER", "ISLAND_GridConnection", "ISLAND_GridConnected"])

We're doing a broad-spectrum search for anything that might indicate islanded grid status, without verifying if those metrics are enabled or active.

Still, it bothers me that the core grid_status api from the inverters themselves still seems to be returning the islanded status. My system is not islanded, but I suspect this is a difference between the way the powerwall behaves and the way the solar-only inverters behave. The solar-only inverters don't island themselves. They're either on or off, so perhaps because that functionality isn't there the status readout is dodgy?

I want to fix this before I roll out more on my multi-inverter dashboard/proxy.

@Nexarian
Copy link
Author

I connected to fleetapi using pypowerwall and ran /api/system_status/grid_status to get a second opinion.

{
    "grid_status": "SystemGridConnected",
    "grid_services_active": null
}

I am not islanded! Yay! I was getting scared for a moment that something was seriously wrong with my system. I will work on a fix for get_api_system_status_grid_status

Effectively: This is not a bug with Powerwall-Dashboard, it's a bug where pypowerwall does not handle grid_status correctly on solar only inverters with TEDAPI. That's a pretty obscure edge case, but I'm hitting it!

I'll resolve this issue and create a corresponding one on pypowerwall to resolve the bug. I have a guess as to how to fix this, to check for things like isMIA, lastRxTime, and isComplete but of course we're shooting in the dark without full understanding of how this is supposed to work!

@jasonacox
Copy link
Owner

jasonacox commented Feb 1, 2025

Thanks @Nexarian - You are right, there is no official documentation on what we are doing. :) What you suggest makes sense. I would err on the side of creating the conditional based on those other data points, but also allow for those datapoints to not exist and fall back to "as is". I'm trying to think of a case (or system config) where your proposed path would cause problem.

Please make the change and test on your system and submit a PR so I can test as well. 🙏

@Nexarian
Copy link
Author

Nexarian commented Feb 4, 2025

This is better.

Image

@jasonacox jasonacox/pypowerwall#139

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