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

Help collect Tesla energy JSON responses #342

Open
shred86 opened this issue Aug 22, 2022 · 9 comments
Open

Help collect Tesla energy JSON responses #342

shred86 opened this issue Aug 22, 2022 · 9 comments

Comments

@shred86
Copy link
Contributor

shred86 commented Aug 22, 2022

In an effort to better develop the solar and powerwall functionality of this library (teslajsonpy) to support the Tesla Custom Integration, I need help collecting different JSON responses from various setups. This does require using a Python CLI tool but the process is pretty straight forward.

  1. Download TeslaPy from my branch here. Please use my branch since I added a -z argument option. The original TeslaPy combines multiple responses so it's impossible to see what a specific endpoint is returning.
  2. Open bash/terminal and browse to the TeslaPy folder.
  3. Use the commands listed below to get the appropriate JSON response. The first time you execute a command, you will have to authenticate. A pop-up window will bring you to the Tesla login screen to authenticate. The email address is the one associated with your Tesla app.
  4. Remove any personal identifiable information such as energy_site_id, id, address, etc. and post the JSON response here.
  5. Provide details on your setup such as solar type (panels or roof), inverter type (Tesla, SolarEdge, etc.), Powerwall version, gateway model (if applicable).

CLI commands: Solar only setups

python3 -e [email protected] -z PRODUCT_LIST
python3 -e [email protected] -z SITE_CONFIG
python3 -e [email protected] -z SITE_DATA
python3 -e [email protected] -z SITE_SUMMARY

CLI commands: Powerwall setups (with or without solar)

python3 -e [email protected] -z PRODUCT_LIST
python3 -e [email protected] -z SITE_CONFIG (likely will return nothing)
python3 -e [email protected] -z SITE_DATA (likely will return nothing)
python3 -e [email protected] -z SITE_SUMMARY (likely will return nothing)
python3 -e [email protected] -z BATTERY_DATA
python3 -e [email protected] -z BATTERY_SUMMARY

Example

Setup:

  • Tesla solar panels
  • Tesla inverter (single)
  • Neurio power monitoring installed
  • No separate gateway (built into Tesla inverter)

PRODUCT_LIST

{
    "response": [
        {
            "id": 12345,
            "user_id": 12345,
            "vehicle_id": 12345,
            "vin": "redacted",
            "display_name": "Model S",
            "option_codes": "AD15,MDL3,PBSB,RENA,BT37,ID3W,RF3G,S3PB,DRLH,DV2W,W39B,APF0,COUS,BC3B,CH07,PC30,FC3P,FG31,GLFR,HL31,HM31,IL31,LTPB,MR31,FM3B,RS3H,SA3P,STCP,SC04,SU3C,T3CA,TW00,TM00,UT3P,WR00,AU3P,APH3,AF00,ZCST,MI00,CDM0",
            "color": null,
            "access_type": "OWNER",
            "tokens": [
                "redacted",
                "redacted"
            ],
            "state": "online",
            "in_service": false,
            "id_s": "redacted",
            "calendar_enabled": true,
            "api_version": 36,
            "backseat_token": null,
            "backseat_token_updated_at": null,
            "vehicle_config": {
                "can_accept_navigation_requests": true,
                "can_actuate_trunks": true,
                "car_special_type": "base",
                "car_type": "models",
                "charge_port_type": "US",
                "dashcam_clip_save_supported": false,
                "default_charge_to_max": false,
                "driver_assist": "MonoCam",
                "ece_restrictions": false,
                "efficiency_package": "Default",
                "eu_vehicle": false,
                "exterior_color": "White",
                "front_drive_unit": "NoneOrSmall",
                "has_air_suspension": false,
                "has_ludicrous_mode": false,
                "has_seat_cooling": false,
                "headlamp_type": "Hid",
                "interior_trim_type": "AllBlack",
                "motorized_charge_port": true,
                "plg": true,
                "pws": false,
                "rear_drive_unit": "Small",
                "rear_seat_heaters": 0,
                "rear_seat_type": 1,
                "rhd": false,
                "roof_color": "Colored",
                "seat_type": 1,
                "spoiler_type": "None",
                "sun_roof_installed": 0,
                "third_row_seats": "None",
                "timestamp": 1661133749107,
                "trim_badging": "85d",
                "use_range_badging": false,
                "utc_offset": -25200,
                "wheel_type": "Base19"
            },
            "command_signing": "off"
        },
        {
            "energy_site_id": 12345,
            "resource_type": "solar",
            "id": "redacted",
            "asset_site_id": "redacted",
            "solar_power": 3790,
            "solar_type": "pv_panel",
            "storm_mode_enabled": null,
            "powerwall_onboarding_settings_set": null,
            "sync_grid_alert_enabled": false,
            "breaker_alert_enabled": false,
            "components": {
                "battery": false,
                "solar": true,
                "solar_type": "pv_panel",
                "grid": true,
                "load_meter": true,
                "market_type": "residential"
            }
        }
    ],
    "count": 2
}

