From bea12c00459fe6550aaf87e16eeef6a2ae561046 Mon Sep 17 00:00:00 2001 From: dmr1987 <73853639+dmr1987@users.noreply.github.com> Date: Sun, 25 Oct 2026 21:19:37 +0300 Subject: [PATCH 1/2] Update __init__.py New ESPHome generate unique_id with "backslash" delimiter. Added various unique_id templates for ESPHome 2026.10+ --- custom_components/sat/esphome/__init__.py | 24 +++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/custom_components/sat/esphome/__init__.py b/custom_components/sat/esphome/__init__.py index 2212b25e..9de87fe7 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 backslash + 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.info(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.""" From e666f456312faae1384fe5da0ed9617c6ad6492d Mon Sep 17 00:00:00 2001 From: dmr1987 <73853639+dmr1987@users.noreply.github.com> Date: Wed, 28 Oct 2026 02:06:46 +0300 Subject: [PATCH 2/2] Update __init__.py Resolving AI request 1. Changed .info to .debug in logging 2. Changed description "backslash" to "forward slash" --- custom_components/sat/esphome/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/sat/esphome/__init__.py b/custom_components/sat/esphome/__init__.py index 9de87fe7..a459375c 100644 --- a/custom_components/sat/esphome/__init__.py +++ b/custom_components/sat/esphome/__init__.py @@ -197,7 +197,7 @@ def _get_entity_id(self, domain: str, key: str): # 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 backslash + 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()}", @@ -206,7 +206,7 @@ def _get_entity_id(self, domain: str, key: str): for unique_id in candidates: entity_id = self._entity_registry.async_get_entity_id(domain, esphome.DOMAIN, unique_id) if entity_id: - _LOGGER.info(f"Found {entity_id} with unique_id {unique_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}")