From caed35e24ddf3868c3fbfa35dfc1d17686b0b7cd Mon Sep 17 00:00:00 2001 From: Kasper Date: Thu, 20 Aug 2026 17:22:49 +0200 Subject: [PATCH] Update EnOcean PTM 21xZ/ZE - MQTT Trigger --- EnOcean PTM 21xZ%2FZE - MQTT Trigger.-.md | 113 +++++++++++++++++++++- 1 file changed, 112 insertions(+), 1 deletion(-) diff --git a/EnOcean PTM 21xZ%2FZE - MQTT Trigger.-.md b/EnOcean PTM 21xZ%2FZE - MQTT Trigger.-.md index 9282393..b8a71af 100644 --- a/EnOcean PTM 21xZ%2FZE - MQTT Trigger.-.md +++ b/EnOcean PTM 21xZ%2FZE - MQTT Trigger.-.md @@ -329,4 +329,115 @@ Examples include: action: - service: light.turn_on target: - entity_id: light.living_room \ No newline at end of file + entity_id: light.living_room +``` +Or: +```yaml +action: + - service: light.turn_off + target: + entity_id: light.living_room +``` + +You can also use the actions for: + +- Scripts +- Scenes +- Switches +- Covers +- Media players +- Notifications +- Home Assistant services +- Other automations + +## Example: Light Switch + +A typical four-button switch could be configured like this: + +| Button | Press | Hold | Release | +|---|---|---|---| +| Button 1 | Lights ON | Brightness up | Stop | +| Button 2 | Lights OFF | Brightness down | Stop | +| Button 3 | Scene ON | Dim | Stop | +| Button 4 | Scene OFF | Dim | Stop | + +This allows a single EnOcean switch to provide a large number of functions. + +## Example: MQTT Flow + +For a button press, Zigbee2MQTT might publish: + +```text +Topic: +zigbee2mqtt/Livingroom_Switch/action + +Payload: +press_1 +``` +The blueprint receives the MQTT message and identifies: +```text +Controller: +Livingroom_Switch + +Command: +press_1 +``` +The blueprint then waits for the configured hold delay to determine whether the event is a short press or a hold. + +## Event Processing + +The general processing logic is: + +```text + MQTT Event + │ + ▼ + Check controller + │ + ▼ + Check command + │ + ┌─────────┴─────────┐ + │ │ + PRESS RELEASE + │ │ + ▼ ▼ + Wait hold delay Check previous event + │ │ + ┌─────┴─────┐ ▼ + │ │ RELEASE action + Released Timeout + │ │ + ▼ ▼ + PRESSED action HELD action + ``` + +## Requirements + +- Home Assistant 2024.10.0 or newer +- Zigbee2MQTT +- MQTT integration in Home Assistant +- Compatible EnOcean PTM 21xZ/ZE switch +- MQTT action events from the switch + +The blueprint specifies a minimum Home Assistant version of: + +```text +2024.10.0 +``` + +## Installation + +1. Download the Blueprint YAML file. +2. Open Home Assistant. +3. Go to: + +```text +Settings → Automations & Scenes → Blueprints +``` +4. Import the Blueprint. +5. Create a new automation from the Blueprint. +6. Enter the controller name exactly as it appears in Zigbee2MQTT. +7. Verify the MQTT base topic. +8. Configure the desired button actions. +9. If using a PTM216Z, create and select the required Text Helper. \ No newline at end of file