SITE_CONFIG

{
    "response": {
        "id": "redacted",
        "site_name": "My Home",
        "site_number": "redacted",
        "installation_date": "redacted",
        "user_settings": {
            "storm_mode_enabled": null,
            "powerwall_onboarding_settings_set": null,
            "sync_grid_alert_enabled": false,
            "breaker_alert_enabled": false
        },
        "components": {
            "solar": true,
            "solar_type": "pv_panel",
            "battery": false,
            "grid": true,
            "backup": false,
            "gateway": "gateway_type_none",
            "load_meter": true,
            "tou_capable": false,
            "storm_mode_capable": false,
            "flex_energy_request_capable": false,
            "car_charging_data_supported": false,
            "off_grid_vehicle_charging_reserve_supported": false,
            "vehicle_charging_performance_view_enabled": false,
            "vehicle_charging_solar_offset_view_enabled": false,
            "battery_solar_offset_view_enabled": false,
            "energy_service_self_scheduling_enabled": true,
            "rate_plan_manager_supported": true,
            "configurable": false,
            "grid_services_enabled": false
        },
        "installation_time_zone": "America/Los_Angeles",
        "time_zone_offset": -420,
        "geolocation": {
            "latitude": 12345,
            "longitude": 12345
        },
        "address": {
            "address_line1": "redacted",
            "city": "redacted",
            "state": "redacted",
            "zip": "redacted",
            "country": "US"
        }
    }
}

SITE_DATA

{
    "response": {
        "solar_power": 540,
        "load_power": 2681.449951171875,
        "grid_status": "Unknown",
        "grid_services_active": false,
        "grid_power": 2141.449951171875,
        "grid_services_power": 0,
        "generator_power": 0,
        "island_status": "island_status_unknown",
        "storm_mode_active": false,
        "timestamp": "2022-08-21T19:12:17-07:00",
        "wall_connectors": []
    }
}

SITE_SUMMARY

{
    "response": {
        "resource_type": "solar",
        "asset_site_id": "redacted",
        "solar_power": 540,
        "solar_type": "pv_panel",
        "storm_mode_enabled": null,
        "powerwall_onboarding_settings_set": null,
        "sync_grid_alert_enabled": false,
        "breaker_alert_enabled": false
    }
}
@shred86
Copy link
Contributor Author

shred86 commented Aug 27, 2022

Setup:

  • Solar panels
  • Delta M inverter
  • No load meter (Powerblaster or Neurio)
  • Neo 2 gateway

SITE_CONFIG

Normal response:

{
    "response": {
        "solar_power":332,
        "timestamp":"2022-03-12T17:17:09-08:00"
    }
}

Response when grid_status is Unknown:

{
    "response": {
        "solar_power": 0,
        "grid_status": "Unknown",
        "grid_services_active": false,
        "timestamp": "2022-03-12T17:18:10-08:00"
    }
}

@shred86
Copy link
Contributor Author

shred86 commented Aug 29, 2022

Setup

  • Solar panels
  • Solar City inverter
  • No load meter (Powerblaster or Neurio)
  • Neo gateway?

PRODUCT_LIST

{
    "response": {
        "energy_site_id": "redacted",
        "resource_type": "solar",
        "id": "redacted",
        "asset_site_id": "redacted",
        "solar_power": 480,
        "solar_type": "pv_panel",
        "storm_mode_enabled": None,
        "powerwall_onboarding_settings_set": None,
        "sync_grid_alert_enabled": False,
        "breaker_alert_enabled": False,
        "components": {
            "solar": True,
            "solar_type": "pv_panel",
            "battery": False,
            "grid": True,
            "backup": False,
            "gateway": "neo",
            "load_meter": False,
        },
    }
}

