Add EnOcean PTM215Z (Friends of Hue) switch
This commit is contained in:
parent
a471f682ad
commit
5f3e30522a
1 changed files with 308 additions and 0 deletions
308
blueprints/enocean_ptm_215z_switch_advanced.yaml
Normal file
308
blueprints/enocean_ptm_215z_switch_advanced.yaml
Normal file
|
|
@ -0,0 +1,308 @@
|
||||||
|
---
|
||||||
|
blueprint:
|
||||||
|
name: Z2M - EnOcean PTM215Z (Friends of Hue) switch, Advanced, v2
|
||||||
|
author: runejuhl
|
||||||
|
homeassistant:
|
||||||
|
min_version: 2024.6.0
|
||||||
|
description: >
|
||||||
|
## Z2M - EnOcean PTM215Z (Friends of Hue) switch, Advanced, v2, 2025-02-20
|
||||||
|
|
||||||
|
Includes all button functions, Advanced use, Works with Zigbee2MQTT 2.0 and up.
|
||||||
|
|
||||||
|
This is a copy of
|
||||||
|
https://community.home-assistant.io/t/zigbee2mqtt-enocean-ptm-215z-friends-of-hue-switch/429770/95
|
||||||
|
from 2025-02-20.
|
||||||
|
source_url: https://git.petardo.dk/runejuhl/hass-blueprints/raw/branch/dev/blueprints/enocean_ptm_215z_switch_advanced.yaml
|
||||||
|
domain: automation
|
||||||
|
input:
|
||||||
|
switch:
|
||||||
|
name: HA device name, action entity
|
||||||
|
description: If more switches share the same functionality, you can choose 2 or more
|
||||||
|
selector:
|
||||||
|
entity:
|
||||||
|
filter:
|
||||||
|
- integration: mqtt
|
||||||
|
domain: event
|
||||||
|
multiple: true
|
||||||
|
hold_delay:
|
||||||
|
name: Hold delay
|
||||||
|
description: If the button has been held more than the configured Hold delay,
|
||||||
|
the corresponding repeat action will be triggered
|
||||||
|
default: 1000
|
||||||
|
selector:
|
||||||
|
number:
|
||||||
|
min: 300
|
||||||
|
max: 3000
|
||||||
|
unit_of_measurement: milliseconds
|
||||||
|
step: 100
|
||||||
|
|
||||||
|
button_1_press:
|
||||||
|
name: Button 1 Pressed (upper left)
|
||||||
|
description: Action to run, when button 1 is pressed.
|
||||||
|
default: []
|
||||||
|
selector:
|
||||||
|
action: {}
|
||||||
|
button_1_repeat:
|
||||||
|
name: Button 1 Repeted action (upper left)
|
||||||
|
description: Action to repeat, when the button 1 is held.
|
||||||
|
default: []
|
||||||
|
selector:
|
||||||
|
action: {}
|
||||||
|
button_1_short_release:
|
||||||
|
name: Button 1 short released (upper left)
|
||||||
|
description: Action to run, when the button 1 is released after short pres.
|
||||||
|
default: []
|
||||||
|
selector:
|
||||||
|
action: {}
|
||||||
|
button_1_long_release:
|
||||||
|
name: Button 1 long released (upper left)
|
||||||
|
description: Action to run, when the button 1 is released after long press.
|
||||||
|
default: []
|
||||||
|
selector:
|
||||||
|
action: {}
|
||||||
|
|
||||||
|
button_2_press:
|
||||||
|
name: Button 2 Pressed (lower left)
|
||||||
|
description: Action to run, when button 2 is pressed.
|
||||||
|
default: []
|
||||||
|
selector:
|
||||||
|
action: {}
|
||||||
|
button_2_repeat:
|
||||||
|
name: Button 2 Repeted action (lower left)
|
||||||
|
description: Action to repeat, when the button 2 is held.
|
||||||
|
default: []
|
||||||
|
selector:
|
||||||
|
action: {}
|
||||||
|
button_2_short_release:
|
||||||
|
name: Button 2 short released (lower left)
|
||||||
|
description: Action to run, when the button 2 is released after short press.
|
||||||
|
default: []
|
||||||
|
selector:
|
||||||
|
action: {}
|
||||||
|
button_2_long_release:
|
||||||
|
name: Button 2 long released (lower left)
|
||||||
|
description: Action to run, when the button 2 is released after long press.
|
||||||
|
default: []
|
||||||
|
selector:
|
||||||
|
action: {}
|
||||||
|
|
||||||
|
button_3_press:
|
||||||
|
name: Button 3 Pressed (upper right)
|
||||||
|
description: Action to run, when button 3 is pressed.
|
||||||
|
default: []
|
||||||
|
selector:
|
||||||
|
action: {}
|
||||||
|
button_3_repeat:
|
||||||
|
name: Button 3 Repeted action (upper right)
|
||||||
|
description: Action to repeat, when the button 3 is held.
|
||||||
|
default: []
|
||||||
|
selector:
|
||||||
|
action: {}
|
||||||
|
button_3_short_release:
|
||||||
|
name: Button 3 short released (upper right)
|
||||||
|
description: Action to run, when the button 3 is released after short press.
|
||||||
|
default: []
|
||||||
|
selector:
|
||||||
|
action: {}
|
||||||
|
button_3_long_release:
|
||||||
|
name: Button 3 long released (upper right)
|
||||||
|
description: Action to run, when the button 3 is released after long press.
|
||||||
|
default: []
|
||||||
|
selector:
|
||||||
|
action: {}
|
||||||
|
|
||||||
|
button_4_press:
|
||||||
|
name: Button 4 Pressed (lower right)
|
||||||
|
description: Action to run, when button 4 is pressed.
|
||||||
|
default: []
|
||||||
|
selector:
|
||||||
|
action: {}
|
||||||
|
button_4_repeat:
|
||||||
|
name: Button 4 Repeted action (lower right)
|
||||||
|
description: Action to repeat, when the button 4 is held.
|
||||||
|
default: []
|
||||||
|
selector:
|
||||||
|
action: {}
|
||||||
|
button_4_short_release:
|
||||||
|
name: Button 4 short released (lower right)
|
||||||
|
description: Action to run, when the button 4 is released after short press.
|
||||||
|
default: []
|
||||||
|
selector:
|
||||||
|
action: {}
|
||||||
|
button_4_long_release:
|
||||||
|
name: Button 4 long released (lower right)
|
||||||
|
description: Action to run, when the button 4 is released after long press.
|
||||||
|
default: []
|
||||||
|
selector:
|
||||||
|
action: {}
|
||||||
|
|
||||||
|
button_13_press:
|
||||||
|
name: Button 1+3 Pressed (upper)
|
||||||
|
description: Action to run, when upper buttons are pressed.
|
||||||
|
default: []
|
||||||
|
selector:
|
||||||
|
action: {}
|
||||||
|
button_13_repeat:
|
||||||
|
name: Button 1+3 Repeated action (upper)
|
||||||
|
description: Action to repeat, when the upper buttons are held.
|
||||||
|
default: []
|
||||||
|
selector:
|
||||||
|
action: {}
|
||||||
|
button_13_short_release:
|
||||||
|
name: Button 1+3 are short released (upper)
|
||||||
|
description: Action to run, when the upper buttons are released after short press.
|
||||||
|
default: []
|
||||||
|
selector:
|
||||||
|
action: {}
|
||||||
|
button_13_long_release:
|
||||||
|
name: Button 1+3 long released (upper)
|
||||||
|
description: Action to run, when the upper buttons are released after long press.
|
||||||
|
default: []
|
||||||
|
selector:
|
||||||
|
action: {}
|
||||||
|
|
||||||
|
button_24_press:
|
||||||
|
name: Button 2+4 Pressed (lower)
|
||||||
|
description: Action to run, when lower buttons are pressed.
|
||||||
|
default: []
|
||||||
|
selector:
|
||||||
|
action: {}
|
||||||
|
button_24_repeat:
|
||||||
|
name: Button 2+4 Repeated action (lower)
|
||||||
|
description: Action to repeat, when the lower buttons are held.
|
||||||
|
default: []
|
||||||
|
selector:
|
||||||
|
action: {}
|
||||||
|
button_24_short_release:
|
||||||
|
name: Button 2+4 are short released (lower)
|
||||||
|
description: Action to run, when the lower buttons are released after short press.
|
||||||
|
default: []
|
||||||
|
selector:
|
||||||
|
action: {}
|
||||||
|
button_24_long_release:
|
||||||
|
name: Button 2+4 long released (lower)
|
||||||
|
description: Action to run, when the lower buttons are released after long press.
|
||||||
|
default: []
|
||||||
|
selector:
|
||||||
|
action: {}
|
||||||
|
|
||||||
|
mode: restart
|
||||||
|
max_exceeded: silent
|
||||||
|
|
||||||
|
triggers:
|
||||||
|
- trigger: state
|
||||||
|
entity_id: !input 'switch'
|
||||||
|
attribute: event_type
|
||||||
|
to:
|
||||||
|
- release_1
|
||||||
|
- release_2
|
||||||
|
- release_3
|
||||||
|
- release_4
|
||||||
|
- release_1_and_3
|
||||||
|
- release_2_and_4
|
||||||
|
- press_1
|
||||||
|
- press_2
|
||||||
|
- press_3
|
||||||
|
- press_4
|
||||||
|
- press_1_and_3
|
||||||
|
- press_2_and_4
|
||||||
|
|
||||||
|
action:
|
||||||
|
- variables:
|
||||||
|
keypress: '{{ trigger.to_state.attributes.event_type }}'
|
||||||
|
holddelay: !input 'hold_delay'
|
||||||
|
timediff: >-
|
||||||
|
{{ (trigger.to_state.last_changed -
|
||||||
|
trigger.from_state.last_changed).total_seconds() }}
|
||||||
|
|
||||||
|
- choose:
|
||||||
|
- conditions: '{{ keypress == ''press_1'' }}'
|
||||||
|
sequence:
|
||||||
|
- sequence: !input button_1_press
|
||||||
|
- delay:
|
||||||
|
milliseconds: !input hold_delay
|
||||||
|
- sequence: !input button_1_repeat
|
||||||
|
|
||||||
|
- conditions: '{{ keypress == ''press_2'' }}'
|
||||||
|
sequence:
|
||||||
|
- sequence: !input button_2_press
|
||||||
|
- delay:
|
||||||
|
milliseconds: !input hold_delay
|
||||||
|
- sequence: !input button_2_repeat
|
||||||
|
|
||||||
|
- conditions: '{{ keypress == ''press_3'' }}'
|
||||||
|
sequence:
|
||||||
|
- sequence: !input button_3_press
|
||||||
|
- delay:
|
||||||
|
milliseconds: !input hold_delay
|
||||||
|
- sequence: !input button_3_repeat
|
||||||
|
|
||||||
|
- conditions: '{{ keypress == ''press_4'' }}'
|
||||||
|
sequence:
|
||||||
|
- sequence: !input button_4_press
|
||||||
|
- delay:
|
||||||
|
milliseconds: !input hold_delay
|
||||||
|
- sequence: !input button_4_repeat
|
||||||
|
|
||||||
|
- conditions: '{{ keypress == ''press_1_and_3'' }}'
|
||||||
|
sequence:
|
||||||
|
- sequence: !input button_13_press
|
||||||
|
- delay:
|
||||||
|
milliseconds: !input hold_delay
|
||||||
|
- sequence: !input button_13_repeat
|
||||||
|
|
||||||
|
- conditions: '{{ keypress == ''press_2_and_4'' }}'
|
||||||
|
sequence:
|
||||||
|
- sequence: !input button_24_press
|
||||||
|
- delay:
|
||||||
|
milliseconds: !input hold_delay
|
||||||
|
- sequence: !input button_24_repeat
|
||||||
|
|
||||||
|
|
||||||
|
- conditions: '{{ keypress == ''release_1'' }}'
|
||||||
|
sequence:
|
||||||
|
- choose:
|
||||||
|
- conditions: '{{ timediff > (holddelay/1000) }}'
|
||||||
|
sequence: !input button_1_long_release
|
||||||
|
default:
|
||||||
|
- sequence: !input button_1_short_release
|
||||||
|
|
||||||
|
- conditions: '{{ keypress == ''release_2'' }}'
|
||||||
|
sequence:
|
||||||
|
- choose:
|
||||||
|
- conditions: '{{ timediff > (holddelay/1000) }}'
|
||||||
|
sequence: !input button_2_long_release
|
||||||
|
default:
|
||||||
|
- sequence: !input button_2_short_release
|
||||||
|
|
||||||
|
- conditions: '{{ keypress == ''release_3'' }}'
|
||||||
|
sequence:
|
||||||
|
- choose:
|
||||||
|
- conditions: '{{ timediff > (holddelay/1000) }}'
|
||||||
|
sequence: !input button_3_long_release
|
||||||
|
default:
|
||||||
|
- sequence: !input button_3_short_release
|
||||||
|
|
||||||
|
- conditions: '{{ keypress == ''release_4'' }}'
|
||||||
|
sequence:
|
||||||
|
- choose:
|
||||||
|
- conditions: '{{ timediff > (holddelay/1000) }}'
|
||||||
|
sequence: !input button_4_long_release
|
||||||
|
default:
|
||||||
|
- sequence: !input button_4_short_release
|
||||||
|
|
||||||
|
- conditions: '{{ keypress == ''release_1_and_3'' }}'
|
||||||
|
sequence:
|
||||||
|
- choose:
|
||||||
|
- conditions: '{{ timediff > (holddelay/1000) }}'
|
||||||
|
sequence: !input button_13_long_release
|
||||||
|
default:
|
||||||
|
- sequence: !input button_13_short_release
|
||||||
|
|
||||||
|
- conditions: '{{ keypress == ''release_2_and_4'' }}'
|
||||||
|
sequence:
|
||||||
|
- choose:
|
||||||
|
- conditions: '{{ timediff > (holddelay/1000) }}'
|
||||||
|
sequence: !input button_24_long_release
|
||||||
|
default:
|
||||||
|
- sequence: !input button_24_short_release
|
||||||
Loading…
Add table
Add a link
Reference in a new issue