@@ -107,7 +107,7 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry):
107107 hass .services .async_register (DOMAIN , SERVICE_STOP_CHARGING , service .stop_charging ,
108108 supports_response = SupportsResponse .OPTIONAL )
109109
110- if coordinator .run_check_for_max_of_16a :
110+ if coordinator .limit_to16a :
111111 asyncio .create_task (coordinator .check_for_16a_limit (hass , config_entry .entry_id ))
112112
113113 asyncio .create_task (coordinator .cleanup_device_registry (hass ))
@@ -560,6 +560,9 @@ async def read_versions(self):
560560 else :
561561 sw_version = "UNKNOWN"
562562
563+ model_info = self ._config_entry .data .get (CONF_TYPE , "UNKNOWN" )
564+ self ._is_core_wallbox = "phoenix" in model_info .lower () or "core" in model_info .lower ()
565+
563566 self .available_cards_idx = []
564567 # additional charger stuff...
565568 if self .intg_type == INTG_TYPE .CHARGER .value :
@@ -584,28 +587,34 @@ async def read_versions(self):
584587 _LOGGER .info (f"active cards { self .available_cards_idx } " )
585588
586589 # check for the 16A limiter...
587- self .run_check_for_max_of_16a = self ._config_entry .data .get (CONF_11KWLIMIT , False )
590+ if self ._is_core_wallbox :
591+ # CORE wallboxes currently return as ADI always true, so we check the CLL:cableCurrentLimit
592+ cable_limit = self .bridge ._versions .get (Tag .CLL .key , {}).get ("cableCurrentLimit" , "-1" )
593+ _LOGGER .debug (f"read_versions(): read CLL:cableCurrentLimit: '{ cable_limit } '" )
594+ try :
595+ wb_has_16a_cable_limit = int (cable_limit ) <= 16
596+ except BaseException as ex :
597+ _LOGGER .debug (f"read_versions(): try to handle CLL:cableCurrentLimit caused: { type (ex ).__name__ } { ex } " )
598+ wb_has_16a_cable_limit = True
599+ else :
600+ wb_has_16a_cable_limit = self .bridge ._versions .get (Tag .ADI .key , False )
588601
589- self .limit_to16a = (self .run_check_for_max_of_16a
602+ self .limit_to16a = (self ._config_entry . data . get ( CONF_11KWLIMIT , False )
590603 or self .bridge ._versions .get (Tag .VAR .key , - 1 ) == 11
591- or self . data . get ( Tag . ADI . key , False ) )
604+ or wb_has_16a_cable_limit )
592605
593606 if (self .limit_to16a ):
594607 _LOGGER .info (f"LIMIT to 16A is active" )
595608 else :
596609 # no additional controller stuff... but we need to init some variables
597- self .run_check_for_max_of_16a = False
598610 self .limit_to16a = False
599611
600-
601612 comm_mode = self ._config_entry .data .get (CONF_PASSWORD , None )
602613 if comm_mode is not None and len (comm_mode .strip ()) > 0 :
603614 comm_mode = "WebSocket"
604615 else :
605616 comm_mode = "HTTP v2 API"
606617
607- model_info = self ._config_entry .data .get (CONF_TYPE , "UNKNOWN" )
608- self ._is_core_wallbox = "phoenix" in model_info .lower () or "core" in model_info .lower ()
609618 if self .limit_to16a :
610619 self ._device_info_model_raw = f"{ model_info } [16A limited] { comm_mode } "
611620 else :
0 commit comments