twinlifenh
Member
I'm trying to play around with the API using python.
Now I am running into a little barrier trying to send a command to the car.
I'm using the teslajson python class to connect to the Tesla API.
Sending a command to sound the horn work. Now what I can't figure out is how I can send the post data when e.g. trying to set the charge limit.
If I look into the teslajson code, I can see I need to send the data as JSON. This is where I get blocked.
I tried this:
Now this formats the set_charge_limit percentage as JSON (if I'm correct).
However this throws errors my way when executing.
Someone that can point me in the right direction here.
Now I am running into a little barrier trying to send a command to the car.
I'm using the teslajson python class to connect to the Tesla API.
Sending a command to sound the horn work. Now what I can't figure out is how I can send the post data when e.g. trying to set the charge limit.
If I look into the teslajson code, I can see I need to send the data as JSON. This is where I get blocked.
I tried this:
Code:
payload = json.dumps({"percent": "85"})
response = vehicle.post('set_charge_limit',payload)
Now this formats the set_charge_limit percentage as JSON (if I'm correct).
However this throws errors my way when executing.
Someone that can point me in the right direction here.