Farfar / homeassistant-seatconnect

Seat Connect - A home assistant plugin to add integration with your car
Apache License 2.0
61 stars 14 forks source link

Window Heater cannot be activated #18

Closed tofferlicious closed 2 years ago

tofferlicious commented 2 years ago

I am using the latest release https://github.com/Farfar/homeassistant-seatconnect/releases/tag/v1.1.2 but this also happened with the versions before.

When trying to toggle the (front-)window heater: grafik

I get the following error message: Logger: seatconnect.connection Source: /usr/local/lib/python3.9/site-packages/seatconnect/connection.py:638 First occurred: 15:13:36 (1 occurrences) Last logged: 15:13:36

Unhandled HTTP exception: 403, message='Forbidden', url=URL('https://msg.volkswagen.de/fs-car/bs/climatisation/v1/seat/ES/vehicles/**vin**/climater/actions')

Logger: homeassistant.components.websocket_api.http.connection Source: custom_components/seatconnect/switch.py:57 Integration: Home Assistant WebSocket API (documentation, issues) First occurred: 15:13:36 (1 occurrences) Last logged: 15:13:36

[548504601936] Invalid or no response for endpoint https://msg.volkswagen.de/fs-car/bs/climatisation/v1/seat/ES/vehicles/**vin**/climater/actions Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 185, in handle_call_service await hass.services.async_call( File "/usr/src/homeassistant/homeassistant/core.py", line 1495, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1530, in _execute_service await handler.job.target(service_call) File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 209, in handle_service await self.hass.helpers.service.entity_service_call( File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 663, in entity_service_call future.result() # pop exception if have File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 896, in async_request_call await coro File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 700, in _handle_entity_call await result File "/config/custom_components/seatconnect/switch.py", line 57, in async_turn_on await self.instrument.turn_on() File "/usr/local/lib/python3.9/site-packages/seatconnect/dashboard.py", line 564, in turn_on await self.vehicle.set_window_heating('start') File "/usr/local/lib/python3.9/site-packages/seatconnect/vehicle.py", line 545, in set_window_heating return await self._set_climater(data) File "/usr/local/lib/python3.9/site-packages/seatconnect/vehicle.py", line 622, in _set_climater response = await self._connection.setClimater(self.vin, self._apibase, data, spin) File "/usr/local/lib/python3.9/site-packages/seatconnect/connection.py", line 1194, in setClimater return await self._setVWAPI(f'{baseurl}/fs-car/bs/climatisation/v1/{BRAND}/{COUNTRY}/vehicles/{vin}/climater/actions', json = data) File "/usr/local/lib/python3.9/site-packages/seatconnect/connection.py", line 1158, in _setVWAPI raise SeatException(f'Invalid or no response for endpoint {endpoint}') seatconnect.exceptions.SeatException: Invalid or no response for endpoint https://msg.volkswagen.de/fs-car/bs/climatisation/v1/seat/ES/vehicles/**vin**/climater/actions

tofferlicious commented 2 years ago

I should mention, that activating the window heater is not available from the Seat Connect App. But this integration has quite a lot more features already than the App 😄

Farfar commented 2 years ago

I should mention, that activating the window heater is not available from the Seat Connect App. But this integration has quite a lot more features already than the App 😄

It's not 100% certain that I can make this work. Can you enable full API debug logging and please post the logs from before the traceback as well? Perhaps I'll be able to figure out why it's not working. It might be though that the API expose the endpoint but it doesn't actually do anything.

tofferlicious commented 2 years ago

Thanks for looking into this. It would be really awesome to remotely defrost the window!

I assume this is the way to enable full logging for the component, by adding this to the configuration.yaml or?

logger:   default: info   logs:     custom_components.seatconnect: debug

I just tried and could not see more logs unfortunately after rebooting...

Farfar commented 2 years ago

Thanks for looking into this. It would be really awesome to remotely defrost the window!

I assume this is the way to enable full logging for the component, by adding this to the configuration.yaml or?

logger:   default: info   logs:     custom_components.seatconnect: debug

I just tried and could not see more logs unfortunately after rebooting...

Yes but you also need to enable in the integration. Go to your integrations and click configure and then enable full api debug.

Farfar commented 2 years ago

Also add 'seatconnect.connection: debug' in your configuration.yaml to get logs from library.

tofferlicious commented 2 years ago

@Farfar sorry, took me a while and I am not even sure, that it now contains everything:

2022-02-04 16:22:51 DEBUG (MainThread) [seatconnect.connection] HTTP POST "https://msg.volkswagen.de/fs-car/bs/climatisation/v1/seat/ES/vehicles/***vin***/climater/actions" 2022-02-04 16:22:51 DEBUG (MainThread) [seatconnect.connection] Request failed. Data: {'json': {'action': {'type': 'startWindowHeating'}}}, HTTP request headers: {'Connection': 'keep-alive', 'Accept-charset': 'UTF-8', 'Accept': 'application/json', 'X-Client-Id': 'client-Id', 'X-App-Version': '1.4.0', 'X-App-Name': 'SEATConnect', 'User-Agent': 'okhttp/3.10.0', 'Authorization': 'Bearer token', 'tokentype': 'MBB'} 2022-02-04 16:22:51 ERROR (MainThread) [seatconnect.connection] Unhandled HTTP exception: 403, message='Forbidden', url=URL('https://msg.volkswagen.de/fs-car/bs/climatisation/v1/seat/ES/vehicles/***vin***/climater/actions') 2022-02-04 16:22:51 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [547938642864] Invalid or no response for endpoint https://msg.volkswagen.de/fs-car/bs/climatisation/v1/seat/ES/vehicles/***vin***/climater/actions Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 185, in handle_call_service await hass.services.async_call( File "/usr/src/homeassistant/homeassistant/core.py", line 1495, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1530, in _execute_service await handler.job.target(service_call) File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 209, in handle_service await self.hass.helpers.service.entity_service_call( File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 663, in entity_service_call future.result() # pop exception if have File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 896, in async_request_call await coro File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 700, in _handle_entity_call await result File "/config/custom_components/seatconnect/switch.py", line 57, in async_turn_on await self.instrument.turn_on() File "/usr/local/lib/python3.9/site-packages/seatconnect/dashboard.py", line 564, in turn_on await self.vehicle.set_window_heating('start') File "/usr/local/lib/python3.9/site-packages/seatconnect/vehicle.py", line 545, in set_window_heating return await self._set_climater(data) File "/usr/local/lib/python3.9/site-packages/seatconnect/vehicle.py", line 622, in _set_climater response = await self._connection.setClimater(self.vin, self._apibase, data, spin) File "/usr/local/lib/python3.9/site-packages/seatconnect/connection.py", line 1193, in setClimater return await self._setVWAPI(f'{baseurl}/fs-car/bs/climatisation/v1/{BRAND}/{COUNTRY}/vehicles/{vin}/climater/actions', json = data) File "/usr/local/lib/python3.9/site-packages/seatconnect/connection.py", line 1157, in _setVWAPI raise SeatException(f'Invalid or no response for endpoint {endpoint}') seatconnect.exceptions.SeatException: Invalid or no response for endpoint https://msg.volkswagen.de/fs-car/bs/climatisation/v1/seat/ES/vehicles/***vin***/climater/actions

Farfar commented 2 years ago

Unfortunately this is not something that's fixable since the API doesn't respond for this action. Probably not available for your vehicle but I can't find the relevant data to determine that window heating isn't available.