jasonacox / pypowerwall

Python API for Tesla Powerwall and Solar Power Data
MIT License
135 stars 24 forks source link

Add support for backup switch. #12

Closed nhasan closed 2 years ago

nhasan commented 2 years ago

Here is a sample output for backup switch: "TEMSA--1624171-00-E--TG121161002JDY": { "ISLAND_FreqL1_Load": 60.010000000000005, "ISLAND_FreqL1_Main": 60.010000000000005, "ISLAND_FreqL2_Load": 60.0, "ISLAND_FreqL2_Main": 60.010000000000005, "ISLAND_FreqL3_Load": 0.0, "ISLAND_FreqL3_Main": 0.0, "ISLAND_GridConnected": true, "ISLAND_GridState": "ISLAND_GridState_Grid_Compliant", "ISLAND_L1L2PhaseDelta": -180.0, "ISLAND_L1L3PhaseDelta": -256.0, "ISLAND_L1MicrogridOk": true, "ISLAND_L2L3PhaseDelta": -256.0, "ISLAND_L2MicrogridOk": true, "ISLAND_L3MicrogridOk": false, "ISLAND_PhaseL1_Main_Load": 0.0, "ISLAND_PhaseL2_Main_Load": 0.0, "ISLAND_PhaseL3_Main_Load": -256.0, "ISLAND_ReadyForSynchronization": true, "ISLAND_VL1N_Load": 123.0, "ISLAND_VL1N_Main": 123.0, "ISLAND_VL2N_Load": 123.5, "ISLAND_VL2N_Main": 123.5, "ISLAND_VL3N_Load": 0.0, "ISLAND_VL3N_Main": 0.0, "METER_Z_CTA_I": 3.24, "METER_Z_CTA_InstReactivePower": -232.0, "METER_Z_CTA_InstRealPower": -15.0, "METER_Z_CTB_I": 3.48, "METER_Z_CTB_InstReactivePower": -308.0, "METER_Z_CTB_InstRealPower": -64.0, "METER_Z_LifetimeEnergyNetExport": 158623.0, "METER_Z_LifetimeEnergyNetImport": 959474.0, "METER_Z_VL1G": 123.53, "METER_Z_VL2G": 123.75, "componentParentDin": "STSTSM--1538000-25-F--TG121227001DD3", "firmwareVersion": "bce98cade591cb", "lastCommunicationTime": 1650038403, "manufacturer": "TESLA", "partNumber": "1624171-00-E", "serialNumber": "TG121161002JDY", "teslaEnergyEcuAttributes": { "ecuType": 300 } },

jasonacox commented 2 years ago

Thank you @nhasan - just one error I see -

                    fcv["METER_Z_CTA_I"] = d['METER_X_CTA_I']
                    fcv["METER_Z_CTB_I"] = d['METER_X_CTB_I']

I believe this is what you meant:

                    fcv["METER_Z_CTA_I"] = d['METER_Z_CTA_I']
                    fcv["METER_Z_CTB_I"] = d['METER_Z_CTB_I']

Do you also have TESYNC data points?

nhasan commented 2 years ago

No I do not have TESYNC object. I believe these are mutually exclusive.

Yes, rookie copy paste mistake.

jasonacox commented 2 years ago

Thanks again Nadeem!

I pushed the new proxy version to docker hub. Can you pull down the latest ("pypowerwall": "0.4.0 Proxy t8") and verify it works with your setup by testing http://localhost:8675/freq?

jasonacox commented 2 years ago

In addition to this latest change to pypowerwall proxy, I updated Powerwall-Dashboard influxdb.sql and powerwall.json to include these two voltage meter metrics. I categorized them as "Grid Lx SW" in the voltage graph. You should also see the frequency data points from the Backup Switch as well.