Thanks Tom. There is an API to get and change the reserve capacity, but I thought it would be safer to keep the app as read only (I don't want to inadvertantly break someone's system with a bad API call).
I understand proper Time Of Use settings are coming imminently, but if you did want to roll your own I'd suggest doing this with a script you can launch with the scheduler, rather than a GUI app.
Thanks for the app works great. I have been trying for some time to do exactly as you outline, I have my own script which reads the powerwall data fine and controls a few things around the house accordingly (mainly hot water booster) but I'd love to be able to adjust the reserve as weather / solar predictions arn't going to be part of Tesla's app for some time I would think. I can't however get the API to work, have you done this? The Tesla forums (which for some reason I can't post as I am blocked!) say you get get the token using /api/login/Basic and set the level using the retrieved token with /api/operation. I cant get past step 1 and retrieve the token
curl -i -X POST -d "{"username":"","password":"Sxxxxxxxxx","force_sm_off":false}" "
http://xxx.xxx.x.xxx/api/login/Basic"
or many variations the best I can get is
HTTP/1.1 401 Unauthorized
Access-Control-Allow-Credentials: false
Access-Control-Allow-Headers: X-Requested-With, X-HTTP-Method-Override, Content-Type, Accept, Accept-Encoding, Authorization
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS
Access-Control-Allow-Origin: *
Access-Control-Max-Age: 86400
Content-Type: application/json
X-Content-Type-Options: nosniff
Date: Wed, 14 Mar 2018 02:35:35 GMT
Content-Length: 66
{"code":401,"error":"Invalid Credentials","message":"Login Error"}
the password and ip address I use are definitely correct as I log into the wizard ok.
Also once I have the token I am assuming send something like
curl -i -X POST -d "{"backup_reserve_percent": 50, "mode":"self_consumption", "token":"the_retrieved_token"}"
http://xxx.xxx.x.xxx/api/operation"
curl -X GET "
http://xxx.xxx.x.xxx/api/config/completed"
curl -X GET "htttp://xxx.xxx.x.xxx/api/sitemaster/start"
??
I'm a rotten programmer but usually can get by, but clearly am missing something here, any advice would be appreciated.
Cheers