vloschiavo/powerwall2

Auth API Setup command returns "Method Not Allowed"

quella opened this issue · 1 comments

Curl Version:
curl -s -i -X POST -H "Content-Type: application/json" -d '{"username":"","password":"ST123456789","force_sm_off":false}' http://192.168.xxx.xxx/api/login/Basic

URL Version:
http://192.168.xxx.xxx/api/login/Basic?username=USERNAME&password=PASSWORD&force_sm_off=false

I have tried the above API call to the Powerwall2 (v1.37.1) both via CURL, HTTP Post (browser) and Postman API tool and every reply sends me a "Method Not Allowed" (Error Code 405). Used my IP, Username, and Password. I have disabled cert checking and cannot seem to get the correct response.

Thoughts or ideas on what to try next? I would like to have the ability to change the backup options via a push button microcontroller setup. When the dryer, AC, or range are on, I want to disabled the battery from being drained. After the heavy load is off, I would like to push the button again and enable it. I can do this via the App, but it had a delay in the request up to an hour.

Strange that you're getting a 405 as those APIs have moved to https and should generate a 301/Moved Permanently. Have you tried https?

For reference, here is the Windows curl command I use. Note that I add -k to ignore cert and drop -s (silent) for verbosity.

C:\WINDOWS\system32>curl -i -k -X POST -H "Content-Type: application/json" -d "{"username":"customer","password":"password","force_sm_off":false}" https://192.168.xxx.xxx/api/login/Basic