Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

directCharge.isActive switch does not work #181

Closed
barto64 opened this issue May 25, 2023 · 4 comments
Closed

directCharge.isActive switch does not work #181

barto64 opened this issue May 25, 2023 · 4 comments

Comments

@barto64
Copy link

barto64 commented May 25, 2023

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
Copy link
Author

barto64 commented May 30, 2023

charger_sensor is also not available

@marktcom
Copy link

marktcom commented Jun 8, 2023

climate switch also no function.

@fredriklj
Copy link
Collaborator

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
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants