From ae354677981c5307a06fc98f5aed6faca9191388 Mon Sep 17 00:00:00 2001 From: marq24 Date: Sun, 30 Jun 2024 16:47:33 +0200 Subject: [PATCH] cloud support --- custom_components/goecharger_api2/__init__.py | 66 +++++--- .../goecharger_api2/config_flow.py | 141 +++++++++++++++--- custom_components/goecharger_api2/const.py | 3 + .../goecharger_api2/manifest.json | 2 +- .../pygoecharger_ha/__init__.py | 39 +++-- .../goecharger_api2/translations/de.json | 38 ++++- .../goecharger_api2/translations/en.json | 38 ++++- 7 files changed, 265 insertions(+), 62 deletions(-) diff --git a/custom_components/goecharger_api2/__init__.py b/custom_components/goecharger_api2/__init__.py index 879e9f6..9776056 100644 --- a/custom_components/goecharger_api2/__init__.py +++ b/custom_components/goecharger_api2/__init__.py @@ -5,7 +5,7 @@ from homeassistant.components.number import NumberDeviceClass from homeassistant.config_entries import ConfigEntry, ConfigEntryState -from homeassistant.const import CONF_HOST, CONF_TYPE, CONF_ID, CONF_SCAN_INTERVAL +from homeassistant.const import CONF_HOST, CONF_TYPE, CONF_ID, CONF_SCAN_INTERVAL, CONF_MODE, CONF_TOKEN from homeassistant.core import Config, Event, SupportsResponse from homeassistant.core import HomeAssistant from homeassistant.exceptions import ConfigEntryNotReady @@ -19,6 +19,8 @@ from custom_components.goecharger_api2.pygoecharger_ha import GoeChargerApiV2Bridge, TRANSLATIONS from custom_components.goecharger_api2.pygoecharger_ha.keys import Tag from .const import ( + LAN, + WAN, NAME, DOMAIN, MANUFACTURER, @@ -161,9 +163,20 @@ class GoeChargerDataUpdateCoordinator(DataUpdateCoordinator): def __init__(self, hass: HomeAssistant, config_entry): lang = hass.config.language.lower() self.name = config_entry.title - self.bridge = GoeChargerApiV2Bridge(host=config_entry.options.get(CONF_HOST, config_entry.data.get(CONF_HOST)), - web_session=async_get_clientsession(hass), - lang=lang) + if CONF_MODE in config_entry.data and config_entry.data.get(CONF_MODE) == WAN: + self.mode = WAN + self.bridge = GoeChargerApiV2Bridge(host=None, + serial=config_entry.options.get(CONF_ID, config_entry.data.get(CONF_ID)), + token=config_entry.options.get(CONF_TOKEN, config_entry.data.get(CONF_TOKEN)), + web_session=async_get_clientsession(hass), + lang=lang) + else: + self.mode = LAN + self.bridge = GoeChargerApiV2Bridge(host=config_entry.options.get(CONF_HOST, config_entry.data.get(CONF_HOST)), + serial=None, + token=None, + web_session=async_get_clientsession(hass), + lang=lang) global SCAN_INTERVAL SCAN_INTERVAL = timedelta(seconds=config_entry.options.get(CONF_SCAN_INTERVAL, @@ -234,19 +247,32 @@ async def async_write_key(self, key: str, value, entity: Entity = None) -> dict: async def read_versions(self): await self.bridge.read_versions() - self._device_info_dict = { - "identifiers": { - ("DOMAIN", DOMAIN), - ("SERIAL", self._serial), - ("IP", self._config_entry.options.get(CONF_HOST, self._config_entry.data.get(CONF_HOST))), - }, - "manufacturer": MANUFACTURER, - "suggested_area": "Garage", - "name": NAME, - "model": self._config_entry.data.get(CONF_TYPE), - "sw_version": self.bridge._versions[Tag.FWV.key] - # hw_version - } + if self.mode == LAN: + self._device_info_dict = { + "identifiers": {( + DOMAIN, + self._config_entry.data.get(CONF_HOST), + self._config_entry.title)}, + "manufacturer": MANUFACTURER, + "suggested_area": "Garage", + "name": self._config_entry.title, + "model": self._config_entry.data.get(CONF_TYPE), + "sw_version": self.bridge._versions[Tag.FWV.key] + # hw_version + } + else: + self._device_info_dict = { + "identifiers": {( + DOMAIN, + self._config_entry.data.get(CONF_TOKEN), + self._config_entry.title)}, + "manufacturer": MANUFACTURER, + "suggested_area": "Garage", + "name": self._config_entry.title, + "model": self._config_entry.data.get(CONF_TYPE), + "sw_version": self.bridge._versions[Tag.FWV.key] + # hw_version + } # fetching the available cards that are enabled self.available_cards_idx = [] @@ -295,7 +321,11 @@ def __init__(self, coordinator: GoeChargerDataUpdateCoordinator, description: En self.entity_description = description self.coordinator = coordinator - self.entity_id = f"{DOMAIN}.goe_{self.coordinator._serial}_{self._attr_translation_key}" + + if self.coordinator.mode == WAN: + self.entity_id = f"{DOMAIN}.goe_wan_{self.coordinator._serial}_{self._attr_translation_key}" + else: + self.entity_id = f"{DOMAIN}.goe_{self.coordinator._serial}_{self._attr_translation_key}" def _name_internal(self, device_class_name: str | None, platform_translations: dict[str, Any], ) -> str | UndefinedType | None: diff --git a/custom_components/goecharger_api2/config_flow.py b/custom_components/goecharger_api2/config_flow.py index 4a7d4d1..cb04960 100644 --- a/custom_components/goecharger_api2/config_flow.py +++ b/custom_components/goecharger_api2/config_flow.py @@ -1,19 +1,24 @@ import logging +from typing import Final import voluptuous as vol from homeassistant import config_entries -from homeassistant.const import CONF_ID, CONF_HOST, CONF_MODEL, CONF_TYPE, CONF_SCAN_INTERVAL +from homeassistant.const import CONF_ID, CONF_HOST, CONF_MODEL, CONF_TYPE, CONF_SCAN_INTERVAL, CONF_TOKEN, CONF_MODE from homeassistant.core import callback +from homeassistant.helpers import selector from homeassistant.helpers.aiohttp_client import async_create_clientsession from custom_components.goecharger_api2.pygoecharger_ha import GoeChargerApiV2Bridge from custom_components.goecharger_api2.pygoecharger_ha.keys import Tag from .const import ( - DOMAIN, CONF_11KWLIMIT + DOMAIN, CONF_11KWLIMIT, LAN, WAN ) _LOGGER: logging.Logger = logging.getLogger(__package__) +SETUP_SYS_TYPE: Final = "stype" +SYSTEM_TYPES: Final = [LAN, WAN] + class GoeChargerApiV2FlowHandler(config_entries.ConfigFlow, domain=DOMAIN): """Config flow for goecharger_api2.""" @@ -29,6 +34,38 @@ def __init__(self): self._serial = "" async def async_step_user(self, user_input=None): + self._errors = {} + if user_input is not None: + self._selected_system = user_input + + if self._selected_system.get(SETUP_SYS_TYPE) == WAN: + return await self.async_step_user_wan() + else: + # return await self.async_step_mode() + return await self.async_step_user_lan() + else: + user_input = {} + user_input[SETUP_SYS_TYPE] = LAN + + return self.async_show_form( + step_id="user", + data_schema=vol.Schema( + { + vol.Required(SETUP_SYS_TYPE, default=user_input.get(SETUP_SYS_TYPE, LAN)): + selector.SelectSelector( + selector.SelectSelectorConfig( + options=SYSTEM_TYPES, + mode=selector.SelectSelectorMode.DROPDOWN, + translation_key=SETUP_SYS_TYPE, + ) + ) + } + ), + last_step=False, + errors=self._errors, + ) + + async def async_step_user_lan(self, user_input=None): """Handle a flow initialized by the user.""" self._errors = {} @@ -37,23 +74,24 @@ async def async_step_user(self, user_input=None): # return self.async_abort(reason="single_instance_allowed") if user_input is not None: - valid = await self._test_host(host=user_input[CONF_HOST]) + valid = await self._test_host(host=user_input[CONF_HOST], serial=None, token=None) if valid: + user_input[CONF_MODE] = LAN user_input[CONF_MODEL] = self._model.split(' ')[0] - user_input[CONF_TYPE] = f"{self._type} [{self._model}]" + user_input[CONF_TYPE] = f"{self._type} [{self._model}] Local" user_input[CONF_ID] = self._serial user_input[CONF_SCAN_INTERVAL] = max(5, user_input[CONF_SCAN_INTERVAL]) - title = f"go-eCharger API v2 [{self._serial}]" + title = f"go-eCharger API v2 [{self._serial}] Local" return self.async_create_entry(title=title, data=user_input) else: - self._errors["base"] = "auth" + self._errors["base"] = "auth_lan" else: user_input = {} user_input[CONF_HOST] = "" user_input[CONF_SCAN_INTERVAL] = 5 return self.async_show_form( - step_id="user", + step_id="user_lan", data_schema=vol.Schema({ vol.Required(CONF_HOST, default=user_input.get(CONF_HOST)): str, vol.Required(CONF_SCAN_INTERVAL, default=user_input.get(CONF_SCAN_INTERVAL)): int, @@ -62,15 +100,53 @@ async def async_step_user(self, user_input=None): errors=self._errors ) - async def _test_host(self, host): + async def async_step_user_wan(self, user_input=None): + """Handle a flow initialized by the user.""" + self._errors = {} + + # Uncomment the next 2 lines if only a single instance of the integration is allowed: + # if self._async_current_entries(): + # return self.async_abort(reason="single_instance_allowed") + + if user_input is not None: + valid = await self._test_host(host=None, serial=user_input[CONF_ID], token=user_input[CONF_TOKEN]) + if valid: + user_input[CONF_MODE] = WAN + user_input[CONF_MODEL] = self._model.split(' ')[0] + user_input[CONF_TYPE] = f"{self._type} [{self._model}] Cloud" + user_input[CONF_ID] = self._serial + user_input[CONF_SCAN_INTERVAL] = max(30, user_input[CONF_SCAN_INTERVAL]) + title = f"go-eCharger API v2 [{self._serial}] Cloud" + return self.async_create_entry(title=title, data=user_input) + else: + self._errors["base"] = "auth_wan" + else: + user_input = {} + user_input[CONF_ID] = "YOUR-SERIAL-HERE" + user_input[CONF_TOKEN] = "YOUR-API-KEY-HERE" + user_input[CONF_SCAN_INTERVAL] = 60 + + return self.async_show_form( + step_id="user_wan", + data_schema=vol.Schema({ + vol.Required(CONF_ID, default=user_input.get(CONF_ID)): str, + vol.Required(CONF_TOKEN, default=user_input.get(CONF_TOKEN)): str, + vol.Required(CONF_SCAN_INTERVAL, default=user_input.get(CONF_SCAN_INTERVAL)): int, + }), + last_step=True, + errors=self._errors + ) + + async def _test_host(self, host, serial, token): try: session = async_create_clientsession(self.hass) - client = GoeChargerApiV2Bridge(host=host, web_session=session, lang=self.hass.config.language.lower()) + client = GoeChargerApiV2Bridge(host=host, serial=serial, token=token, web_session=session, + lang=self.hass.config.language.lower()) ret = await client.read_system() if ret is not None and len(ret) > 0: await client.read_versions() - #self._oem = ret[Tag.OEM.key] + # self._oem = ret[Tag.OEM.key] self._type = str(ret[Tag.TYP.key]).replace('_', ' ') self._model = f"{ret[Tag.VAR.key]} kW" self._serial = ret[Tag.SSE.key] @@ -98,29 +174,60 @@ def __init__(self, config_entry): async def async_step_init(self, user_input=None): # pylint: disable=unused-argument """Manage the options.""" - return await self.async_step_user() + if self.options.get(CONF_MODE, None) == WAN: + return await self.async_step_user_wan() + else: + return await self.async_step_user_lan() - async def async_step_user(self, user_input=None): + async def async_step_user_lan(self, user_input=None): + """Handle a flow initialized by the user.""" + interval = 5 + step_type = "user_lan" + if user_input is not None: + user_input[CONF_SCAN_INTERVAL] = max(interval, user_input[CONF_SCAN_INTERVAL]) + self.options.update(user_input) + return await self._update_options() + + # is this the 11kW or the 22kW Version? + if int(self.options.get(CONF_MODEL)) == 11: + return self.async_show_form( + step_id=step_type, + data_schema=vol.Schema({ + vol.Required(CONF_SCAN_INTERVAL, default=self.options.get(CONF_SCAN_INTERVAL, interval)): int + }) + ) + else: + return self.async_show_form( + step_id=step_type, + data_schema=vol.Schema({ + vol.Required(CONF_11KWLIMIT, default=self.options.get(CONF_11KWLIMIT, False)): bool, + vol.Required(CONF_SCAN_INTERVAL, default=self.options.get(CONF_SCAN_INTERVAL, interval)): int + }) + ) + + async def async_step_user_wan(self, user_input=None): """Handle a flow initialized by the user.""" + interval = 30 + step_type = "user_wan" if user_input is not None: - user_input[CONF_SCAN_INTERVAL] = max(5, user_input[CONF_SCAN_INTERVAL]) + user_input[CONF_SCAN_INTERVAL] = max(interval, user_input[CONF_SCAN_INTERVAL]) self.options.update(user_input) return await self._update_options() # is this the 11kW or the 22kW Version? if int(self.options.get(CONF_MODEL)) == 11: return self.async_show_form( - step_id="user", + step_id=step_type, data_schema=vol.Schema({ - vol.Required(CONF_SCAN_INTERVAL, default=self.options.get(CONF_SCAN_INTERVAL, 5)): int + vol.Required(CONF_SCAN_INTERVAL, default=self.options.get(CONF_SCAN_INTERVAL, interval)): int }) ) else: return self.async_show_form( - step_id="user", + step_id=step_type, data_schema=vol.Schema({ vol.Required(CONF_11KWLIMIT, default=self.options.get(CONF_11KWLIMIT, False)): bool, - vol.Required(CONF_SCAN_INTERVAL, default=self.options.get(CONF_SCAN_INTERVAL, 5)): int + vol.Required(CONF_SCAN_INTERVAL, default=self.options.get(CONF_SCAN_INTERVAL, interval)): int }) ) diff --git a/custom_components/goecharger_api2/const.py b/custom_components/goecharger_api2/const.py index aa7ffb9..2c55323 100644 --- a/custom_components/goecharger_api2/const.py +++ b/custom_components/goecharger_api2/const.py @@ -32,6 +32,8 @@ SERVICE_SET_PV_DATA: Final = "set_pv_data" SERVICE_STOP_CHARGING: Final = "stop_charging" CONF_11KWLIMIT: Final = "limit_to_11kw" +WAN: Final = "wan" +LAN: Final = "lan" @dataclass class ExtBinarySensorEntityDescription(BinarySensorEntityDescription): @@ -1646,6 +1648,7 @@ class ExtSwitchEntityDescription(SwitchEntityDescription): native_unit_of_measurement=UnitOfPower.WATT, state_class=SensorStateClass.MEASUREMENT, device_class=SensorDeviceClass.POWER, + suggested_display_precision=2, entity_registry_enabled_default=True ), # wh diff --git a/custom_components/goecharger_api2/manifest.json b/custom_components/goecharger_api2/manifest.json index 93e5ecd..5274166 100644 --- a/custom_components/goecharger_api2/manifest.json +++ b/custom_components/goecharger_api2/manifest.json @@ -10,5 +10,5 @@ "iot_class": "local_polling", "issue_tracker": "https://github.com/marq24/ha-goecharger-api2/issues", "requirements": [], - "version": "2024.6.3" + "version": "2024.6.4" } diff --git a/custom_components/goecharger_api2/pygoecharger_ha/__init__.py b/custom_components/goecharger_api2/pygoecharger_ha/__init__.py index 1c28f4f..16916d8 100644 --- a/custom_components/goecharger_api2/pygoecharger_ha/__init__.py +++ b/custom_components/goecharger_api2/pygoecharger_ha/__init__.py @@ -22,8 +22,15 @@ class GoeChargerApiV2Bridge: - def __init__(self, host: str, web_session, lang: str = "en") -> None: - self.host = host + def __init__(self, host: str, serial:str, token:str, web_session, lang: str = "en") -> None: + if host is not None: + self.host_url = f"http://{host}" + self.token = None + elif serial is not None and token is not None: + # the Cloud-API 2 endpoint! + self.host_url = f"https://{serial}.api.v3.go-e.io" + self.token = f"Bearer {token}" + self.web_session = web_session self.lang_map = None if lang in TRANSLATIONS: @@ -106,8 +113,12 @@ async def read_all_config(self): async def _read_filtered_data(self, filters: str, log_info: str) -> dict: args = {"filter": filters} req_field_count = len(args['filter'].split(',')) - _LOGGER.debug(f"going to request {req_field_count} keys from go-eCharger@{self.host}") - async with self.web_session.get(f"http://{self.host}/api/status", params=args) as res: + _LOGGER.debug(f"going to request {req_field_count} keys from go-eCharger@{self.host_url}") + if self.token: + headers = {"Authorization": self.token} + else: + headers = None + async with self.web_session.get(f"{self.host_url}/api/status", headers=headers, params=args) as res: try: res.raise_for_status() if res.status == 200: @@ -116,7 +127,7 @@ async def _read_filtered_data(self, filters: str, log_info: str) -> dict: if r_json is not None and len(r_json) > 0: resp_field_count = len(r_json) if resp_field_count >= req_field_count: - _LOGGER.debug(f"read {resp_field_count} values from go-eCharger@{self.host}") + _LOGGER.debug(f"read {resp_field_count} values from go-eCharger@{self.host_url}") else: missing_fields_in_reponse = [] requested_fields = args['filter'].split(',') @@ -125,7 +136,7 @@ async def _read_filtered_data(self, filters: str, log_info: str) -> dict: missing_fields_in_reponse.append(a_req_key) _LOGGER.info( - f"[missing fields: {len(missing_fields_in_reponse)} -> {missing_fields_in_reponse}] - not all requested fields where present in the response from from go-eCharger@{self.host}") + f"[missing fields: {len(missing_fields_in_reponse)} -> {missing_fields_in_reponse}] - not all requested fields where present in the response from from go-eCharger@{self.host_url}") return r_json except JSONDecodeError as json_exc: @@ -143,8 +154,12 @@ async def _read_filtered_data(self, filters: str, log_info: str) -> dict: return {} async def _read_all_data(self) -> dict: - _LOGGER.info(f"going to request ALL keys from go-eCharger@{self.host}") - async with self.web_session.get(f"http://{self.host}/api/status") as res: + _LOGGER.info(f"going to request ALL keys from go-eCharger@{self.host_url}") + if self.token: + headers = {"Authorization": self.token} + else: + headers = None + async with self.web_session.get(f"{self.host_url}/api/status", headers=headers) as res: try: res.raise_for_status() if res.status == 200: @@ -184,8 +199,12 @@ async def write_value_to_key(self, key, value) -> dict: else: args = {key: '"'+str(value)+'"'} - _LOGGER.info(f"going to write {args} to go-eCharger@{self.host}") - async with self.web_session.get(f"http://{self.host}/api/set", params=args) as res: + _LOGGER.info(f"going to write {args} to go-eCharger@{self.host_url}") + if self.token: + headers = {"Authorization": self.token} + else: + headers = None + async with self.web_session.get(f"{self.host_url}/api/set", headers=headers, params=args) as res: try: if res.status == 200: try: diff --git a/custom_components/goecharger_api2/translations/de.json b/custom_components/goecharger_api2/translations/de.json index c59b75e..7dc269a 100644 --- a/custom_components/goecharger_api2/translations/de.json +++ b/custom_components/goecharger_api2/translations/de.json @@ -1,33 +1,55 @@ { "selector": { - "dummy": { + "stype": { "options": { - "d1": "Montags", - "d2": "Dienstags" + "lan": "LAN: Lokale API v2 Zugriff übe das lokale Netzwerk [http]", + "wan": "WAN: Cloud API v2 Zugriff über das Internet [https]" } } }, "config": { "step": { "user": { - "description": "Wenn Du Hilfe bei der Einrichtung benötigst, findest du sie hier: https://github.com/marq24/ha-goecharger-api2.\n\nWichtiger Hinweis: Der APIv2 Zugriff muss zuvor in den Go-eCharger App Einstellungen aktiviert werden", + "description": "Bitte wähle den Kommunikationskanal [wähle WAN(Cloud) nur dann, wenn sich Deine Wallbox nicht im Heimnetzwerk befindet!]", + "data": { + "stype": "Wähle LAN(Lokales Netzwerk) oder WAN(Cloud/Internet)" + } + }, + "user_lan": { + "description": "Wenn Du Hilfe bei der Einrichtung benötigst, findest du sie hier: https://github.com/marq24/ha-goecharger-api2.\n\nWichtiger Hinweis: Der lokale APIv2 Zugriff muss zuvor in den Go-eCharger App Einstellungen aktiviert werden", "data": { "host": "IP oder Hostname deiner go-eCharger Wallbox", "scan_interval": "Aktualisierungsintervall in Sekunden [min: 5sek]" } + }, + "user_wan": { + "description": "Wenn Du Hilfe bei der Einrichtung benötigst, findest du sie hier: https://github.com/marq24/ha-goecharger-api2.\n\nWichtiger Hinweis: Der Cloud APIv2 Zugriff muss zuvor in den Go-eCharger App Einstellungen aktiviert werden", + "data": { + "serial": "Deine go-eCharger Wallbox Seriennummer", + "token": "Dein Cloud API v2 Key", + "scan_interval": "Aktualisierungsintervall in Sekunden [min: 30sek]" + } } }, "error": { - "auth": "Unter dieser IP/Host konnte keine Wallbox erreicht werden" + "auth_lan": "Unter dieser IP/Host konnte keine Wallbox erreicht werden", + "auth_wan": "Mit dieser Seriennummer und dem API-Key konnte keine Wallbox erreicht werden" } }, "options": { "step": { - "user": { - "description": "Wenn Du Hilfe bei der Einrichtung benötigst, findest du sie hier: https://github.com/marq24/ha-goecharger-api2.\n\nWichtiger Hinweis: Der APIv2 Zugriff muss zuvor in den Go-eCharger App Einstellungen aktiviert werden", + "user_lan": { + "description": "Lokal: Wenn Du Hilfe bei der Einrichtung benötigst, findest du sie hier: https://github.com/marq24/ha-goecharger-api2.\n\nWichtiger Hinweis: Der APIv2 Zugriff muss zuvor in den Go-eCharger App Einstellungen aktiviert werden", + "data": { + "limit_to_11kw": "11-kW-Limit setzen (nur für 22-kW-Varianten) – alle relevanten Einstellungen werden auf maximal 16A beschränkt (statt der möglichen 32A)", + "scan_interval": "Aktualisierungsintervall in Sekunden [min: 5sek]" + } + }, + "user_wan": { + "description": "Cloud: Wenn Du Hilfe bei der Einrichtung benötigst, findest du sie hier: https://github.com/marq24/ha-goecharger-api2.\n\nWichtiger Hinweis: Der APIv2 Zugriff muss zuvor in den Go-eCharger App Einstellungen aktiviert werden", "data": { "limit_to_11kw": "11-kW-Limit setzen (nur für 22-kW-Varianten) – alle relevanten Einstellungen werden auf maximal 16A beschränkt (statt der möglichen 32A)", - "scan_interval": "Aktualisierungsintervall in Sekunden" + "scan_interval": "Aktualisierungsintervall in Sekunden [min: 30sek]" } } } diff --git a/custom_components/goecharger_api2/translations/en.json b/custom_components/goecharger_api2/translations/en.json index a412733..b967c35 100644 --- a/custom_components/goecharger_api2/translations/en.json +++ b/custom_components/goecharger_api2/translations/en.json @@ -1,33 +1,55 @@ { "selector": { - "dummy": { + "stype": { "options": { - "d1": "Mo", - "d2": "Tu" + "lan": "LAN: Local API v2 access via local network [http]", + "wan": "WAN: Cloud API v2 access via internet [https]" } } }, "config": { "step": { "user": { - "description": "If you need help setting it up, you can find it here: https://github.com/marq24/ha-goecharger-api2.\n\nImportant note: APIv2 access must first be activated in the Go-eCharger app settings", + "description": "Please select the communication channel [only select WAN(Cloud) if your wallbox is not in your home network]", + "data": { + "stype": "Select LAN(Local Network) or WAN(Cloud/Internet)" + } + }, + "user_lan": { + "description": "If you need help setting it up, you can find it here: https://github.com/marq24/ha-goecharger-api2.\n\nImportant note: Local APIv2 access must first be activated in the Go-eCharger app settings", "data": { "host": "Host or IP of your go-eCharger Wallbox", "scan_interval": "Polling Interval in seconds [min: 5sec]" } + }, + "user_wan": { + "description": "If you need help setting it up, you can find it here: https://github.com/marq24/ha-goecharger-api2.\n\nImportant note: Cloud APIv2 access must first be activated in the Go-eCharger app settings", + "data": { + "serial": "Your go-eCharger Wallbox Serial number", + "token": "Your go-eCharger Cloud API-Key", + "scan_interval": "Polling Interval in seconds [min: 30sec]" + } } }, "error": { - "auth": "Host/IP is wrong - could not reach system" + "auth_lan": "Host/IP is wrong - could not reach system", + "auth_wan": "Serial/API-Key is wrong - could not reach system" } }, "options": { "step": { - "user": { - "description": "If you need help setting it up, you can find it here: https://github.com/marq24/ha-goecharger-api2.", + "user_lan": { + "description": "Local: If you need help setting it up, you can find it here: https://github.com/marq24/ha-goecharger-api2.", + "data": { + "limit_to_11kw": "Apply 11kW limit (for 22kW variants only) - will restrict all relevant settings to a max of 16A (instead of 32A)", + "scan_interval": "Polling Interval in seconds [min 5sec]" + } + }, + "user_wan": { + "description": "Cloud: If you need help setting it up, you can find it here: https://github.com/marq24/ha-goecharger-api2.", "data": { "limit_to_11kw": "Apply 11kW limit (for 22kW variants only) - will restrict all relevant settings to a max of 16A (instead of 32A)", - "scan_interval": "Polling Interval in seconds" + "scan_interval": "Polling Interval in seconds [min 30sec]" } } }