@3xccie
Copy link

3xccie commented Sep 14, 2022

Setup:

Solar panels
Delta solivia inverters (2 of them)
Powerblaster
Neo gateway

Product 0:
{
"response": [
{
"resource_type": "solar",
"solar_power": 6040,
"solar_type": "pv_panel",
"storm_mode_enabled": null,
"powerwall_onboarding_settings_set": null,
"sync_grid_alert_enabled": false,
"breaker_alert_enabled": false,
"components": {
"battery": false,
"solar": true,
"solar_type": "pv_panel",
"grid": true,
"load_meter": true,
"market_type": "residential"
}
}
],
"count": 1
}

Product 0:
{
"response": {

    "user_settings": {
        "storm_mode_enabled": null,
        "powerwall_onboarding_settings_set": null,
        "sync_grid_alert_enabled": false,
        "breaker_alert_enabled": false
    },
    "components": {
        "solar": true,
        "solar_type": "pv_panel",
        "battery": false,
        "grid": true,
        "backup": false,
        "gateway": "neo",
        "load_meter": true,
        "tou_capable": false,
        "storm_mode_capable": false,
        "flex_energy_request_capable": false,
        "car_charging_data_supported": false,
        "off_grid_vehicle_charging_reserve_supported": false,
        "vehicle_charging_performance_view_enabled": false,
        "vehicle_charging_solar_offset_view_enabled": false,
        "battery_solar_offset_view_enabled": false,
        "energy_service_self_scheduling_enabled": true,
        "rate_plan_manager_supported": true,
        "configurable": false,
        "grid_services_enabled": false
    },
    "time_zone_offset": -240,
    "geolocation": {

    },
    "address": {

    }
}

}

2022-09-14 12:16:08,527 - root - INFO - 1 product(s), 1 selected
Product 0:
{
"response": {
"solar_power": 1120,
"load_power": 5240,
"grid_status": "Active",
"grid_services_active": false,
"grid_power": 4120,
"grid_services_power": 0,
"timestamp": "2022-09-14T12:16:08-04:00",
"wall_connectors": null
}
}

2022-09-14 12:16:29,269 - root - INFO - 1 product(s), 1 selected
Product 0:
{
"response": {
"resource_type": "solar",
"solar_power": 7080,
"solar_type": "pv_panel",
"storm_mode_enabled": null,
"powerwall_onboarding_settings_set": null,
"sync_grid_alert_enabled": false,
"breaker_alert_enabled": false
}
}

@llamafilm
Copy link
Contributor

I had to make a small adjustment to the commands you wrote. First run pip install -r requirements.txt and then add the module name to each command, e.g. python3 cli.py -e [email protected] -z PRODUCT_LIST.

Setup:

  • Tesla Model 3 vehicle
  • Tesla (Solivia) 7.5kW solar inverter with PPA agreement
  • Powerblaster clamps on the mains in breaker panel
  • Zigbee to ethernet gateway, small black box, I'm not sure of the model

PRODUCT_LIST

