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:
parent
c8847ebc23
commit
37d7477ba1
1 changed files with 215 additions and 177 deletions
|
|
@ -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,171 +350,189 @@ 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:
|
sequence:
|
||||||
- action: |-
|
- repeat:
|
||||||
{%- set domain = button_1_entity.split('.')[0] -%}
|
for_each: "{{ button_1_entity }}"
|
||||||
{%- if button_1_action == 'turn_on' and domain == 'cover' -%}
|
sequence:
|
||||||
cover.open_cover
|
- action: |-
|
||||||
{%- elif button_1_action == 'turn_off' and domain == 'cover' -%}
|
{%- set domain = repeat.item.split('.')[0] -%}
|
||||||
cover.close_cover
|
{%- if button_1_action == 'turn_on' and domain == 'cover' -%}
|
||||||
{%- elif button_1_action == 'turn_on' and domain == 'valve' -%}
|
cover.open_cover
|
||||||
valve.open_valve
|
{%- elif button_1_action == 'turn_off' and domain == 'cover' -%}
|
||||||
{%- elif button_1_action == 'turn_off' and domain == 'valve' -%}
|
cover.close_cover
|
||||||
valve.close_valve
|
{%- elif button_1_action == 'turn_on' and domain == 'valve' -%}
|
||||||
{%- elif button_1_action == 'turn_on' and domain == 'lock' -%}
|
valve.open_valve
|
||||||
lock.lock
|
{%- elif button_1_action == 'turn_off' and domain == 'valve' -%}
|
||||||
{%- elif button_1_action == 'turn_off' and domain == 'lock' -%}
|
valve.close_valve
|
||||||
lock.unlock
|
{%- elif button_1_action == 'turn_on' and domain == 'lock' -%}
|
||||||
{%- elif button_1_action == 'toggle' and domain == 'lock' -%}
|
lock.lock
|
||||||
lock.{{ 'unlock' if is_state(button_1_entity, 'locked') else 'lock' }}
|
{%- elif button_1_action == 'turn_off' and domain == 'lock' -%}
|
||||||
{%- elif button_1_action in ['start_mowing', 'pause', 'dock'] -%}
|
lock.unlock
|
||||||
lawn_mower.{{ button_1_action }}
|
{%- elif button_1_action == 'toggle' and domain == 'lock' -%}
|
||||||
{%- else -%}
|
lock.{{ 'unlock' if is_state(repeat.item, 'locked') else 'lock' }}
|
||||||
homeassistant.{{ button_1_action }}
|
{%- elif button_1_action in ['start_mowing', 'pause', 'dock'] -%}
|
||||||
{%- endif -%}
|
lawn_mower.{{ button_1_action }}
|
||||||
target:
|
{%- else -%}
|
||||||
entity_id: "{{ button_1_entity }}"
|
homeassistant.{{ button_1_action }}
|
||||||
|
{%- endif -%}
|
||||||
|
target:
|
||||||
|
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:
|
sequence:
|
||||||
- action: |-
|
- repeat:
|
||||||
{%- set domain = button_2_entity.split('.')[0] -%}
|
for_each: "{{ button_2_entity }}"
|
||||||
{%- if button_2_action == 'turn_on' and domain == 'cover' -%}
|
sequence:
|
||||||
cover.open_cover
|
- action: |-
|
||||||
{%- elif button_2_action == 'turn_off' and domain == 'cover' -%}
|
{%- set domain = repeat.item.split('.')[0] -%}
|
||||||
cover.close_cover
|
{%- if button_2_action == 'turn_on' and domain == 'cover' -%}
|
||||||
{%- elif button_2_action == 'turn_on' and domain == 'valve' -%}
|
cover.open_cover
|
||||||
valve.open_valve
|
{%- elif button_2_action == 'turn_off' and domain == 'cover' -%}
|
||||||
{%- elif button_2_action == 'turn_off' and domain == 'valve' -%}
|
cover.close_cover
|
||||||
valve.close_valve
|
{%- elif button_2_action == 'turn_on' and domain == 'valve' -%}
|
||||||
{%- elif button_2_action == 'turn_on' and domain == 'lock' -%}
|
valve.open_valve
|
||||||
lock.lock
|
{%- elif button_2_action == 'turn_off' and domain == 'valve' -%}
|
||||||
{%- elif button_2_action == 'turn_off' and domain == 'lock' -%}
|
valve.close_valve
|
||||||
lock.unlock
|
{%- elif button_2_action == 'turn_on' and domain == 'lock' -%}
|
||||||
{%- elif button_2_action == 'toggle' and domain == 'lock' -%}
|
lock.lock
|
||||||
lock.{{ 'unlock' if is_state(button_2_entity, 'locked') else 'lock' }}
|
{%- elif button_2_action == 'turn_off' and domain == 'lock' -%}
|
||||||
{%- elif button_2_action in ['start_mowing', 'pause', 'dock'] -%}
|
lock.unlock
|
||||||
lawn_mower.{{ button_2_action }}
|
{%- elif button_2_action == 'toggle' and domain == 'lock' -%}
|
||||||
{%- else -%}
|
lock.{{ 'unlock' if is_state(repeat.item, 'locked') else 'lock' }}
|
||||||
homeassistant.{{ button_2_action }}
|
{%- elif button_2_action in ['start_mowing', 'pause', 'dock'] -%}
|
||||||
{%- endif -%}
|
lawn_mower.{{ button_2_action }}
|
||||||
target:
|
{%- else -%}
|
||||||
entity_id: "{{ button_2_entity }}"
|
homeassistant.{{ button_2_action }}
|
||||||
|
{%- endif -%}
|
||||||
|
target:
|
||||||
|
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:
|
sequence:
|
||||||
- action: |-
|
- repeat:
|
||||||
{%- set domain = button_3_entity.split('.')[0] -%}
|
for_each: "{{ button_3_entity }}"
|
||||||
{%- if button_3_action == 'turn_on' and domain == 'cover' -%}
|
sequence:
|
||||||
cover.open_cover
|
- action: |-
|
||||||
{%- elif button_3_action == 'turn_off' and domain == 'cover' -%}
|
{%- set domain = repeat.item.split('.')[0] -%}
|
||||||
cover.close_cover
|
{%- if button_3_action == 'turn_on' and domain == 'cover' -%}
|
||||||
{%- elif button_3_action == 'turn_on' and domain == 'valve' -%}
|
cover.open_cover
|
||||||
valve.open_valve
|
{%- elif button_3_action == 'turn_off' and domain == 'cover' -%}
|
||||||
{%- elif button_3_action == 'turn_off' and domain == 'valve' -%}
|
cover.close_cover
|
||||||
valve.close_valve
|
{%- elif button_3_action == 'turn_on' and domain == 'valve' -%}
|
||||||
{%- elif button_3_action == 'turn_on' and domain == 'lock' -%}
|
valve.open_valve
|
||||||
lock.lock
|
{%- elif button_3_action == 'turn_off' and domain == 'valve' -%}
|
||||||
{%- elif button_3_action == 'turn_off' and domain == 'lock' -%}
|
valve.close_valve
|
||||||
lock.unlock
|
{%- elif button_3_action == 'turn_on' and domain == 'lock' -%}
|
||||||
{%- elif button_3_action == 'toggle' and domain == 'lock' -%}
|
lock.lock
|
||||||
lock.{{ 'unlock' if is_state(button_3_entity, 'locked') else 'lock' }}
|
{%- elif button_3_action == 'turn_off' and domain == 'lock' -%}
|
||||||
{%- elif button_3_action in ['start_mowing', 'pause', 'dock'] -%}
|
lock.unlock
|
||||||
lawn_mower.{{ button_3_action }}
|
{%- elif button_3_action == 'toggle' and domain == 'lock' -%}
|
||||||
{%- else -%}
|
lock.{{ 'unlock' if is_state(repeat.item, 'locked') else 'lock' }}
|
||||||
homeassistant.{{ button_3_action }}
|
{%- elif button_3_action in ['start_mowing', 'pause', 'dock'] -%}
|
||||||
{%- endif -%}
|
lawn_mower.{{ button_3_action }}
|
||||||
target:
|
{%- else -%}
|
||||||
entity_id: "{{ button_3_entity }}"
|
homeassistant.{{ button_3_action }}
|
||||||
|
{%- endif -%}
|
||||||
|
target:
|
||||||
|
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:
|
sequence:
|
||||||
- action: |-
|
- repeat:
|
||||||
{%- set domain = button_4_entity.split('.')[0] -%}
|
for_each: "{{ button_4_entity }}"
|
||||||
{%- if button_4_action == 'turn_on' and domain == 'cover' -%}
|
sequence:
|
||||||
cover.open_cover
|
- action: |-
|
||||||
{%- elif button_4_action == 'turn_off' and domain == 'cover' -%}
|
{%- set domain = repeat.item.split('.')[0] -%}
|
||||||
cover.close_cover
|
{%- if button_4_action == 'turn_on' and domain == 'cover' -%}
|
||||||
{%- elif button_4_action == 'turn_on' and domain == 'valve' -%}
|
cover.open_cover
|
||||||
valve.open_valve
|
{%- elif button_4_action == 'turn_off' and domain == 'cover' -%}
|
||||||
{%- elif button_4_action == 'turn_off' and domain == 'valve' -%}
|
cover.close_cover
|
||||||
valve.close_valve
|
{%- elif button_4_action == 'turn_on' and domain == 'valve' -%}
|
||||||
{%- elif button_4_action == 'turn_on' and domain == 'lock' -%}
|
valve.open_valve
|
||||||
lock.lock
|
{%- elif button_4_action == 'turn_off' and domain == 'valve' -%}
|
||||||
{%- elif button_4_action == 'turn_off' and domain == 'lock' -%}
|
valve.close_valve
|
||||||
lock.unlock
|
{%- elif button_4_action == 'turn_on' and domain == 'lock' -%}
|
||||||
{%- elif button_4_action == 'toggle' and domain == 'lock' -%}
|
lock.lock
|
||||||
lock.{{ 'unlock' if is_state(button_4_entity, 'locked') else 'lock' }}
|
{%- elif button_4_action == 'turn_off' and domain == 'lock' -%}
|
||||||
{%- elif button_4_action in ['start_mowing', 'pause', 'dock'] -%}
|
lock.unlock
|
||||||
lawn_mower.{{ button_4_action }}
|
{%- elif button_4_action == 'toggle' and domain == 'lock' -%}
|
||||||
{%- else -%}
|
lock.{{ 'unlock' if is_state(repeat.item, 'locked') else 'lock' }}
|
||||||
homeassistant.{{ button_4_action }}
|
{%- elif button_4_action in ['start_mowing', 'pause', 'dock'] -%}
|
||||||
{%- endif -%}
|
lawn_mower.{{ button_4_action }}
|
||||||
target:
|
{%- else -%}
|
||||||
entity_id: "{{ button_4_entity }}"
|
homeassistant.{{ button_4_action }}
|
||||||
|
{%- endif -%}
|
||||||
|
target:
|
||||||
|
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:
|
sequence:
|
||||||
- action: |-
|
- repeat:
|
||||||
{%- set domain = button_5_entity.split('.')[0] -%}
|
for_each: "{{ button_5_entity }}"
|
||||||
{%- if button_5_action == 'turn_on' and domain == 'cover' -%}
|
sequence:
|
||||||
cover.open_cover
|
- action: |-
|
||||||
{%- elif button_5_action == 'turn_off' and domain == 'cover' -%}
|
{%- set domain = repeat.item.split('.')[0] -%}
|
||||||
cover.close_cover
|
{%- if button_5_action == 'turn_on' and domain == 'cover' -%}
|
||||||
{%- elif button_5_action == 'turn_on' and domain == 'valve' -%}
|
cover.open_cover
|
||||||
valve.open_valve
|
{%- elif button_5_action == 'turn_off' and domain == 'cover' -%}
|
||||||
{%- elif button_5_action == 'turn_off' and domain == 'valve' -%}
|
cover.close_cover
|
||||||
valve.close_valve
|
{%- elif button_5_action == 'turn_on' and domain == 'valve' -%}
|
||||||
{%- elif button_5_action == 'turn_on' and domain == 'lock' -%}
|
valve.open_valve
|
||||||
lock.lock
|
{%- elif button_5_action == 'turn_off' and domain == 'valve' -%}
|
||||||
{%- elif button_5_action == 'turn_off' and domain == 'lock' -%}
|
valve.close_valve
|
||||||
lock.unlock
|
{%- elif button_5_action == 'turn_on' and domain == 'lock' -%}
|
||||||
{%- elif button_5_action == 'toggle' and domain == 'lock' -%}
|
lock.lock
|
||||||
lock.{{ 'unlock' if is_state(button_5_entity, 'locked') else 'lock' }}
|
{%- elif button_5_action == 'turn_off' and domain == 'lock' -%}
|
||||||
{%- elif button_5_action in ['start_mowing', 'pause', 'dock'] -%}
|
lock.unlock
|
||||||
lawn_mower.{{ button_5_action }}
|
{%- elif button_5_action == 'toggle' and domain == 'lock' -%}
|
||||||
{%- else -%}
|
lock.{{ 'unlock' if is_state(repeat.item, 'locked') else 'lock' }}
|
||||||
homeassistant.{{ button_5_action }}
|
{%- elif button_5_action in ['start_mowing', 'pause', 'dock'] -%}
|
||||||
{%- endif -%}
|
lawn_mower.{{ button_5_action }}
|
||||||
target:
|
{%- else -%}
|
||||||
entity_id: "{{ button_5_entity }}"
|
homeassistant.{{ button_5_action }}
|
||||||
|
{%- endif -%}
|
||||||
|
target:
|
||||||
|
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:
|
sequence:
|
||||||
- action: |-
|
- repeat:
|
||||||
{%- set domain = button_6_entity.split('.')[0] -%}
|
for_each: "{{ button_6_entity }}"
|
||||||
{%- if button_6_action == 'turn_on' and domain == 'cover' -%}
|
sequence:
|
||||||
cover.open_cover
|
- action: |-
|
||||||
{%- elif button_6_action == 'turn_off' and domain == 'cover' -%}
|
{%- set domain = repeat.item.split('.')[0] -%}
|
||||||
cover.close_cover
|
{%- if button_6_action == 'turn_on' and domain == 'cover' -%}
|
||||||
{%- elif button_6_action == 'turn_on' and domain == 'valve' -%}
|
cover.open_cover
|
||||||
valve.open_valve
|
{%- elif button_6_action == 'turn_off' and domain == 'cover' -%}
|
||||||
{%- elif button_6_action == 'turn_off' and domain == 'valve' -%}
|
cover.close_cover
|
||||||
valve.close_valve
|
{%- elif button_6_action == 'turn_on' and domain == 'valve' -%}
|
||||||
{%- elif button_6_action == 'turn_on' and domain == 'lock' -%}
|
valve.open_valve
|
||||||
lock.lock
|
{%- elif button_6_action == 'turn_off' and domain == 'valve' -%}
|
||||||
{%- elif button_6_action == 'turn_off' and domain == 'lock' -%}
|
valve.close_valve
|
||||||
lock.unlock
|
{%- elif button_6_action == 'turn_on' and domain == 'lock' -%}
|
||||||
{%- elif button_6_action == 'toggle' and domain == 'lock' -%}
|
lock.lock
|
||||||
lock.{{ 'unlock' if is_state(button_6_entity, 'locked') else 'lock' }}
|
{%- elif button_6_action == 'turn_off' and domain == 'lock' -%}
|
||||||
{%- elif button_6_action in ['start_mowing', 'pause', 'dock'] -%}
|
lock.unlock
|
||||||
lawn_mower.{{ button_6_action }}
|
{%- elif button_6_action == 'toggle' and domain == 'lock' -%}
|
||||||
{%- else -%}
|
lock.{{ 'unlock' if is_state(repeat.item, 'locked') else 'lock' }}
|
||||||
homeassistant.{{ button_6_action }}
|
{%- elif button_6_action in ['start_mowing', 'pause', 'dock'] -%}
|
||||||
{%- endif -%}
|
lawn_mower.{{ button_6_action }}
|
||||||
target:
|
{%- else -%}
|
||||||
entity_id: "{{ button_6_entity }}"
|
homeassistant.{{ button_6_action }}
|
||||||
|
{%- endif -%}
|
||||||
|
target:
|
||||||
|
entity_id: "{{ repeat.item }}"
|
||||||
|
|
||||||
mode: single
|
mode: single
|
||||||
max_exceeded: silent
|
max_exceeded: silent
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue