From e3b9b123f23e69b376480ad7db0c899ec5c834e3 Mon Sep 17 00:00:00 2001 From: "alexei.dolgolyov" Date: Mon, 22 Jun 2026 15:54:57 +0300 Subject: [PATCH] fix: derive Dreame Vacuum name from device to avoid doubled friendly_name The Dreame integration names the vacuum entity ' ' (leading space), so HA composes the entity friendly_name as the device name twice (e.g. 'Z10 Pro Z10 Pro'). Derive vacuum_name from the device's name_by_user/name instead, falling back to friendly_name then entity_id. Bump blueprint_version to 1.2.1 and manifest to 2.14.2. --- Common/Dreame Vacuum/blueprint.yaml | 13 +++++++++++-- manifest.json | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Common/Dreame Vacuum/blueprint.yaml b/Common/Dreame Vacuum/blueprint.yaml index a98553e..d6e507f 100644 --- a/Common/Dreame Vacuum/blueprint.yaml +++ b/Common/Dreame Vacuum/blueprint.yaml @@ -293,7 +293,7 @@ trigger: variables: # Bumped whenever event-handling logic changes; surfaced in debug output # so users can confirm which revision is running. - blueprint_version: "1.2.0" + blueprint_version: "1.2.1" # --------------------------------------------------------------------------- # Input References @@ -329,7 +329,16 @@ variables: # --------------------------------------------------------------------------- # Vacuum Info # --------------------------------------------------------------------------- - vacuum_name: "{{ state_attr(vacuum_entity, 'friendly_name') | default(vacuum_entity) }}" + # Prefer the device name (clean, single) over the entity's friendly_name. + # The Dreame integration names the vacuum entity " " (leading + # space) which Home Assistant composes into the friendly_name, so + # friendly_name renders the device name twice (e.g. "Z10 Pro Z10 Pro"). + # Use the device's user-set/original name; fall back to friendly_name, then + # the entity_id. + vacuum_name: > + {%- set did = device_id(vacuum_entity) -%} + {%- set dname = (device_attr(did, 'name_by_user') or device_attr(did, 'name')) if did else none -%} + {{ dname if dname else (state_attr(vacuum_entity, 'friendly_name') | default(vacuum_entity, true)) }} # --------------------------------------------------------------------------- # Event Data (flat structure — fields are directly on trigger.event.data) diff --git a/manifest.json b/manifest.json index 7468b8e..059e225 100644 --- a/manifest.json +++ b/manifest.json @@ -1,3 +1,3 @@ { - "version": "2.14.1" + "version": "2.14.2" }