Some time ago i added start and stop charging to Renault integration locally.
I did not yet manage to push this to HA core repo.
Here are my changes:
diff --git a/homeassistant/components/renault/services.py b/homeassistant/components/renault/services.py
index d2c7d45184..ba98c28b62 100644
--- a/homeassistant/components/renault/services.py
+++ b/homeassistant/components/renault/services.py
@@ -64,8 +64,10 @@ SERVICE_CHARGE_SET_SCHEDULES_SCHEMA = SERVICE_VEHICLE_SCHEMA.extend(
SERVICE_AC_CANCEL = "ac_cancel"
SERVICE_AC_START = "ac_start"
+SERVICE_CHARGE_START = "charge_start"
+SERVICE_CHARGE_STOP = "charge_stop"
SERVICE_CHARGE_SET_SCHEDULES = "charge_set_schedules"
-SERVICES = [SERVICE_AC_CANCEL, SERVICE_AC_START, SERVICE_CHARGE_SET_SCHEDULES]
+SERVICES = [SERVICE_AC_CANCEL, SERVICE_AC_START, SERVICE_CHARGE_START, SERVICE_CHARGE_STOP, SERVICE_CHARGE_SET_SCHEDULES]
def setup_services(hass: HomeAssistant) -> None:
@@ -89,6 +91,22 @@ def setup_services(hass: HomeAssistant) -> None:
result = await proxy.set_ac_start(temperature, when)
LOGGER.debug("A/C start result: %s", result.raw_data)
+ async def charge_start(service_call: ServiceCall) -> None:
+ """Start charging."""
+ proxy = get_vehicle_proxy(service_call.data)
+
+ LOGGER.debug("Charge start attempt");
+ result = await proxy.set_charge_start()
+ LOGGER.debug("Charge start result: %s", result.raw_data)
+
+ async def charge_stop(service_call: ServiceCall) -> None:
+ """Stop charging."""
+ proxy = get_vehicle_proxy(service_call.data)
+
+ LOGGER.debug("Charge stop attempt");
+ result = await proxy.set_charge_stop()
+ LOGGER.debug("Charge stop result: %s", result.raw_data)
+
async def charge_set_schedules(service_call: ServiceCall) -> None:
"""Set charge schedules."""
schedules: list[dict[str, Any]] = service_call.data[ATTR_SCHEDULES]
@@ -134,6 +152,18 @@ def setup_services(hass: HomeAssistant) -> None:
ac_start,
schema=SERVICE_AC_START_SCHEMA,
)
+ hass.services.async_register(
+ DOMAIN,
+ SERVICE_CHARGE_START,
+ charge_start,
+ schema=SERVICE_VEHICLE_SCHEMA,
+ )
+ hass.services.async_register(
+ DOMAIN,
+ SERVICE_CHARGE_STOP,
+ charge_stop,
+ schema=SERVICE_VEHICLE_SCHEMA,
+ )
hass.services.async_register(
DOMAIN,
SERVICE_CHARGE_SET_SCHEDULES,
diff --git a/homeassistant/components/renault/services.yaml b/homeassistant/components/renault/services.yaml
index 2dc99833d5..66c36ca171 100644
--- a/homeassistant/components/renault/services.yaml
+++ b/homeassistant/components/renault/services.yaml
@@ -27,6 +27,22 @@ ac_cancel:
device:
integration: renault
+charge_start:
+ fields:
+ vehicle:
+ required: true
+ selector:
+ device:
+ integration: renault
+
+charge_stop:
+ fields:
+ vehicle:
+ required: true
+ selector:
+ device:
+ integration: renault
+
charge_set_schedules:
fields:
vehicle:
diff --git a/homeassistant/components/renault/strings.json b/homeassistant/components/renault/strings.json
index 0b0c3d8782..008d657fff 100644
--- a/homeassistant/components/renault/strings.json
+++ b/homeassistant/components/renault/strings.json
@@ -181,6 +181,26 @@
}
}
},
+ "charge_start": {
+ "name": "Start charge",
+ "description": "Starts charging process on vehicle.",
+ "fields": {
+ "vehicle": {
+ "name": "Vehicle",
+ "description": "[%key:component::renault::services::charge_start::fields::vehicle::description%]"
+ }
+ }
+ },
+ "charge_stop": {
+ "name": "Stop charge",
+ "description": "Stops charging process on vehicle.",
+ "fields": {
+ "vehicle": {
+ "name": "Vehicle",
+ "description": "[%key:component::renault::services::charge_stop::fields::vehicle::description%]"
+ }
+ }
+ },
"charge_set_schedules": {
"name": "Update charge schedule",
"description": "Updates charge schedule on vehicle.",