Feature: mehrere Entitaeten pro Taste

Der Entity-Selector jeder Taste erlaubt jetzt Mehrfachauswahl
(selector.entity.multiple: true). Die Aktion wird per repeat.for_each
auf jede ausgewaehlte Entitaet einzeln angewendet, weiterhin mit
domain-bewusster Service-Aufloesung pro Entitaet.
This commit is contained in:
martin 2026-07-28 07:59:27 +00:00
parent c8847ebc23
commit 37d7477ba1

View file

@ -2,16 +2,18 @@ blueprint:
name: Homematic Wandtaster HM-PB-6-WM55 (CCU2) name: Homematic Wandtaster HM-PB-6-WM55 (CCU2)
description: > description: >
Ordnet den 6 Tasten eines Homematic-Wandtasters HM-PB-6-WM55 (angebunden Ordnet den 6 Tasten eines Homematic-Wandtasters HM-PB-6-WM55 (angebunden
über eine CCU2) jeweils eine Zielentität und eine Aktion (Umschalten, über eine CCU2) jeweils eine oder mehrere Zielentitäten und eine Aktion
Einschalten, Ausschalten) zu. Kurzer und langer Tastendruck (PRESS_SHORT / (Umschalten, Einschalten, Ausschalten) zu. Kurzer und langer Tastendruck
PRESS_LONG) lösen dieselbe Aktion aus. (PRESS_SHORT / PRESS_LONG) lösen dieselbe Aktion aus.
Erkennt automatisch die Domain der Zielentität und ruft den passenden Pro Taste können mehrere Entitäten ausgewählt werden - die Aktion wird
nativen Service auf "Einschalten"/"Ausschalten" bedeutet bei einem dann auf jede davon einzeln angewendet. Erkennt automatisch die Domain
Schalter/Licht turn_on/turn_off, bei einem Cover (z. B. Garagentor) jeder Zielentität und ruft den passenden nativen Service auf -
open_cover/close_cover, bei einem Ventil open_valve/close_valve und bei "Einschalten"/"Ausschalten" bedeutet bei einem Schalter/Licht
einem Schloss lock/unlock. "Umschalten" funktioniert für all diese turn_on/turn_off, bei einem Cover (z. B. Garagentor) open_cover/
Domains inklusive Schloss (dort anhand des aktuellen Zustands close_cover, bei einem Ventil open_valve/close_valve und bei einem
Schloss lock/unlock. "Umschalten" funktioniert für all diese Domains
inklusive Schloss (dort anhand des aktuellen Zustands
gesperrt/entsperrt). Auch Mähroboter (Domain lawn_mower, z. B. Worx gesperrt/entsperrt). Auch Mähroboter (Domain lawn_mower, z. B. Worx
Landroid über die Landroid-Cloud-Integration) werden unterstützt, dafür Landroid über die Landroid-Cloud-Integration) werden unterstützt, dafür
gibt es die eigenen Aktionen "Mähen starten", "Pause" und gibt es die eigenen Aktionen "Mähen starten", "Pause" und
@ -36,11 +38,14 @@ blueprint:
text: text:
button_1_entity: button_1_entity:
name: Taste 1 Zielentität name: Taste 1 Zielentität(en)
description: Entität, die bei Taste 1 (channel 1) geschaltet wird. Leer lassen für keine Aktion. description: >
default: "" Eine oder mehrere Entitäten, die bei Taste 1 (channel 1)
angesteuert werden. Leer lassen für keine Aktion.
default: []
selector: selector:
entity: entity:
multiple: true
domain: domain:
- switch - switch
- light - light
@ -55,7 +60,7 @@ blueprint:
button_1_action: button_1_action:
name: Taste 1 Aktion name: Taste 1 Aktion
description: > description: >
Umschalten/Ein/Aus passen sich automatisch der Domain der Umschalten/Ein/Aus passen sich automatisch der Domain jeder
Zielentität an: Schalter/Licht/Lüfter/Sirene = ein/aus, Cover Zielentität an: Schalter/Licht/Lüfter/Sirene = ein/aus, Cover
(z. B. Garagentor) = öffnen/schließen, Ventil = öffnen/schließen, (z. B. Garagentor) = öffnen/schließen, Ventil = öffnen/schließen,
Schloss = (ent)sperren. Praktisch für Wippen-Tastenpaare, z. B. eine Schloss = (ent)sperren. Praktisch für Wippen-Tastenpaare, z. B. eine
@ -81,11 +86,14 @@ blueprint:
label: "Mähroboter: Zur Ladestation" label: "Mähroboter: Zur Ladestation"
button_2_entity: button_2_entity:
name: Taste 2 Zielentität name: Taste 2 Zielentität(en)
description: Entität, die bei Taste 2 (channel 2) geschaltet wird. Leer lassen für keine Aktion. description: >
default: "" Eine oder mehrere Entitäten, die bei Taste 2 (channel 2)
angesteuert werden. Leer lassen für keine Aktion.
default: []
selector: selector:
entity: entity:
multiple: true
domain: domain:
- switch - switch
- light - light
@ -100,7 +108,7 @@ blueprint:
button_2_action: button_2_action:
name: Taste 2 Aktion name: Taste 2 Aktion
description: > description: >
Umschalten/Ein/Aus passen sich automatisch der Domain der Umschalten/Ein/Aus passen sich automatisch der Domain jeder
Zielentität an: Schalter/Licht/Lüfter/Sirene = ein/aus, Cover Zielentität an: Schalter/Licht/Lüfter/Sirene = ein/aus, Cover
(z. B. Garagentor) = öffnen/schließen, Ventil = öffnen/schließen, (z. B. Garagentor) = öffnen/schließen, Ventil = öffnen/schließen,
Schloss = (ent)sperren. Praktisch für Wippen-Tastenpaare, z. B. eine Schloss = (ent)sperren. Praktisch für Wippen-Tastenpaare, z. B. eine
@ -126,11 +134,14 @@ blueprint:
label: "Mähroboter: Zur Ladestation" label: "Mähroboter: Zur Ladestation"
button_3_entity: button_3_entity:
name: Taste 3 Zielentität name: Taste 3 Zielentität(en)
description: Entität, die bei Taste 3 (channel 3) geschaltet wird. Leer lassen für keine Aktion. description: >
default: "" Eine oder mehrere Entitäten, die bei Taste 3 (channel 3)
angesteuert werden. Leer lassen für keine Aktion.
default: []
selector: selector:
entity: entity:
multiple: true
domain: domain:
- switch - switch
- light - light
@ -145,7 +156,7 @@ blueprint:
button_3_action: button_3_action:
name: Taste 3 Aktion name: Taste 3 Aktion
description: > description: >
Umschalten/Ein/Aus passen sich automatisch der Domain der Umschalten/Ein/Aus passen sich automatisch der Domain jeder
Zielentität an: Schalter/Licht/Lüfter/Sirene = ein/aus, Cover Zielentität an: Schalter/Licht/Lüfter/Sirene = ein/aus, Cover
(z. B. Garagentor) = öffnen/schließen, Ventil = öffnen/schließen, (z. B. Garagentor) = öffnen/schließen, Ventil = öffnen/schließen,
Schloss = (ent)sperren. Praktisch für Wippen-Tastenpaare, z. B. eine Schloss = (ent)sperren. Praktisch für Wippen-Tastenpaare, z. B. eine
@ -171,11 +182,14 @@ blueprint:
label: "Mähroboter: Zur Ladestation" label: "Mähroboter: Zur Ladestation"
button_4_entity: button_4_entity:
name: Taste 4 Zielentität name: Taste 4 Zielentität(en)
description: Entität, die bei Taste 4 (channel 4) geschaltet wird. Leer lassen für keine Aktion. description: >
default: "" Eine oder mehrere Entitäten, die bei Taste 4 (channel 4)
angesteuert werden. Leer lassen für keine Aktion.
default: []
selector: selector:
entity: entity:
multiple: true
domain: domain:
- switch - switch
- light - light
@ -190,7 +204,7 @@ blueprint:
button_4_action: button_4_action:
name: Taste 4 Aktion name: Taste 4 Aktion
description: > description: >
Umschalten/Ein/Aus passen sich automatisch der Domain der Umschalten/Ein/Aus passen sich automatisch der Domain jeder
Zielentität an: Schalter/Licht/Lüfter/Sirene = ein/aus, Cover Zielentität an: Schalter/Licht/Lüfter/Sirene = ein/aus, Cover
(z. B. Garagentor) = öffnen/schließen, Ventil = öffnen/schließen, (z. B. Garagentor) = öffnen/schließen, Ventil = öffnen/schließen,
Schloss = (ent)sperren. Praktisch für Wippen-Tastenpaare, z. B. eine Schloss = (ent)sperren. Praktisch für Wippen-Tastenpaare, z. B. eine
@ -216,11 +230,14 @@ blueprint:
label: "Mähroboter: Zur Ladestation" label: "Mähroboter: Zur Ladestation"
button_5_entity: button_5_entity:
name: Taste 5 Zielentität name: Taste 5 Zielentität(en)
description: Entität, die bei Taste 5 (channel 5) geschaltet wird. Leer lassen für keine Aktion. description: >
default: "" Eine oder mehrere Entitäten, die bei Taste 5 (channel 5)
angesteuert werden. Leer lassen für keine Aktion.
default: []
selector: selector:
entity: entity:
multiple: true
domain: domain:
- switch - switch
- light - light
@ -235,7 +252,7 @@ blueprint:
button_5_action: button_5_action:
name: Taste 5 Aktion name: Taste 5 Aktion
description: > description: >
Umschalten/Ein/Aus passen sich automatisch der Domain der Umschalten/Ein/Aus passen sich automatisch der Domain jeder
Zielentität an: Schalter/Licht/Lüfter/Sirene = ein/aus, Cover Zielentität an: Schalter/Licht/Lüfter/Sirene = ein/aus, Cover
(z. B. Garagentor) = öffnen/schließen, Ventil = öffnen/schließen, (z. B. Garagentor) = öffnen/schließen, Ventil = öffnen/schließen,
Schloss = (ent)sperren. Praktisch für Wippen-Tastenpaare, z. B. eine Schloss = (ent)sperren. Praktisch für Wippen-Tastenpaare, z. B. eine
@ -261,11 +278,14 @@ blueprint:
label: "Mähroboter: Zur Ladestation" label: "Mähroboter: Zur Ladestation"
button_6_entity: button_6_entity:
name: Taste 6 Zielentität name: Taste 6 Zielentität(en)
description: Entität, die bei Taste 6 (channel 6) geschaltet wird. Leer lassen für keine Aktion. description: >
default: "" Eine oder mehrere Entitäten, die bei Taste 6 (channel 6)
angesteuert werden. Leer lassen für keine Aktion.
default: []
selector: selector:
entity: entity:
multiple: true
domain: domain:
- switch - switch
- light - light
@ -280,7 +300,7 @@ blueprint:
button_6_action: button_6_action:
name: Taste 6 Aktion name: Taste 6 Aktion
description: > description: >
Umschalten/Ein/Aus passen sich automatisch der Domain der Umschalten/Ein/Aus passen sich automatisch der Domain jeder
Zielentität an: Schalter/Licht/Lüfter/Sirene = ein/aus, Cover Zielentität an: Schalter/Licht/Lüfter/Sirene = ein/aus, Cover
(z. B. Garagentor) = öffnen/schließen, Ventil = öffnen/schließen, (z. B. Garagentor) = öffnen/schließen, Ventil = öffnen/schließen,
Schloss = (ent)sperren. Praktisch für Wippen-Tastenpaare, z. B. eine Schloss = (ent)sperren. Praktisch für Wippen-Tastenpaare, z. B. eine
@ -330,10 +350,13 @@ action:
- choose: - choose:
- conditions: - conditions:
- condition: template - condition: template
value_template: "{{ channel | int == 1 and button_1_entity not in [none, ''] }}" value_template: "{{ channel | int == 1 and button_1_entity | length > 0 }}"
sequence:
- repeat:
for_each: "{{ button_1_entity }}"
sequence: sequence:
- action: |- - action: |-
{%- set domain = button_1_entity.split('.')[0] -%} {%- set domain = repeat.item.split('.')[0] -%}
{%- if button_1_action == 'turn_on' and domain == 'cover' -%} {%- if button_1_action == 'turn_on' and domain == 'cover' -%}
cover.open_cover cover.open_cover
{%- elif button_1_action == 'turn_off' and domain == 'cover' -%} {%- elif button_1_action == 'turn_off' and domain == 'cover' -%}
@ -347,21 +370,24 @@ action:
{%- elif button_1_action == 'turn_off' and domain == 'lock' -%} {%- elif button_1_action == 'turn_off' and domain == 'lock' -%}
lock.unlock lock.unlock
{%- elif button_1_action == 'toggle' and domain == 'lock' -%} {%- elif button_1_action == 'toggle' and domain == 'lock' -%}
lock.{{ 'unlock' if is_state(button_1_entity, 'locked') else 'lock' }} lock.{{ 'unlock' if is_state(repeat.item, 'locked') else 'lock' }}
{%- elif button_1_action in ['start_mowing', 'pause', 'dock'] -%} {%- elif button_1_action in ['start_mowing', 'pause', 'dock'] -%}
lawn_mower.{{ button_1_action }} lawn_mower.{{ button_1_action }}
{%- else -%} {%- else -%}
homeassistant.{{ button_1_action }} homeassistant.{{ button_1_action }}
{%- endif -%} {%- endif -%}
target: target:
entity_id: "{{ button_1_entity }}" entity_id: "{{ repeat.item }}"
- conditions: - conditions:
- condition: template - condition: template
value_template: "{{ channel | int == 2 and button_2_entity not in [none, ''] }}" value_template: "{{ channel | int == 2 and button_2_entity | length > 0 }}"
sequence:
- repeat:
for_each: "{{ button_2_entity }}"
sequence: sequence:
- action: |- - action: |-
{%- set domain = button_2_entity.split('.')[0] -%} {%- set domain = repeat.item.split('.')[0] -%}
{%- if button_2_action == 'turn_on' and domain == 'cover' -%} {%- if button_2_action == 'turn_on' and domain == 'cover' -%}
cover.open_cover cover.open_cover
{%- elif button_2_action == 'turn_off' and domain == 'cover' -%} {%- elif button_2_action == 'turn_off' and domain == 'cover' -%}
@ -375,21 +401,24 @@ action:
{%- elif button_2_action == 'turn_off' and domain == 'lock' -%} {%- elif button_2_action == 'turn_off' and domain == 'lock' -%}
lock.unlock lock.unlock
{%- elif button_2_action == 'toggle' and domain == 'lock' -%} {%- elif button_2_action == 'toggle' and domain == 'lock' -%}
lock.{{ 'unlock' if is_state(button_2_entity, 'locked') else 'lock' }} lock.{{ 'unlock' if is_state(repeat.item, 'locked') else 'lock' }}
{%- elif button_2_action in ['start_mowing', 'pause', 'dock'] -%} {%- elif button_2_action in ['start_mowing', 'pause', 'dock'] -%}
lawn_mower.{{ button_2_action }} lawn_mower.{{ button_2_action }}
{%- else -%} {%- else -%}
homeassistant.{{ button_2_action }} homeassistant.{{ button_2_action }}
{%- endif -%} {%- endif -%}
target: target:
entity_id: "{{ button_2_entity }}" entity_id: "{{ repeat.item }}"
- conditions: - conditions:
- condition: template - condition: template
value_template: "{{ channel | int == 3 and button_3_entity not in [none, ''] }}" value_template: "{{ channel | int == 3 and button_3_entity | length > 0 }}"
sequence:
- repeat:
for_each: "{{ button_3_entity }}"
sequence: sequence:
- action: |- - action: |-
{%- set domain = button_3_entity.split('.')[0] -%} {%- set domain = repeat.item.split('.')[0] -%}
{%- if button_3_action == 'turn_on' and domain == 'cover' -%} {%- if button_3_action == 'turn_on' and domain == 'cover' -%}
cover.open_cover cover.open_cover
{%- elif button_3_action == 'turn_off' and domain == 'cover' -%} {%- elif button_3_action == 'turn_off' and domain == 'cover' -%}
@ -403,21 +432,24 @@ action:
{%- elif button_3_action == 'turn_off' and domain == 'lock' -%} {%- elif button_3_action == 'turn_off' and domain == 'lock' -%}
lock.unlock lock.unlock
{%- elif button_3_action == 'toggle' and domain == 'lock' -%} {%- elif button_3_action == 'toggle' and domain == 'lock' -%}
lock.{{ 'unlock' if is_state(button_3_entity, 'locked') else 'lock' }} lock.{{ 'unlock' if is_state(repeat.item, 'locked') else 'lock' }}
{%- elif button_3_action in ['start_mowing', 'pause', 'dock'] -%} {%- elif button_3_action in ['start_mowing', 'pause', 'dock'] -%}
lawn_mower.{{ button_3_action }} lawn_mower.{{ button_3_action }}
{%- else -%} {%- else -%}
homeassistant.{{ button_3_action }} homeassistant.{{ button_3_action }}
{%- endif -%} {%- endif -%}
target: target:
entity_id: "{{ button_3_entity }}" entity_id: "{{ repeat.item }}"
- conditions: - conditions:
- condition: template - condition: template
value_template: "{{ channel | int == 4 and button_4_entity not in [none, ''] }}" value_template: "{{ channel | int == 4 and button_4_entity | length > 0 }}"
sequence:
- repeat:
for_each: "{{ button_4_entity }}"
sequence: sequence:
- action: |- - action: |-
{%- set domain = button_4_entity.split('.')[0] -%} {%- set domain = repeat.item.split('.')[0] -%}
{%- if button_4_action == 'turn_on' and domain == 'cover' -%} {%- if button_4_action == 'turn_on' and domain == 'cover' -%}
cover.open_cover cover.open_cover
{%- elif button_4_action == 'turn_off' and domain == 'cover' -%} {%- elif button_4_action == 'turn_off' and domain == 'cover' -%}
@ -431,21 +463,24 @@ action:
{%- elif button_4_action == 'turn_off' and domain == 'lock' -%} {%- elif button_4_action == 'turn_off' and domain == 'lock' -%}
lock.unlock lock.unlock
{%- elif button_4_action == 'toggle' and domain == 'lock' -%} {%- elif button_4_action == 'toggle' and domain == 'lock' -%}
lock.{{ 'unlock' if is_state(button_4_entity, 'locked') else 'lock' }} lock.{{ 'unlock' if is_state(repeat.item, 'locked') else 'lock' }}
{%- elif button_4_action in ['start_mowing', 'pause', 'dock'] -%} {%- elif button_4_action in ['start_mowing', 'pause', 'dock'] -%}
lawn_mower.{{ button_4_action }} lawn_mower.{{ button_4_action }}
{%- else -%} {%- else -%}
homeassistant.{{ button_4_action }} homeassistant.{{ button_4_action }}
{%- endif -%} {%- endif -%}
target: target:
entity_id: "{{ button_4_entity }}" entity_id: "{{ repeat.item }}"
- conditions: - conditions:
- condition: template - condition: template
value_template: "{{ channel | int == 5 and button_5_entity not in [none, ''] }}" value_template: "{{ channel | int == 5 and button_5_entity | length > 0 }}"
sequence:
- repeat:
for_each: "{{ button_5_entity }}"
sequence: sequence:
- action: |- - action: |-
{%- set domain = button_5_entity.split('.')[0] -%} {%- set domain = repeat.item.split('.')[0] -%}
{%- if button_5_action == 'turn_on' and domain == 'cover' -%} {%- if button_5_action == 'turn_on' and domain == 'cover' -%}
cover.open_cover cover.open_cover
{%- elif button_5_action == 'turn_off' and domain == 'cover' -%} {%- elif button_5_action == 'turn_off' and domain == 'cover' -%}
@ -459,21 +494,24 @@ action:
{%- elif button_5_action == 'turn_off' and domain == 'lock' -%} {%- elif button_5_action == 'turn_off' and domain == 'lock' -%}
lock.unlock lock.unlock
{%- elif button_5_action == 'toggle' and domain == 'lock' -%} {%- elif button_5_action == 'toggle' and domain == 'lock' -%}
lock.{{ 'unlock' if is_state(button_5_entity, 'locked') else 'lock' }} lock.{{ 'unlock' if is_state(repeat.item, 'locked') else 'lock' }}
{%- elif button_5_action in ['start_mowing', 'pause', 'dock'] -%} {%- elif button_5_action in ['start_mowing', 'pause', 'dock'] -%}
lawn_mower.{{ button_5_action }} lawn_mower.{{ button_5_action }}
{%- else -%} {%- else -%}
homeassistant.{{ button_5_action }} homeassistant.{{ button_5_action }}
{%- endif -%} {%- endif -%}
target: target:
entity_id: "{{ button_5_entity }}" entity_id: "{{ repeat.item }}"
- conditions: - conditions:
- condition: template - condition: template
value_template: "{{ channel | int == 6 and button_6_entity not in [none, ''] }}" value_template: "{{ channel | int == 6 and button_6_entity | length > 0 }}"
sequence:
- repeat:
for_each: "{{ button_6_entity }}"
sequence: sequence:
- action: |- - action: |-
{%- set domain = button_6_entity.split('.')[0] -%} {%- set domain = repeat.item.split('.')[0] -%}
{%- if button_6_action == 'turn_on' and domain == 'cover' -%} {%- if button_6_action == 'turn_on' and domain == 'cover' -%}
cover.open_cover cover.open_cover
{%- elif button_6_action == 'turn_off' and domain == 'cover' -%} {%- elif button_6_action == 'turn_off' and domain == 'cover' -%}
@ -487,14 +525,14 @@ action:
{%- elif button_6_action == 'turn_off' and domain == 'lock' -%} {%- elif button_6_action == 'turn_off' and domain == 'lock' -%}
lock.unlock lock.unlock
{%- elif button_6_action == 'toggle' and domain == 'lock' -%} {%- elif button_6_action == 'toggle' and domain == 'lock' -%}
lock.{{ 'unlock' if is_state(button_6_entity, 'locked') else 'lock' }} lock.{{ 'unlock' if is_state(repeat.item, 'locked') else 'lock' }}
{%- elif button_6_action in ['start_mowing', 'pause', 'dock'] -%} {%- elif button_6_action in ['start_mowing', 'pause', 'dock'] -%}
lawn_mower.{{ button_6_action }} lawn_mower.{{ button_6_action }}
{%- else -%} {%- else -%}
homeassistant.{{ button_6_action }} homeassistant.{{ button_6_action }}
{%- endif -%} {%- endif -%}
target: target:
entity_id: "{{ button_6_entity }}" entity_id: "{{ repeat.item }}"
mode: single mode: single
max_exceeded: silent max_exceeded: silent