CJNE / ha-porscheconnect

Porsche Connect custom component for Home Assistant
MIT License
29 stars 12 forks source link

directCharge.isActive switch does not work #181

Closed barto64 closed 4 months ago

barto64 commented 1 year ago

Version of the custom_component

0.0.13

Configuration

N/A

Describe the bug

The switch directCharge.isActive does not work, when trying to execute the swith.turn.on service it produces an error. Log attached. Nevertheless, it works fine from the mobile app and when directCharge is activated by the App the switch gets its satus updated inHA.

Debug log

2023-05-25 14:09:18.961 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [281472504004032] unexpected character: line 1 column 1 (char 0) Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 199, in handle_call_service await hass.services.async_call( File "/usr/src/homeassistant/homeassistant/core.py", line 1849, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1889, in _execute_service await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)( File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 226, in handle_service await service.entity_service_call( File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 798, in entity_service_call future.result() # pop exception if have File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 980, in async_request_call await coro File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 838, in _handle_entity_call await result File "/config/custom_components/porscheconnect/switch.py", line 38, in async_turn_on await self.coordinator.controller.directChargeOn(self.vin, None, True) File "/usr/local/lib/python3.10/site-packages/pyporscheconnectapi/client.py", line 401, in directChargeOn return await self._setDirectCharge( File "/usr/local/lib/python3.10/site-packages/pyporscheconnectapi/client.py", line 100, in _setDirectCharge progressResult = await self._connection.post( File "/usr/local/lib/python3.10/site-packages/pyporscheconnectapi/connection.py", line 213, in post return await resp.json() File "/usr/src/homeassistant/homeassistant/helpers/aiohttp_client.py", line 72, in json return await super().json(*args, loads=loads, **kwargs) File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1120, in json return loads(stripped.decode(encoding)) orjson.JSONDecodeError: unexpected character: line 1 column 1 (char 0)

barto64 commented 1 year ago

charger_sensor is also not available

marktcom commented 1 year ago

climate switch also no function.

fredriklj commented 1 year ago

The issue with direct charging is addressed in version 0.1.5 of pyporscheconnectapi:

https://github.com/CJNE/pyporscheconnectapi

If there are other issues as well, please report them separately. Please make sure to test with the latest version of the library.

fredriklj commented 4 months ago

We're back to square one, cf. #242 and reopen any new issues.