Bryantclan
Member
thread is a little old, but I was having the same issue, and thought I would drop the solution in case someone else needs it.
Setting mode:
curl -s -k --header "Authorization: Bearer $TOKEN" -X POST -H "Content-Type: application/json" -d '{"default_real_mode":"'$1'"}' "https://owner-api.teslamotors.com/api/1/energy_sites/NNNN/operation"
Setting reserve:
curl -s -k --header "Authorization: Bearer $TOKEN" -X POST -H "Content-Type: application/json" -d '{"backup_reserve_percent":'$2'}' "https://owner-api.teslamotors.com/api/1/energy_sites/NNNN/backup"
When using the public API you need to add the content type to the header, this is not required when taking to the gateway on the local address. You also can't set the backup reserve in the same post like you can with the local gateway.
Shaun
Setting mode:
curl -s -k --header "Authorization: Bearer $TOKEN" -X POST -H "Content-Type: application/json" -d '{"default_real_mode":"'$1'"}' "https://owner-api.teslamotors.com/api/1/energy_sites/NNNN/operation"
Setting reserve:
curl -s -k --header "Authorization: Bearer $TOKEN" -X POST -H "Content-Type: application/json" -d '{"backup_reserve_percent":'$2'}' "https://owner-api.teslamotors.com/api/1/energy_sites/NNNN/backup"
When using the public API you need to add the content type to the header, this is not required when taking to the gateway on the local address. You also can't set the backup reserve in the same post like you can with the local gateway.
Shaun