{
    "response": [
        {
            "id": xxx,
            "user_id": xxx,
            "vehicle_id": xxx,
            "vin": xxx,
            "display_name": xxx,
            "option_codes": "AD15,AF00,APFB,APH4,AU3P,BC3B,BT42,CDM0,CH16,COUS,DRLH,DV4W,FC02,FG31,FM3B,GLFR,HL32,HM30,ID3A,IL31,LT03,MDL3,MR31,PPSW,PC30,RENA,RF3G,RS3H,S3PW,SA3P,SC04,STCP,SU3C,T3MA,TM00,TW00,UT3P,W40B,WR00,ZINV,MI02,PL30,SLR0,ST33,BG31,I36M,USSB,AUF1,RSF1,ILF1,FGF1,CPF1,P3WS,HP31,PT01,RL31,FD00,RD01,SWF1,RA00",
            "color": null,
            "access_type": "OWNER",
            "tokens": [
                xxx,
                xxx
            ],
            "state": "asleep",
            "in_service": false,
            "id_s": xxx,
            "calendar_enabled": true,
            "api_version": 44,
            "backseat_token": null,
            "backseat_token_updated_at": null,
            "vehicle_config": {
                "aux_park_lamps": "NaPremium",
                "badge_version": 0,
                "can_accept_navigation_requests": true,
                "can_actuate_trunks": true,
                "car_special_type": "base",
                "car_type": "model3",
                "charge_port_type": "US",
                "dashcam_clip_save_supported": true,
                "default_charge_to_max": false,
                "driver_assist": "TeslaAP3",
                "ece_restrictions": false,
                "efficiency_package": "M32021",
                "eu_vehicle": false,
                "exterior_color": "PearlWhite",
                "exterior_trim": "Black",
                "exterior_trim_override": "",
                "has_air_suspension": false,
                "has_ludicrous_mode": false,
                "has_seat_cooling": false,
                "headlamp_type": "Global",
                "interior_trim_type": "White2",
                "key_version": 2,
                "motorized_charge_port": true,
                "paint_color_override": "20,20,20,0.01,0.04",
                "performance_package": "Base",
                "plg": true,
                "pws": true,
                "rear_drive_unit": "PM216MOSFET",
                "rear_seat_heaters": 1,
                "rear_seat_type": 0,
                "rhd": false,
                "roof_color": "RoofColorGlass",
                "seat_type": null,
                "spoiler_type": "None",
                "sun_roof_installed": null,
                "supports_qr_pairing": false,
                "third_row_seats": "None",
                "timestamp": 1664433544725,
                "trim_badging": "74d",
                "use_range_badging": true,
                "utc_offset": -25200,
                "webcam_supported": false,
                "wheel_type": "PinwheelRefresh18"
            },
            "command_signing": "allowed"
        },
        {
            "energy_site_id": xxx,
            "resource_type": "solar",
            "id": xxx,
            "asset_site_id": xxx,
            "solar_power": 0,
            "solar_type": "pv_panel",
            "storm_mode_enabled": null,
            "powerwall_onboarding_settings_set": null,
            "sync_grid_alert_enabled": false,
            "breaker_alert_enabled": false,
            "components": {
                "battery": false,
                "solar": true,
                "solar_type": "pv_panel",
                "grid": true,
                "load_meter": true,
                "market_type": "residential"
            }
        }
    ],
    "count": 2
}

SITE_CONFIG

{
    "response": {
        "id": xxx,
        "site_number": xxx,
        "installation_date": "2021-03-02T17:00:00-07:00",
        "user_settings": {
            "storm_mode_enabled": null,
            "powerwall_onboarding_settings_set": null,
            "sync_grid_alert_enabled": false,
            "breaker_alert_enabled": false
        },
        "components": {
            "solar": true,
            "solar_type": "pv_panel",
            "battery": false,
            "grid": true,
            "backup": false,
            "gateway": "neo",
            "load_meter": true,
            "tou_capable": false,
            "storm_mode_capable": false,
            "flex_energy_request_capable": false,
            "car_charging_data_supported": false,
            "off_grid_vehicle_charging_reserve_supported": false,
            "vehicle_charging_performance_view_enabled": false,
            "vehicle_charging_solar_offset_view_enabled": false,
            "battery_solar_offset_view_enabled": false,
            "energy_service_self_scheduling_enabled": true,
            "rate_plan_manager_supported": true,
            "configurable": false,
            "grid_services_enabled": false
        },
        "time_zone_offset": -420,
        "geolocation": {
            "latitude": xxx,
            "longitude": xxx
        },
        "address": {
            "address_line1": xxx,
            "city": xxx,
            "state": xxx,
            "zip": xxx,
            "country": "US"
        }
    }
}

SITE_DATA

{
    "response": {
        "solar_power": 0,
        "load_power": 145,
        "grid_status": "Active",
        "grid_services_active": false,
        "grid_power": 145,
        "grid_services_power": 0,
        "timestamp": "2022-09-28T23:54:34-07:00",
        "wall_connectors": null
    }
}

SITE_SUMMARY

