vloschiavo / powerwall2

Tesla Powerwall 2 - Local Gateway API documentation
Apache License 2.0
288 stars 51 forks source link

Documentation Updates #31

Closed frownbreaker closed 3 years ago

frownbreaker commented 4 years ago

You asked for updates I just got this working.

Thanks for the helpful guide!

` Note: The below API calls require authentication

Login POST /api/login/Basic

Authentication example:

Here is an example login do not change the username and a serial number. The password is LAST FIVE CHARACTERS OF YOUR SERIAL NUMBER

Request:

This is a Windows Example curl -k -s -i -X POST -H "Content-Type: application/json" -d "{\"username\":\"customer\",\"password\":\"1234T\",\"force_sm_off\":false}" https://IPAddress/api/login/Basic

Response:

{"email":null,"firstname":"Tesla","lastname":"Energy","roles":["Provider_Engineer"],"token":"OgiGHjoNvwx17SRIaYFIOWPJSaKBYwmMGc5K4tTz57EziltPYsdtjU_DJ08tJqaWbWjTuI3fa_8QW32ED5zg1A==","provider":"Basic"}

Save the token for use with the below calls.

vloschiavo commented 3 years ago

Thanks! Also, see https://github.com/vloschiavo/powerwall2/blob/master/samples/powerwallstats.sh for a bash example that works with version 20.49.0.