Replies: 1 comment 6 replies
-
@jasonacox so, now that we can plug in different implementations for Tesla API, should we try to add this Fleet API to the mix of the existing ones? |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Tesla FleetAPI for Powerwall
I have added a new
fleetapi.py
tool and python class: https://github.com/jasonacox/pypowerwall/tree/main/tools/fleetapiFleetAPI is the official Tesla API RESTful data and command service for Tesla products, including Powerwalls. Users can interact with their own devices, or devices for which they have been granted access by a customer, through this API.
Requirements
Setup
Step 1 - Sign in to Tesla Developer Portal and make an App Access Request: See Tesla App Access Request - During this process, you will need to set up and remember the following account settings:
code
, which is a one-time use authorization code needed to generate the Bearer auth and Refresh token used to access your Tesla Powerwall energy devices. Place the index.html file in a folder under this domain and use this as the REDIRECT_URI path in the setup below. Alternatively, you can do nothing and just copy the URL from the 404 page during the authorzation process (the code is in the URL). 😁Step 2 - Run the create_pem_key.py script and place the public key on your website at the URL: https://{DOMAIN}/.well-known/appspecific/com.tesla.3p.public-key.pem
Step 3 - Run SETUP using the
fleetapi.py
script. This will ask for all the details above, generate a partner token, register your partner account, and generate a user token needed to access your Powerwall. It will also get the site_id and run a test query to pull live power data for your Powerwall.Command Line Usage
The
fleetapi.py
script is a command line utility and python class that you can use to monitor and manage your Powerwall. Here are teh command lines:Examples
FleetAPI Class
You can import and use the FleetAPI class in your own scripts.
Example Usage
References
Beta Was this translation helpful? Give feedback.
All reactions