homeassistant/blueprints/automation/hm_pb_6_wm55_taster.yaml
martin c8847ebc23 Fix: domänenbewusste Service-Auswahl statt generischem homeassistant.turn_on/off
cover.turn_on/turn_off, valve.turn_on/turn_off und lock.turn_on/turn_off/toggle
existieren schlicht nicht - die generischen homeassistant.* Services haben
dafuer nichts ausgeloest. Jetzt wird je nach Entitaets-Domain der native
Service aufgerufen (cover.open_cover/close_cover, valve.open_valve/close_valve,
lock.lock/unlock, inkl. State-basiertem Toggle fuer Schloesser).
2026-07-27 17:11:12 +00:00

500 lines
19 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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.
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
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
"Zur Ladestation" statt Ein/Aus/Umschalten.
Ungenutzte Tasten einfach leer lassen, dann passiert bei ihnen nichts.
Für jedes physische Taster-Gerät wird eine eigene Automatisierungs-Instanz
aus diesem Blueprint angelegt. Der Gerätename lässt sich über
Entwicklerwerkzeuge → Ereignisse (Event-Typ homematic.keypress) ablesen,
z. B.:
event_type: homematic.keypress, data: {name: "Taster Garage", param:
PRESS_SHORT, channel: 1}
domain: automation
input:
device_name:
name: Taster-Gerätename
description: >
Name des Homematic-Geräts, wie er im Event homematic.keypress unter
"name" steht (z. B. "Taster Garage"). Muss exakt übereinstimmen
zu finden über Entwicklerwerkzeuge → Ereignisse.
selector:
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: ""
selector:
entity:
domain:
- switch
- light
- cover
- fan
- input_boolean
- lock
- valve
- siren
- lawn_mower
button_1_action:
name: Taste 1 Aktion
description: >
Umschalten/Ein/Aus passen sich automatisch der Domain der
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
Taste "Einschalten" (öffnet das Tor) und eine zweite "Ausschalten"
(schließt es). Für Mähroboter (lawn_mower) stattdessen "Mähen
starten", "Pause" oder "Zur Ladestation" verwenden.
default: toggle
selector:
select:
mode: dropdown
options:
- value: toggle
label: Umschalten
- value: turn_on
label: Einschalten
- value: turn_off
label: Ausschalten
- value: start_mowing
label: "Mähroboter: Mähen starten"
- value: pause
label: "Mähroboter: Pause"
- value: dock
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: ""
selector:
entity:
domain:
- switch
- light
- cover
- fan
- input_boolean
- lock
- valve
- siren
- lawn_mower
button_2_action:
name: Taste 2 Aktion
description: >
Umschalten/Ein/Aus passen sich automatisch der Domain der
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
Taste "Einschalten" (öffnet das Tor) und eine zweite "Ausschalten"
(schließt es). Für Mähroboter (lawn_mower) stattdessen "Mähen
starten", "Pause" oder "Zur Ladestation" verwenden.
default: toggle
selector:
select:
mode: dropdown
options:
- value: toggle
label: Umschalten
- value: turn_on
label: Einschalten
- value: turn_off
label: Ausschalten
- value: start_mowing
label: "Mähroboter: Mähen starten"
- value: pause
label: "Mähroboter: Pause"
- value: dock
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: ""
selector:
entity:
domain:
- switch
- light
- cover
- fan
- input_boolean
- lock
- valve
- siren
- lawn_mower
button_3_action:
name: Taste 3 Aktion
description: >
Umschalten/Ein/Aus passen sich automatisch der Domain der
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
Taste "Einschalten" (öffnet das Tor) und eine zweite "Ausschalten"
(schließt es). Für Mähroboter (lawn_mower) stattdessen "Mähen
starten", "Pause" oder "Zur Ladestation" verwenden.
default: toggle
selector:
select:
mode: dropdown
options:
- value: toggle
label: Umschalten
- value: turn_on
label: Einschalten
- value: turn_off
label: Ausschalten
- value: start_mowing
label: "Mähroboter: Mähen starten"
- value: pause
label: "Mähroboter: Pause"
- value: dock
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: ""
selector:
entity:
domain:
- switch
- light
- cover
- fan
- input_boolean
- lock
- valve
- siren
- lawn_mower
button_4_action:
name: Taste 4 Aktion
description: >
Umschalten/Ein/Aus passen sich automatisch der Domain der
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
Taste "Einschalten" (öffnet das Tor) und eine zweite "Ausschalten"
(schließt es). Für Mähroboter (lawn_mower) stattdessen "Mähen
starten", "Pause" oder "Zur Ladestation" verwenden.
default: toggle
selector:
select:
mode: dropdown
options:
- value: toggle
label: Umschalten
- value: turn_on
label: Einschalten
- value: turn_off
label: Ausschalten
- value: start_mowing
label: "Mähroboter: Mähen starten"
- value: pause
label: "Mähroboter: Pause"
- value: dock
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: ""
selector:
entity:
domain:
- switch
- light
- cover
- fan
- input_boolean
- lock
- valve
- siren
- lawn_mower
button_5_action:
name: Taste 5 Aktion
description: >
Umschalten/Ein/Aus passen sich automatisch der Domain der
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
Taste "Einschalten" (öffnet das Tor) und eine zweite "Ausschalten"
(schließt es). Für Mähroboter (lawn_mower) stattdessen "Mähen
starten", "Pause" oder "Zur Ladestation" verwenden.
default: toggle
selector:
select:
mode: dropdown
options:
- value: toggle
label: Umschalten
- value: turn_on
label: Einschalten
- value: turn_off
label: Ausschalten
- value: start_mowing
label: "Mähroboter: Mähen starten"
- value: pause
label: "Mähroboter: Pause"
- value: dock
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: ""
selector:
entity:
domain:
- switch
- light
- cover
- fan
- input_boolean
- lock
- valve
- siren
- lawn_mower
button_6_action:
name: Taste 6 Aktion
description: >
Umschalten/Ein/Aus passen sich automatisch der Domain der
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
Taste "Einschalten" (öffnet das Tor) und eine zweite "Ausschalten"
(schließt es). Für Mähroboter (lawn_mower) stattdessen "Mähen
starten", "Pause" oder "Zur Ladestation" verwenden.
default: toggle
selector:
select:
mode: dropdown
options:
- value: toggle
label: Umschalten
- value: turn_on
label: Einschalten
- value: turn_off
label: Ausschalten
- value: start_mowing
label: "Mähroboter: Mähen starten"
- value: pause
label: "Mähroboter: Pause"
- value: dock
label: "Mähroboter: Zur Ladestation"
variables:
channel: "{{ trigger.event.data.channel }}"
button_1_entity: !input button_1_entity
button_1_action: !input button_1_action
button_2_entity: !input button_2_entity
button_2_action: !input button_2_action
button_3_entity: !input button_3_entity
button_3_action: !input button_3_action
button_4_entity: !input button_4_entity
button_4_action: !input button_4_action
button_5_entity: !input button_5_entity
button_5_action: !input button_5_action
button_6_entity: !input button_6_entity
button_6_action: !input button_6_action
trigger:
- platform: event
event_type: homematic.keypress
event_data:
name: !input device_name
action:
- choose:
- conditions:
- condition: template
value_template: "{{ channel | int == 1 and button_1_entity not in [none, ''] }}"
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 }}"
- conditions:
- condition: template
value_template: "{{ channel | int == 2 and button_2_entity not in [none, ''] }}"
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 }}"
- conditions:
- condition: template
value_template: "{{ channel | int == 3 and button_3_entity not in [none, ''] }}"
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 }}"
- conditions:
- condition: template
value_template: "{{ channel | int == 4 and button_4_entity not in [none, ''] }}"
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 }}"
- conditions:
- condition: template
value_template: "{{ channel | int == 5 and button_5_entity not in [none, ''] }}"
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 }}"
- conditions:
- condition: template
value_template: "{{ channel | int == 6 and button_6_entity not in [none, ''] }}"
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 }}"
mode: single
max_exceeded: silent