{
    "response": {
        "resource_type": "solar",
        "asset_site_id": xxx,
        "solar_power": 0,
        "solar_type": "pv_panel",
        "storm_mode_enabled": null,
        "powerwall_onboarding_settings_set": null,
        "sync_grid_alert_enabled": false,
        "breaker_alert_enabled": false
    }
}

@jaymunro
Copy link

Setup:

  • 3rd party solar panels
  • Fronius inverter (single)
  • Tesla gateway
  • Tesla Powerwall II

Note there has been an API change between Feb and May where the SITE_CONFIG now contains default_real_mode for the operation mode and BATTERY_DATA no longer contains the operation mode configuration.

PRODUCT_LIST

{
    "response":[
        {<redacted>},
        {
            "energy_site_id":<redacted>,
            "resource_type":"battery",
            "site_name":"My Home",
            "id":"<redacted>",
            "gateway_id":"<redacted>",
            "asset_site_id":"<redacted>",
            "warp_site_number":"<redacted>",
            "energy_left":10181.789473684214,
            "total_pack_energy":13846,
            "percentage_charged":73.53596326508894,
            "battery_type":"ac_powerwall",
            "backup_capable":true,
            "battery_power":1440,
            "storm_mode_enabled":true,
            "powerwall_onboarding_settings_set":true,
            "powerwall_tesla_electric_interested_in":null,
            "sync_grid_alert_enabled":true,"breaker_alert_enabled":true,
            "components":{
                "battery":true,
                "battery_type":"ac_powerwall",
                "solar":true,
                "solar_type":"pv_panel",
                "grid":true,
                "load_meter":true,
                "market_type":"residential"                
            }
        }
    ],
    "count":2
}

SITE_CONFIG

{
    "response":{
        "id":"<redacted>",
        "site_name":"My Home",
        "backup_reserve_percent":15,
        "default_real_mode":"autonomous",
        "installation_date":"2022-07-01T15:15:19+12:00",
        "user_settings":{
            "storm_mode_enabled":true,
            "powerwall_onboarding_settings_set":true,
            "powerwall_tesla_electric_interested_in":false,
            "sync_grid_alert_enabled":true,
            "breaker_alert_enabled":false},
        "components":{
            "solar":true,
            "solar_type":"pv_panel",
            "battery":true,
            "grid":true,
            "backup":true,
            "gateway":"teg",
            "load_meter":true,"tou_capable":true,
            "storm_mode_capable":true,
            "flex_energy_request_capable":false,
            "car_charging_data_supported":false,
            "off_grid_vehicle_charging_reserve_supported":false,
            "vehicle_charging_performance_view_enabled":false,
            "vehicle_charging_solar_offset_view_enabled":false,
            "battery_solar_offset_view_enabled":true,
            "solar_value_enabled":true,
            "energy_value_header":"Energy Value",
            "energy_value_subheader":"Estimated Value",
            "energy_service_self_scheduling_enabled":true,
            "show_grid_import_battery_source_cards":true,
            "set_islanding_mode_enabled":true,
            "wifi_commissioning_enabled":true,
            "backup_time_remaining_enabled":true,
            "battery_type":"ac_powerwall",
            "configurable":true,
            "grid_services_enabled":false,
            "customer_preferred_export_rule":"pv_only",
            "edit_setting_permission_to_export":true,
            "edit_setting_grid_charging":true,
            "edit_setting_energy_exports":true},
        "version":"23.4.2-1 fe55682a",
        "battery_count":1,
        "tou_settings":{
            "optimization_strategy":"economics",
            "schedule":[
                {
                    "target":"off_peak",
                    "week_days":[1,0],
                    "start_seconds":75600,
                    "end_seconds":0},
                {
                    "target":"peak",
                    "week_days":[1,0],
                    "start_seconds":0,
                    "end_seconds":75600}
            ]},
        "nameplate_power":5000,
        "nameplate_energy":13500,
        "installation_time_zone":"Pacific/Auckland",
        "max_site_meter_power_ac":14.1,
        "min_site_meter_power_ac":-1000000000,
        "geolocation":{
            "latitude":-43.501566,
            "longitude":172.5709272},
        "address":{
            "address_line1":"<redacted>",
            "city":"<redacted>",
            "state":"<redacted>",
            "zip":"<redacted>",
            "country":"NZ"            
        }}}

