skodaconnect / homeassistant-skodaconnect

Skoda Connect - A home assistant plugin to add integration with your car
Apache License 2.0
232 stars 28 forks source link

Set "charger max ampere" #130

Closed Weyel closed 2 years ago

Weyel commented 2 years ago

Hi, I'm using the Integration with my Skoda Octavia RS iV and I would like to control the charging power via HA. The PHEV does only have 2 options: Maximum Load = ~3,5 kW and Reduced= ~1,5kW, which can be controlled by the Skoda Connect App. In this Integration I can only see the State in "Charger max ampere" but I'm not able to change it. Is there any way to do it?

dwapps commented 2 years ago

You can use the service call _skodaconnect.set_charger_maxcurrent to set the max amps.

Charger maximum current (1-16 tested OK for Superb iV, Enyaq limited to "Maximum"/"Reduced")

Weyel commented 2 years ago

Thanks a lot!

JesperThorup commented 2 years ago

I'm getting an error trying to set the reduced charging on my Enyaq: image

websocket_api script: Error executing script. Unexpected error for call_service at pos 1: Invalid or no response Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 447, in _async_step await getattr(self, handler)() File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 680, in _async_call_service_step await service_task File "/usr/src/homeassistant/homeassistant/core.py", line 1713, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1750, in _execute_service await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)( File "/config/custom_components/skodaconnect/__init__.py", line 374, in set_current if await car.set_charger_current(current) is True: File "/usr/local/lib/python3.10/site-packages/skodaconnect/vehicle.py", line 380, in set_charger_current return await self.set_charger(data) File "/usr/local/lib/python3.10/site-packages/skodaconnect/vehicle.py", line 430, in set_charger response = await self._connection.setCharging(self.vin, data) File "/usr/local/lib/python3.10/site-packages/skodaconnect/connection.py", line 1530, in setCharging return await self._setSkodaAPI('charging', vin, json = data) File "/usr/local/lib/python3.10/site-packages/skodaconnect/connection.py", line 1510, in _setSkodaAPI raise SkodaException('Invalid or no response') skodaconnect.exceptions.SkodaException: Invalid or no response

Tried multiple times, with a reboot, and all other functions works. for example setting to 80% or 100% charging.

Running version 1.0.69 of the Skoda Connect

dwapps commented 2 years ago

According to the readme the enyaq doesn't support setting amps for the max current setting. So I guess you'd have to set it as a string to either "Maximum" or "Reduced" and not as a number.

Charger maximum current (1-16 tested OK for Superb iV, Enyaq limited to "Maximum"/"Reduced")

JesperThorup commented 2 years ago

@dwapps In the doc it also says: 252 = Reduced, 254 = Maximum.

And I'm trying to set it to 252 witch should be reduced, as it only accepts int value..

Farfar commented 2 years ago

@dwapps In the doc it also says: 252 = Reduced, 254 = Maximum.

And I'm trying to set it to 252 witch should be reduced, as it only accepts int value..

Integer values only works for cars other than Enyaq. For Enyaq use Reduced or Maximum as value. If it still doesn't it's because of server side issues.

JesperThorup commented 2 years ago

@Farfar Ah.. The GUI won't let me parse a string, but using the yaml editor it works flawless :)