Repository navigation
Replies: 1 comment 1 reply
|
Thanks, this is excellent work, and the evidence is exactly the kind I want: the per-pack counters agree with the battery meter and with Fleet API history, and you checked the heatsink temperature actually moves before relying on it. Yes, please send a PR. You have the hardware, and I'll validate on our side with our two Powerwall 3s. A few things that will make it straightforward to merge:
On my side: the Powerwall 3 gets this same device-controller query, so before merging I'll confirm on our two PW3s that the extra names come back null or are dropped and that nothing else in the response changes. Two of your side notes: the login printing tokens is a real bug, tracked in #415. Your Powerwall 2 pairing step (switching one unit's On/Off switch off for 15 seconds) would be very welcome as a short addition to the README's v1r section, in this PR or a docs one. The networking-status idea is interesting too. Let's take it up after this lands. |
Uh oh!
There was an error while loading. Please reload this page.
Thanks for the v1r work and for PR #390. The note there that the signal-name variables are not covered by the signature turned out to apply to the device controller query on Powerwall 2 as well, and it unlocks data that pypowerwall currently returns as null on PW2. Sharing what I found in case it is useful, and happy to test anything.
Setup
/api/login/Basicreturns 401 for the documented Gateway 1 default (last five of the serial, tested on an earlier firmware) and for the full serial, and Tesla support declined to release the customer password. TEDAPI v1r PW2 Mode (Gateway 1) only requires Legacy (Customer) password pypowerwall-server#143 and PW2 v1r TEDAPI - working in python with legacy password and serial number password, documentation requires update? #393 here describe Gateway 1 setups that used a Tesla One legacy password for v1r. On this one, once the key was VERIFIED, signed reads worked with no password at allPairing on a PW2 system
This is a one-time step per gateway, and it was the part a PW2 owner is most likely to get stuck on:
Two small things seen on Windows during the login step, happy to file them separately if useful: the native login printed the tokens to the console even with debug off, and the token dictionary it returned was empty, so the exchange result had to be captured directly before saving the auth cache.
What works
The V2024_06
device_controller_fullquery takesmsaCompandmsaSignalsas variables. Replacing or extending them works the same wayEXTRA_SIGNAL_NAMESdoes for the PW3 components query:Signals that came back live through
msaSignalsand are not already in the stock query:PINV_EnergyCharged,PINV_EnergyDischarged,PINV_LifetimeEnergyCharged,PINV_LifetimeEnergyDischarged,PINV_HeatsinkTemp,PINV_Qout,PINV_PllFrequency,PINV_PllLocked,PINV_ReadyForGridForming,PINV_HardwareEnableLinemsaComp:POD_PermanentlyFaulted,POD_PersistentlyFaulted,POD_ActiveHeating,POD_CCVhold,POD_ChargeComplete,POD_ChargeRequest,POD_DischargeComplete,POD_enable_line,POD_available_charge_power,POD_available_dischg_power,POD_nom_energy_to_be_chargedTHC_StateISLAND_L1L2PhaseDelta,ISLAND_L1L3PhaseDelta,ISLAND_L2L3PhaseDelta,ISLAND_L1MicrogridOk,ISLAND_L2MicrogridOk,ISLAND_L3MicrogridOk,ISLAND_ReadyForSynchronization,ISLAND_PhaseL1_Main_Load,ISLAND_PhaseL2_Main_Load,SYNC_ExternallyPowered,SYNC_SiteSwitchEnabledThe same path also returns values the stock query already provides (
THC_AmbientTempfrom the stockmsaSignals;PINV_Pout,PINV_Vout,PINV_Fout,PINV_VSplit1,PINV_VSplit2,PINV_State,PINV_GridState,PINV_Pnom, the two POD nominal energy values and theISLAND_*voltages and frequencies from the stockesCansection), and they agree.Requested through
msaSignalsbut echoed back null on this system:PINV_PowerLimiterandPOD_state(battery side), andISLAND_GridState,METER_X_*andMETER_Y_*including theirLifetimeEnergyImport/LifetimeEnergyExport(gateway side;ISLAND_GridStatedoes come through the stockesCansection). Of the stockmsaSignals, theMETER_Z_*CT and voltage names,MSA_*andPVAC_Fan_Speed_*also come back null here, andMETER_Z_LifetimeEnergyImport/Exportare not echoed at all, so this gateway does not recognise them. The site's solar is on a SolarEdge inverter, so the Tesla PVAC and PVS slots are MIA anyway.Two things to watch for
msaCompmakes the gateway returnnullfor the entire query, not just drop that type. Tested one at a time on top of the stock list: adding TEPOD is accepted (10 more components), while adding any one of TESLA, TEBMS, TEGW, TEISLAND or TEMETER nulls the whole response. So a single bad guess in the type list silently blanks every other value, and new types are worth adding one at a time.control.batteryBlocks[].din) and only pairs to its module by component order incomponents.msa. Six empty slots per family come back with no serial and no live signals.Evidence the counters are real
PINV_EnergyDischargedvalues summed to 31.5285 MWh, against 31.4896 MWh of cumulative battery discharge from the Fleet API calendar history read the same morning, 0.12 % apart. So the counters are Wh, and they measure per-pack lifetime discharge, the quantity the per-pack warranty throughput cap is expressed in.PINV_EnergyChargedcounters rose 3,782 Wh in total (948, 940, 948 and 946 Wh). Integrating the gateway's own battery meter power over the same span gives 3,786.6 Wh of charging, 0.1 % apart. The discharged counters stayed flat, and the battery did not discharge in that window.PINV_HeatsinkTempranged from about 40 to 56 °C, swinging 15 °C within an hour, whileTHC_AmbientTempsat at 31 to 34 °C. The heatsink did not simply follow charge power, though: it read about 41 °C during a 6.7 kW charge and fell to 40 °C as charging rose from about 2.5 to 4.8 kW, so I would treat it as a temperature, not a load proxy. Given the constantPCH_heatsinkTempyou found on PW3, I checked this one moves before relying on it.Networking status works on a Gateway 1 too
common.getNetworkingStatusRequest(V2026_06 energy_device protobuf,DELIVERY_CHANNEL_LOCAL_HTTPS,sender.local = LOCAL_PARTICIPANT_INSTALLER, sent throughpost_v1r) answers on this Backup Gateway 1 with per-interfaceconnectedPhysical,connectedInternet,connectedTesla, signal strength andactiveRoutefor eth and wifi (gsm comes back empty on this unit). These are the gateway's own network links, so the gateway generation is what matters here, not the batteries; the only public capture I found was from a PW3 with a Gateway 2. It is a useful local answer to "the app has gone blank: is the gateway down, or only its path to Tesla?"getSystemInfoRequestworks the same way.Question
Would you be interested in a PR that adds a device controller role to
EXTRA_SIGNAL_NAMESfor PW2 (append only, starting withPINV_EnergyCharged,PINV_EnergyDischarged,PINV_HeatsinkTempand the twoPOD_*Faultedflags), and fills the TEPINV values that are currently null in the TEDAPI-sourced vitals? If so, let me know what liveness evidence you would want per signal and I will gather it. TEPOD inmsaCompcould be a separate, opt-in step given the null-response behaviour above.All reactions