tesla icon indicating copy to clipboard operation
tesla copied to clipboard

SetTemperature defaulting passenger and driver temperature to "LOW"

Open pushc6 opened this issue 5 years ago • 3 comments

Not sure if this is just an issue with the model 3, but when setting the temperature via the command and putting the proper temperature in celcius the car sets the temperature to "LOW" which is 15 degrees C. Can you confirm this is working on the model s, or is this perhaps a change to the API? Currently researching, but don't have access to a model s to compare against.

pushc6 avatar Feb 09 '19 03:02 pushc6

I have the same problem. The fix:

--- a/commands.go +++ b/commands.go @@ -184,8 +184,9 @@ func (v Vehicle) LockDoors() error { func (v Vehicle) SetTemprature(driver float64, passenger float64) error { driveTemp := strconv.FormatFloat(driver, 'f', -1, 32) passengerTemp := strconv.FormatFloat(passenger, 'f', -1, 32)

  •   apiUrl := BaseURL + "/vehicles/" + strconv.FormatInt(v.ID, 10) + "/command/set_temps?driver_temp=" + driveTemp + "&passenger_temp=" + passengerTemp
    
  •   _, err := ActiveClient.post(apiUrl, nil)
    
  •   apiUrl := BaseURL + "/vehicles/" + strconv.FormatInt(v.ID, 10) + "/command/set_temps"
    
  •   theJson := `{"driver_temp": "` + driveTemp + `", "passenger_temp":` + passengerTemp + `}`
    
  •   _, err := ActiveClient.post(apiUrl, []byte(theJson))
      return err
    

}

jiosec avatar Feb 05 '20 06:02 jiosec

Confirmed, this happens with my Model 3 as well. I'm unclear whether making this change would break other Model users or not, can you investigate?

bogosj avatar Sep 21 '20 22:09 bogosj

https://github.com/jsgoecke/tesla/pull/33

bogosj avatar Sep 21 '20 22:09 bogosj