SITE_SUMMARY

{
    "response":{
        "resource_type":"battery",
        "site_name":"My Home",
        "gateway_id":"<redacted>",
        "energy_left":8557.578947368422,
        "total_pack_energy":13846,
        "percentage_charged":61.80542356903381,
        "battery_type":"ac_powerwall",
        "backup_capable":true,
        "battery_power":1080,
        "storm_mode_enabled":true,
        "powerwall_onboarding_settings_set":true,
        "powerwall_tesla_electric_interested_in":null,
        "sync_grid_alert_enabled":true,
        "breaker_alert_enabled":true
    }    
}

SITE_DATA

{
    "response":{
        "solar_power":0,
        "energy_left":8557.578947368422,
        "total_pack_energy":13846,
        "percentage_charged":61.80542356903381,
        "backup_capable":true,
        "battery_power":970,
        "load_power":970,
        "grid_status":"Active",
        "grid_services_active":false,
        "grid_power":0,
        "grid_services_power":0,
        "generator_power":0,
        "island_status":"on_grid",
        "storm_mode_active":false,
        "timestamp":"2023-06-02T19:26:00+12:00",
        "wall_connectors":[]
    }    
}

BATTERY_SUMMARY

{
    "response":{
        "site_name":"My Home",
        "id":"<redacted>",
        "energy_left":9567.05263157895,
        "total_pack_energy":13846,
        "percentage_charged":69.09614785193521,
        "battery_power":1020}
}

BATTERY_DATA

{"response":{
    "site_name":"My Home",
    "energy_left":9567.05263157895,
    "total_pack_energy":13846,
    "grid_status":"Active",
    "backup":{
        "backup_reserve_percent":15,
        "events":[
            {"timestamp":"2023-01-08T00:07:31+13:00","duration":34626},
            {"timestamp":"2022-07-02T13:36:25+12:00","duration":21030}],
        "events_count":0,
        "total_events":0},
    "user_settings":{
        "storm_mode_enabled":true,
        "powerwall_onboarding_settings_set":true,
        "powerwall_tesla_electric_interested_in":false,
        "sync_grid_alert_enabled":false,
        "breaker_alert_enabled":false},
    "components":{
        "solar":true,
        "solar_type":"pv_panel",
        "battery":true,
        "grid":true,
        "backup":true,
        "gateway":"teg",
        "load_meter":true,
        "tou_capable":true,
        "storm_mode_capable":true,
        "flex_energy_request_capable":false,
        "car_charging_data_supported":false,
        "off_grid_vehicle_charging_reserve_supported":false,
        "vehicle_charging_performance_view_enabled":false,
        "vehicle_charging_solar_offset_view_enabled":false,
        "battery_solar_offset_view_enabled":true,
        "solar_value_enabled":true,
        "energy_value_header":"Energy Value",
        "energy_value_subheader":"Estimated Value",
        "show_grid_import_battery_source_cards":true,
        "backup_time_remaining_enabled":true,
        "battery_type":"ac_powerwall",
        "configurable":false,
        "grid_services_enabled":false,
        "customer_preferred_export_rule":"pv_only"},
    "installation_date":"2022-07-01T15:15:19+12:00",
    "power_reading":[{
        "timestamp":"2023-06-02T18:09:54+12:00",
        "load_power":920,
        "solar_power":0,
        "grid_power":19,
        "battery_power":910,
        "generator_power":0}],
    "battery_count":1}}

@purcell-lab
Copy link

With Tesla app 4.24 the Gen 3 Wall Connector can be configured to appear in the app:

Screenshot_20230826-201633

Interestingly the home/ load is displayed reduced by the about being serviced by the wall connector.

and sure enough wall_connectors values also now appear in the API:

SITE_DATA

{
    "response": {
        "solar_power": 0,
        "energy_left": 28046.94736842105,
        "total_pack_energy": 42288,
        "percentage_charged": 66.32365533584243,
        "backup_capable": true,
        "battery_power": 920,
        "load_power": 920,
        "grid_status": "Active",
        "grid_services_active": false,
        "grid_power": 0,
        "grid_services_power": 0,
        "generator_power": 0,
        "island_status": "on_grid",
        "storm_mode_active": false,
        "timestamp": "2023-08-26T20:14:40+10:00",
        "wall_connectors": [
            {
                "din": "XXXXX",
                "vin": "XXXX",
                "wall_connector_state": 1,
                "wall_connector_fault_state": 8,
                "wall_connector_power": 419.1045
            }
        ]
    }
}

