Welcome to Tesla Motors Club
Discuss Tesla's Model S, Model 3, Model X, Model Y, Cybertruck, Roadster and More.
Register

Using Fleet API to Control My Powerwall Reserve Percentage

This site may earn commission on affiliate links.
Trying to sign up for the Fleet API but not getting the verification link. Anyone else have this issue? (tried having it resent, checked spam folder)
I remember having some issues with email verification, but I don't remember what exactly fixed it. I'd try an incognito window and verifying it directly from the profile page after sign-in (I think that's where I did it): https://www.tesla.com/teslaaccount/profile-settings
 
  • Like
Reactions: zƬesla
Update: Tesla fixed the issue.
I'm making progress with understanding the fleet api, so that I can adapt my OpenHAB binding to support it. I cna now change reserve settings on the powerwall, but even though I've installed a key on my car, I'm still getting an error when sending vehicle commands "vehicle rejected request: your public key has not been paired with the vehicle" <sigh>
 
  • Like
Reactions: Mark Purcell
I'm making progress with understanding the fleet api, so that I can adapt my OpenHAB binding to support it. I cna now change reserve settings on the powerwall, but even though I've installed a key on my car, I'm still getting an error when sending vehicle commands "vehicle rejected request: your public key has not been paired with the vehicle" <sigh>
OK I fixed this, it was user error importing the keys required for tesla-http-proxy
 
Good catch, I fixed the script to grab the first valid energy_site_id.
Thanks for the update.

That is looking good now...


~/netzero$ ./fleet-api\ \(1\).sh
Tesla base url: https://fleet-api.prd.na.vn.cloud.tesla.com
Tesla energy site id: XXXX
{
"response": {
"id": "YYYY",
"site_name": "Gateway",
"backup_reserve_percent": 41,
"default_real_mode": "self_consumption",
"installation_date": "2022-03-21T17:15:23+10:00",
"user_settings": {
"go_off_grid_test_banner_enabled": false,
"storm_mode_enabled": true,
"powerwall_onboarding_settings_set": true,
"powerwall_tesla_electric_interested_in": false,
"vpp_tour_enabled": true,
"sync_grid_alert_enabled": true,
"breaker_alert_enabled": false
},

Interesting my nameplate_power has gone up from 15 kW (3x 5kW) to 16500!
"nameplate_power": 16500,
"nameplate_energy": 40500,
"installation_time_zone": "Australia/Brisbane",
"max_site_meter_power_ac": 1000000000,
"min_site_meter_power_ac": -1000000000,
"vpp_backup_reserve_percent": 41


Looks like my curl isn't modern enough ;-(

curl is already the newest version (7.74.0-1.3+deb11u11).

curl: option --json: is unknown


# To set backup reserve to 50%:
#$CURL_CMD -H "Authorization: Bearer $TESLA_API_TOKEN" --json '{"backup_reserve_percent": 50}' $TESLA_BASE_URL/api/1/energy_sites/$TESLA_SITE_ID/backup
The legacy method works:
$CURL_CMD -H "Authorization: Bearer $TESLA_API_TOKEN" --header "Content-Type: application/json" --header "Accept: application/json" --data '{"backup_reserve_percent": 50}' $TESLA_BASE_URL/api/1/energy_sites/$TESLA_SITE_ID/backup
 
Last edited: