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