tillsteinbach / WeConnect-python

Python API for the Volkswagen WeConnect Services
MIT License
109 stars 29 forks source link

VW Passat GTE: Not allowed to start climatisation without plugged in power #71

Closed Mirarkitty closed 2 years ago

Mirarkitty commented 2 years ago

The system refuses to start climatisation without plugged in power unless that setting is sent in the request:

...body {'callback': 'https://mobileapi.apps.emea.vwapps.io/vehicles/callbacks/.../climatisation/start', 'targetTemperature_K': 297.15} ... ...info The process could not be started. Please make sure that the charging cable is plugged and try again.

But with the setting added,

...body {'targetTemperature_K': 297.15, 'callback': 'https://mobileapi.apps.emea.vwapps.io/vehicles/callbacks/.../climatisation/start', 'climatisationWithoutExternalPower': True} ...status successful ...body {'callback': 'https://mobileapi.apps.emea.vwapps.io/vehicles/callbacks/.../climatisation/start', 'climatisationWithoutExternalPower': True, 'targetTemperature_K': 297.15}

it works.

I added this value to settingsDict in controls.py. This should probably reflect the value from the settings instead:

                elif 'targetTemperature_F' in settingsDict:
                    settingsDict['targetTemperature_K'] = farenheitToKelvin(settingsDict['targetTemperature_F'])
                else:
                    settingsDict['targetTemperature_K'] = celsiusToKelvin(20.5)
+            settingsDict['climatisationWithoutExternalPower'] = True

        data = json.dumps(settingsDict)
        controlResponse = self.vehicle.weConnect.session.post(url, data=data, allow_redirects=True)
        if controlResponse.status_code != requests.codes['ok']:
            errorDict = controlResponse.json()
tillsteinbach commented 2 years ago

Hey, thank you for reporting and the excellent analysis. I will release the fix as soon as possible.

tillsteinbach commented 2 years ago

Should be fixed in 0.47.1 release

Mirarkitty commented 2 years ago

Great, thanks!