Update EnOcean PTM 21xZ/ZE - MQTT Trigger
@@ -329,4 +329,115 @@ Examples include:
|
|||||||
action:
|
action:
|
||||||
- service: light.turn_on
|
- service: light.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: light.living_room
|
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.
|
||||||
Reference in New Issue
Block a user