@purcell-lab
Copy link

For those who can assist with checking endpoints you can now perform this via the Developer Tools Services option.

image

@B-Hartley
Copy link

B-Hartley commented Feb 22, 2024

Setup:

Solaredge Panels & Inverter
Tesla Powerwall & Gateway

I couldn't get BATTERY_DATA or BATTERY_SUMMARY to execute?
I'm doing this from the services screen in home assistant.
What parameters do I need to make those work ?

PRODUCT_LIST

response:
  - id: 999999999
    user_id: 999999
    vehicle_id: 999999999
    vin: 5YJS999999999999
    color: null
    access_type: OWNER
    display_name: Carname
    option_codes: null
    cached_data: >-
      <snippedd>
    granular_access:
      hide_private: false
    tokens:
      - 12345456456456
      - 12345676474456
    state: online
    in_service: false
    id_s: "123456789"
    calendar_enabled: true
    api_version: 71
    backseat_token: null
    backseat_token_updated_at: null
    ble_autopair_enrolled: false
    command_signing: allowed
    release_notes_supported: true
  - energy_site_id: 9999999999
    resource_type: battery
    site_name: Whiteacres
    id: STE20201030-00399
    gateway_id: 9999999-13-J--JBL201999999999
    asset_site_id: 99999999-9999-9999-9999-999999999999
    warp_site_number: STE99999999-99999
    energy_left: 12186.421052631582
    total_pack_energy: 12498
    percentage_charged: 97.50696953617845
    battery_type: ac_powerwall
    backup_capable: true
    battery_power: -240
    go_off_grid_test_banner_enabled: null
    storm_mode_enabled: true
    powerwall_onboarding_settings_set: true
    powerwall_tesla_electric_interested_in: null
    vpp_tour_enabled: null
    sync_grid_alert_enabled: true
    breaker_alert_enabled: true
    components:
      battery: true
      battery_type: ac_powerwall
      solar: true
      solar_type: pv_panel
      grid: true
      load_meter: true
      market_type: residential
    features:
      rate_plan_manager_no_pricing_constraint: true
count: 2

Site Config

