diff --git a/custom_components/sat/esphome/__init__.py b/custom_components/sat/esphome/__init__.py index 2212b25e..a459375c 100644 --- a/custom_components/sat/esphome/__init__.py +++ b/custom_components/sat/esphome/__init__.py @@ -190,11 +190,27 @@ async def async_set_control_max_setpoint(self, value: float) -> None: await self._send_command_value(DATA_MAX_CH_SETPOINT, value) await super().async_set_control_max_setpoint(value) - def _get_entity_id(self, domain: str, key: str): - unique_id = f"{self._mac_address.upper()}-{domain}-{key}" - _LOGGER.debug(f"Attempting to find the unique_id of {unique_id}") - return self._entity_registry.async_get_entity_id(domain, esphome.DOMAIN, unique_id) + mac_upper = self._mac_address.upper() + mac_lower = self._mac_address.lower() + + # Try to find different unique_id generated by ESPHome + candidates = [ + f"{mac_upper}-{domain}-{key}", # Old format + f"{mac_upper}/0/{domain}/{key}", # ESPHome 2026.10 delimiter is forward slash + f"{mac_upper}/0/{domain}/{key.lower()}", + f"{mac_lower}/0/{domain}/{key.lower()}", + f"{mac_upper}/0/{domain}/{key.upper()}", + ] + + for unique_id in candidates: + entity_id = self._entity_registry.async_get_entity_id(domain, esphome.DOMAIN, unique_id) + if entity_id: + _LOGGER.debug(f"Found {entity_id} with unique_id {unique_id}") + return entity_id + + _LOGGER.warning(f"Could not find entity: domain={domain}, key={key}, mac={self._mac_address}") + return None async def _send_command(self, domain: str, service: str, _key: str, payload: dict): """Helper method to send a command to a specified domain and service."""