response:
  id: 99999999-13-J--JBL9999999999
  site_name: Sitename
  backup_reserve_percent: 10
  default_real_mode: autonomous
  installation_date: "2020-10-30T15:04:10Z"
  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
  components:
    solar: true
    solar_type: pv_panel
    battery: true
    grid: true
    backup: true
    gateway: teg
    load_meter: true
    tou_capable: true
    storm_mode_capable: true
    flex_energy_request_capable: false
    car_charging_data_supported: false
    off_grid_vehicle_charging_reserve_supported: true
    vehicle_charging_performance_view_enabled: false
    vehicle_charging_solar_offset_view_enabled: false
    battery_solar_offset_view_enabled: true
    solar_value_enabled: true
    energy_value_header: Energy Value
    energy_value_subheader: Estimated Value
    energy_service_self_scheduling_enabled: true
    show_grid_import_battery_source_cards: true
    set_islanding_mode_enabled: true
    wifi_commissioning_enabled: true
    backup_time_remaining_enabled: true
    rate_plan_manager_supported: true
    battery_type: ac_powerwall
    configurable: true
    grid_services_enabled: false
    customer_preferred_export_rule: battery_ok
    net_meter_mode: battery_ok
    edit_setting_permission_to_export: true
    edit_setting_grid_charging: true
    edit_setting_energy_exports: true
    system_alerts_enabled: true
  version: 23.44.0 eb113390
  battery_count: 1
  tariff_content:
    code: (edited)
    name: Intelligent (edited)
    utility: Octopus
    daily_charges:
      - amount: 0
        name: Charge
    demand_charges:
      ALL:
        ALL: 0
      Summer: {}
      Winter: {}
    energy_charges:
      ALL:
        ALL: 0
      Summer:
        ON_PEAK: 0.3
        SUPER_OFF_PEAK: 0.08
      Winter: {}
    seasons:
      Summer:
        fromDay: 1
        toDay: 31
        fromMonth: 1
        toMonth: 12
        tou_periods:
          ON_PEAK:
            - fromDayOfWeek: 0
              toDayOfWeek: 6
              fromHour: 5
              fromMinute: 30
              toHour: 23
              toMinute: 30
          SUPER_OFF_PEAK:
            - fromDayOfWeek: 0
              toDayOfWeek: 6
              fromHour: 23
              fromMinute: 30
              toHour: 5
              toMinute: 30
      Winter:
        fromDay: 0
        toDay: 0
        fromMonth: 0
        toMonth: 0
        tou_periods: {}
    sell_tariff:
      name: Intelligent (edited)
      utility: Octopus
      daily_charges:
        - amount: 0
          name: Charge
      demand_charges:
        ALL:
          ALL: 0
        Summer: {}
        Winter: {}
      energy_charges:
        ALL:
          ALL: 0
        Summer:
          ON_PEAK: 0.15
          SUPER_OFF_PEAK: 0.15
        Winter: {}
      seasons:
        Summer:
          fromDay: 1
          toDay: 31
          fromMonth: 1
          toMonth: 12
          tou_periods:
            ON_PEAK:
              - fromDayOfWeek: 0
                toDayOfWeek: 6
                fromHour: 5
                fromMinute: 30
                toHour: 23
                toMinute: 30
            SUPER_OFF_PEAK:
              - fromDayOfWeek: 0
                toDayOfWeek: 6
                fromHour: 23
                fromMinute: 30
                toHour: 5
                toMinute: 30
        Winter:
          fromDay: 0
          toDay: 0
          fromMonth: 0
          toMonth: 0
          tou_periods: {}
  nameplate_power: 5000
  nameplate_energy: 13500
  installation_time_zone: Europe/London
  off_grid_vehicle_charging_reserve_percent: 75
  max_site_meter_power_ac: 1000000000
  min_site_meter_power_ac: -8
  geolocation:
    latitude: 99.99
    longitude: -9.99
    source: Site Address Preference
  address:
    address_line1: address1
    city: city
    state: England
    zip: postcode
    country: GB
  vpp_backup_reserve_percent: 10

Site Data

response:
  solar_power: 1150
  energy_left: 12174.842105263158
  total_pack_energy: 12498
  percentage_charged: 97.41432313380668
  backup_capable: true
  battery_power: -500
  load_power: 650
  grid_status: Active
  grid_services_active: false
  grid_power: 0
  grid_services_power: 0
  generator_power: 0
  island_status: on_grid
  storm_mode_active: false
  timestamp: "2024-02-22T16:28:42Z"
  wall_connectors: []

Site Summary

response:
  resource_type: battery
  site_name: Whiteacres
  gateway_id: 999999-13-J--JBL99999999999
  energy_left: 12198.000000000002
  total_pack_energy: 12498
  percentage_charged: 97.59961593855017
  battery_type: ac_powerwall
  backup_capable: true
  battery_power: -210
  go_off_grid_test_banner_enabled: null
  storm_mode_enabled: true
  powerwall_onboarding_settings_set: true
  powerwall_tesla_electric_interested_in: null
  vpp_tour_enabled: null
  sync_grid_alert_enabled: true
  breaker_alert_enabled: true

@shawwellpete
Copy link

shawwellpete commented Oct 13, 2024

I have been having some problems with getting my Powerwall into the Home Assistant custom integration and someone here suggested using this pythin cli to test my account.

However, having never used a python CLi am doing something stupid and, despite searching, can't see what?

I downloaded the python code from the git hub, unzipped it and in terminal on the mac went to the directory with

cd /Users/myname/Downloads/TeslaPy-cli-updates/teslapy

I have python 3 installed, I can run it by typing 'python3' for example

However, when I try

python3 -e [email protected] -z PRODUCT_LIST obviosuly with my correct Tesla account email address I get the error

Unknown option: -e usage: /Library/Frameworks/Python.framework/Versions/3.12/Resources/Python.app/Contents/MacOS/Python [option] ... [-c cmd | -m mod | file | -] [arg] ... Try python -h' for more information.

Any ideas?

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

7 participants