chore(z2m): move from mqtt topic to device action (#3)

This commit is contained in:
Damien
2024-11-28 16:11:51 +01:00
committed by GitHub
parent 95087e88c8
commit 05333fc13e
2 changed files with 210 additions and 163 deletions

View File

@@ -20,9 +20,9 @@ blueprint:
domain: automation domain: automation
input: input:
remote_device: remote_device:
name: (ZHA) Remote name: Remote
description: > description: >
**_Choose if you are using ZHA._** IKEA remote to use. IKEA remote (Somrig, Rodret) to use.
default: [] default: []
selector: selector:
device: device:
@@ -33,16 +33,13 @@ blueprint:
- integration: zha - integration: zha
manufacturer: IKEA of Sweden manufacturer: IKEA of Sweden
model: SOMRIG shortcut button model: SOMRIG shortcut button
- integration: mqtt
manufacturer: IKEA
model: RODRET wireless dimmer/power switch (E2201)
- integration: mqtt
manufacturer: IKEA
model: SOMRIG shortcut button (E2213)
multiple: false multiple: false
remote_name:
name: (Zigbee2MQTT) Remote Name
description: >
**_Choose if you are using Zigbee2MQTT._** The name of the controller (e.g. IKEA Rodret).
default: []
base_topic:
name: (Zigbee2MQTT) Base mqtt topic
description: The topic configured in [Z2M addon](https://www.zigbee2mqtt.io/guide/usage/mqtt_topics_and_messages.html).
default: zigbee2mqtt
on_press_action: on_press_action:
name: Single press action (on / 1 dot) name: Single press action (on / 1 dot)
description: Choose action(s) to run when **on** (Rodret) or **1 dot** (Somrig) button is **pressed**. description: Choose action(s) to run when **on** (Rodret) or **1 dot** (Somrig) button is **pressed**.
@@ -137,187 +134,206 @@ blueprint:
mode: slider mode: slider
mode: single mode: single
max_exceeded: silent max_exceeded: silent
trigger_variables:
z2m_base_topic: !input base_topic
z2m_controller: !input remote_name
zha_controller: !input remote_device
trigger: trigger:
# RODRET - E2201 # RODRET - E2201
- trigger: event - trigger: event
event_type: zha_event event_type: zha_event
event_data: event_data:
device_id: "{{ zha_controller }}" device_id: !input remote_device
command: "on" command: "on"
cluster_id: 6 cluster_id: 6
endpoint_id: 1 endpoint_id: 1
id: press-on-zha-e2201 id: press-on-zha-e2201
- trigger: mqtt - trigger: device
topic: "{{ z2m_base_topic ~ '/' ~ z2m_controller ~ '/action' }}" domain: mqtt
payload: "on" device_id: !input remote_device
type: action
subtype: "on"
id: press-on-z2m-e2201 id: press-on-z2m-e2201
- trigger: event - trigger: event
event_type: zha_event event_type: zha_event
event_data: event_data:
device_id: "{{ zha_controller }}" device_id: !input remote_device
command: "off" command: "off"
cluster_id: 6 cluster_id: 6
endpoint_id: 1 endpoint_id: 1
id: press-off-zha-e2201 id: press-off-zha-e2201
- trigger: mqtt - trigger: device
topic: "{{ z2m_base_topic ~ '/' ~ z2m_controller ~ '/action' }}" domain: mqtt
payload: "off" device_id: !input remote_device
type: action
subtype: "off"
id: press-off-z2m-e2201 id: press-off-z2m-e2201
- trigger: event - trigger: event
event_type: zha_event event_type: zha_event
event_data: event_data:
device_id: "{{ zha_controller }}" device_id: !input remote_device
command: "move_with_on_off" command: "move_with_on_off"
cluster_id: 8 cluster_id: 8
endpoint_id: 1 endpoint_id: 1
args: [0, 83] args: [0, 83]
id: hold-on-zha-e2201 id: hold-on-zha-e2201
- trigger: mqtt - trigger: device
topic: "{{ z2m_base_topic ~ '/' ~ z2m_controller ~ '/action' }}" domain: mqtt
payload: "brightness_move_up" device_id: !input remote_device
type: action
subtype: "brightness_move_up"
id: hold-on-z2m-e2201 id: hold-on-z2m-e2201
- trigger: event - trigger: event
event_type: zha_event event_type: zha_event
event_data: event_data:
device_id: "{{ zha_controller }}" device_id: !input remote_device
command: "move" command: "move"
cluster_id: 8 cluster_id: 8
endpoint_id: 1 endpoint_id: 1
args: [1, 83, 0, 0] args: [1, 83, 0, 0]
id: hold-off-zha-e2201 id: hold-off-zha-e2201
- trigger: mqtt - trigger: device
topic: "{{ z2m_base_topic ~ '/' ~ z2m_controller ~ '/action' }}" domain: mqtt
payload: "brightness_move_down" device_id: !input remote_device
type: action
subtype: "brightness_move_down"
id: hold-off-z2m-e2201 id: hold-off-z2m-e2201
- trigger: event - trigger: event
event_type: zha_event event_type: zha_event
event_data: event_data:
device_id: "{{ zha_controller }}" device_id: !input remote_device
endpoint_id: 1 endpoint_id: 1
cluster_id: 8 cluster_id: 8
command: stop_with_on_off command: stop_with_on_off
id: release-zha-e2201 id: release-zha-e2201
- trigger: mqtt - trigger: device
topic: "{{ z2m_base_topic ~ '/' ~ z2m_controller ~ '/action' }}" domain: mqtt
payload: "brightness_stop" device_id: !input remote_device
type: action
subtype: "brightness_stop"
id: release-z2m-e2201 id: release-z2m-e2201
# SOMRIG - E2213 # SOMRIG - E2213
- trigger: event - trigger: event
event_type: zha_event event_type: zha_event
event_data: event_data:
device_id: "{{ zha_controller }}" device_id: !input remote_device
command: "short_release" command: "short_release"
cluster_id: 64640 cluster_id: 64640
endpoint_id: 1 endpoint_id: 1
args: [0] args: [0]
id: press-dots1-zha-e2213 id: press-dots1-zha-e2213
- trigger: mqtt - trigger: device
topic: "{{ z2m_base_topic ~ '/' ~ z2m_controller ~ '/action' }}" domain: mqtt
payload: "1_short_release" device_id: !input remote_device
type: action
subtype: "1_short_release"
id: press-dots1-z2m-e2213 id: press-dots1-z2m-e2213
- trigger: event - trigger: event
event_type: zha_event event_type: zha_event
event_data: event_data:
device_id: "{{ zha_controller }}" device_id: !input remote_device
command: "short_release" command: "short_release"
cluster_id: 64640 cluster_id: 64640
endpoint_id: 2 endpoint_id: 2
args: [0] args: [0]
id: press-dots2-zha-e2213 id: press-dots2-zha-e2213
- trigger: mqtt - trigger: device
topic: "{{ z2m_base_topic ~ '/' ~ z2m_controller ~ '/action' }}" domain: mqtt
payload: "2_short_release" device_id: !input remote_device
type: action
subtype: "2_short_release"
id: press-dots2-z2m-e2213 id: press-dots2-z2m-e2213
- trigger: event - trigger: event
event_type: zha_event event_type: zha_event
event_data: event_data:
device_id: "{{ zha_controller }}" device_id: !input remote_device
command: "multi_press_complete" command: "multi_press_complete"
cluster_id: 64640 cluster_id: 64640
endpoint_id: 1 endpoint_id: 1
args: [0, 2] args: [0, 2]
id: double-press-dots1-zha-e2213 id: double-press-dots1-zha-e2213
- trigger: mqtt - trigger: device
topic: "{{ z2m_base_topic ~ '/' ~ z2m_controller ~ '/action' }}" domain: mqtt
payload: "1_double_press" device_id: !input remote_device
type: action
subtype: "1_double_press"
id: double-press-dots1-z2m-e2213 id: double-press-dots1-z2m-e2213
- trigger: event - trigger: event
event_type: zha_event event_type: zha_event
event_data: event_data:
device_id: "{{ zha_controller }}" device_id: !input remote_device
command: "multi_press_complete" command: "multi_press_complete"
cluster_id: 64640 cluster_id: 64640
endpoint_id: 2 endpoint_id: 2
args: [0, 2] args: [0, 2]
id: double-press-dots2-zha-e2213 id: double-press-dots2-zha-e2213
- trigger: mqtt - trigger: device
topic: "{{ z2m_base_topic ~ '/' ~ z2m_controller ~ '/action' }}" domain: mqtt
payload: "2_double_press" device_id: !input remote_device
type: action
subtype: "2_double_press"
id: double-press-dots2-z2m-e2213 id: double-press-dots2-z2m-e2213
- trigger: event - trigger: event
event_type: zha_event event_type: zha_event
event_data: event_data:
device_id: "{{ zha_controller }}" device_id: !input remote_device
command: "long_press" command: "long_press"
cluster_id: 64640 cluster_id: 64640
endpoint_id: 1 endpoint_id: 1
args: [0] args: [0]
id: hold-dots1-zha-e2213 id: hold-dots1-zha-e2213
- trigger: mqtt - trigger: device
topic: "{{ z2m_base_topic ~ '/' ~ z2m_controller ~ '/action' }}" domain: mqtt
payload: "1_long_press" device_id: !input remote_device
type: action
subtype: "1_long_press"
id: hold-dots1-z2m-e2213 id: hold-dots1-z2m-e2213
- trigger: event - trigger: event
event_type: zha_event event_type: zha_event
event_data: event_data:
device_id: "{{ zha_controller }}" device_id: !input remote_device
command: "long_press" command: "long_press"
cluster_id: 64640 cluster_id: 64640
endpoint_id: 2 endpoint_id: 2
args: [0] args: [0]
id: hold-dots2-zha-e2213 id: hold-dots2-zha-e2213
- trigger: mqtt - trigger: device
topic: "{{ z2m_base_topic ~ '/' ~ z2m_controller ~ '/action' }}" domain: mqtt
payload: "2_long_press" device_id: !input remote_device
type: action
subtype: "2_long_press"
id: hold-dots2-z2m-e2213 id: hold-dots2-z2m-e2213
- trigger: event - trigger: event
event_type: zha_event event_type: zha_event
event_data: event_data:
device_id: "{{ zha_controller }}" device_id: !input remote_device
command: "long_release" command: "long_release"
cluster_id: 64640 cluster_id: 64640
endpoint_id: 1 endpoint_id: 1
args: [0] args: [0]
id: release-hold-dots1-zha-e2213 id: release-hold-dots1-zha-e2213
- trigger: mqtt - trigger: device
topic: "{{ z2m_base_topic ~ '/' ~ z2m_controller ~ '/action' }}" domain: mqtt
payload: "1_long_release" device_id: !input remote_device
type: action
subtype: "1_long_release"
id: release-hold-dots1-z2m-e2213 id: release-hold-dots1-z2m-e2213
- trigger: event - trigger: event
event_type: zha_event event_type: zha_event
event_data: event_data:
device_id: "{{ zha_controller }}" device_id: !input remote_device
command: "long_release" command: "long_release"
cluster_id: 64640 cluster_id: 64640
endpoint_id: 2 endpoint_id: 2
args: [0] args: [0]
id: release-hold-dots2-zha-e2213 id: release-hold-dots2-zha-e2213
- trigger: mqtt - trigger: device
topic: "{{ z2m_base_topic ~ '/' ~ z2m_controller ~ '/action' }}" domain: mqtt
payload: "2_long_release" device_id: !input remote_device
type: action
subtype: "2_long_release"
id: release-hold-dots2-z2m-e2213 id: release-hold-dots2-z2m-e2213
action: action:
- variables: - variables:
on_double_press_exposed: !input on_double_press_exposed on_double_press_exposed: !input on_double_press_exposed
off_double_press_exposed: !input off_double_press_exposed off_double_press_exposed: !input off_double_press_exposed
zha_controller: !input remote_device
z2m_base_topic: !input base_topic
z2m_controller: !input remote_name
- choose: - choose:
- conditions: - conditions:
- condition: trigger - condition: trigger
@@ -341,7 +357,7 @@ action:
- trigger: event - trigger: event
event_type: zha_event event_type: zha_event
event_data: event_data:
device_id: "{{ zha_controller }}" device_id: !input remote_device
command: "on" command: "on"
cluster_id: 6 cluster_id: 6
endpoint_id: 1 endpoint_id: 1
@@ -359,9 +375,11 @@ action:
- press-on-z2m-e2201 - press-on-z2m-e2201
sequence: sequence:
- wait_for_trigger: - wait_for_trigger:
- trigger: mqtt - trigger: device
topic: "{{ z2m_base_topic ~ '/' ~ z2m_controller ~ '/action' }}" domain: mqtt
payload: "on" device_id: !input remote_device
type: action
subtype: "on"
timeout: timeout:
milliseconds: !input helper_double_press_delay milliseconds: !input helper_double_press_delay
continue_on_timeout: true continue_on_timeout: true
@@ -394,7 +412,7 @@ action:
- trigger: event - trigger: event
event_type: zha_event event_type: zha_event
event_data: event_data:
device_id: "{{ zha_controller }}" device_id: !input remote_device
command: "off" command: "off"
cluster_id: 6 cluster_id: 6
endpoint_id: 1 endpoint_id: 1
@@ -412,9 +430,11 @@ action:
- press-off-z2m-e2201 - press-off-z2m-e2201
sequence: sequence:
- wait_for_trigger: - wait_for_trigger:
- trigger: mqtt - trigger: device
topic: "{{ z2m_base_topic ~ '/' ~ z2m_controller ~ '/action' }}" domain: mqtt
payload: "off" device_id: !input remote_device
type: action
subtype: "off"
timeout: timeout:
milliseconds: !input helper_double_press_delay milliseconds: !input helper_double_press_delay
continue_on_timeout: true continue_on_timeout: true
@@ -462,7 +482,7 @@ action:
- trigger: event - trigger: event
event_type: zha_event event_type: zha_event
event_data: event_data:
device_id: "{{ zha_controller }}" device_id: !input remote_device
command: "stop_with_on_off" command: "stop_with_on_off"
cluster_id: 8 cluster_id: 8
endpoint_id: 1 endpoint_id: 1
@@ -481,12 +501,16 @@ action:
- hold-dots1-z2m-e2213 - hold-dots1-z2m-e2213
sequence: sequence:
- wait_for_trigger: - wait_for_trigger:
- trigger: mqtt - trigger: device
topic: "{{ z2m_base_topic ~ '/' ~ z2m_controller ~ '/action' }}" domain: mqtt
payload: "brightness_stop" device_id: !input remote_device
- trigger: mqtt type: action
topic: "{{ z2m_base_topic ~ '/' ~ z2m_controller ~ '/action' }}" subtype: "brightness_stop"
payload: "1_long_release" - trigger: device
domain: mqtt
device_id: !input remote_device
type: action
subtype: "1_long_release"
timeout: timeout:
milliseconds: !input helper_hold_delay milliseconds: !input helper_hold_delay
continue_on_timeout: true continue_on_timeout: true
@@ -520,7 +544,7 @@ action:
- trigger: event - trigger: event
event_type: zha_event event_type: zha_event
event_data: event_data:
device_id: "{{ zha_controller }}" device_id: !input remote_device
command: "stop_with_on_off" command: "stop_with_on_off"
cluster_id: 8 cluster_id: 8
endpoint_id: 1 endpoint_id: 1
@@ -539,12 +563,16 @@ action:
- hold-dots2-z2m-e2213 - hold-dots2-z2m-e2213
sequence: sequence:
- wait_for_trigger: - wait_for_trigger:
- trigger: mqtt - trigger: device
topic: "{{ z2m_base_topic ~ '/' ~ z2m_controller ~ '/action' }}" domain: mqtt
payload: "brightness_stop" device_id: !input remote_device
- trigger: mqtt type: action
topic: "{{ z2m_base_topic ~ '/' ~ z2m_controller ~ '/action' }}" subtype: "brightness_stop"
payload: "2_long_release" - trigger: device
domain: mqtt
device_id: !input remote_device
type: action
subtype: "2_long_release"
timeout: timeout:
milliseconds: !input helper_hold_delay milliseconds: !input helper_hold_delay
continue_on_timeout: true continue_on_timeout: true

View File

@@ -35,16 +35,13 @@ blueprint:
- integration: zha - integration: zha
manufacturer: IKEA of Sweden manufacturer: IKEA of Sweden
model: SOMRIG shortcut button model: SOMRIG shortcut button
- integration: mqtt
manufacturer: IKEA
model: RODRET wireless dimmer/power switch (E2201)
- integration: mqtt
manufacturer: IKEA
model: SOMRIG shortcut button (E2213)
multiple: false multiple: false
remote_name:
name: (Zigbee2MQTT) Remote Name
description: >
**_Choose if you are using Zigbee2MQTT._** The name of the controller (e.g. IKEA Rodret).
default: ""
base_topic:
name: (Zigbee2MQTT) Base mqtt topic
description: The topic configured in [Z2M addon](https://www.zigbee2mqtt.io/guide/usage/mqtt_topics_and_messages.html).
default: zigbee2mqtt
light: light:
name: Light name: Light
description: Light to control description: Light to control
@@ -74,179 +71,201 @@ blueprint:
mode: slider mode: slider
mode: restart mode: restart
max_exceeded: silent max_exceeded: silent
trigger_variables:
z2m_base_topic: !input base_topic
z2m_controller: !input remote_name
zha_controller: !input remote_device
trigger: trigger:
# RODRET - E2201 # RODRET - E2201
- trigger: event - trigger: event
event_type: zha_event event_type: zha_event
event_data: event_data:
device_id: "{{ zha_controller }}" device_id: !input remote_device
command: "on" command: "on"
cluster_id: 6 cluster_id: 6
endpoint_id: 1 endpoint_id: 1
id: press-on-zha-e2201 id: press-on-zha-e2201
- trigger: mqtt - trigger: device
topic: "{{ z2m_base_topic ~ '/' ~ z2m_controller ~ '/action' }}" domain: mqtt
payload: "on" device_id: !input remote_device
type: action
subtype: "on"
id: press-on-z2m-e2201 id: press-on-z2m-e2201
- trigger: event - trigger: event
event_type: zha_event event_type: zha_event
event_data: event_data:
device_id: "{{ zha_controller }}" device_id: !input remote_device
command: "off" command: "off"
cluster_id: 6 cluster_id: 6
endpoint_id: 1 endpoint_id: 1
id: press-off-zha-e2201 id: press-off-zha-e2201
- trigger: mqtt - trigger: device
topic: "{{ z2m_base_topic ~ '/' ~ z2m_controller ~ '/action' }}" domain: mqtt
payload: "off" device_id: !input remote_device
type: action
subtype: "off"
id: press-off-z2m-e2201 id: press-off-z2m-e2201
- trigger: event - trigger: event
event_type: zha_event event_type: zha_event
event_data: event_data:
device_id: "{{ zha_controller }}" device_id: !input remote_device
command: "move_with_on_off" command: "move_with_on_off"
cluster_id: 8 cluster_id: 8
endpoint_id: 1 endpoint_id: 1
args: [0, 83] args: [0, 83]
id: hold-on-zha-e2201 id: hold-on-zha-e2201
- trigger: mqtt - trigger: device
topic: "{{ z2m_base_topic ~ '/' ~ z2m_controller ~ '/action' }}" domain: mqtt
payload: "brightness_move_up" device_id: !input remote_device
type: action
subtype: "brightness_move_up"
id: hold-on-z2m-e2201 id: hold-on-z2m-e2201
- trigger: event - trigger: event
event_type: zha_event event_type: zha_event
event_data: event_data:
device_id: "{{ zha_controller }}" device_id: !input remote_device
command: "move" command: "move"
cluster_id: 8 cluster_id: 8
endpoint_id: 1 endpoint_id: 1
args: [1, 83, 0, 0] args: [1, 83, 0, 0]
id: hold-off-zha-e2201 id: hold-off-zha-e2201
- trigger: mqtt - trigger: device
topic: "{{ z2m_base_topic ~ '/' ~ z2m_controller ~ '/action' }}" domain: mqtt
payload: "brightness_move_down" device_id: !input remote_device
type: action
subtype: "brightness_move_down"
id: hold-off-z2m-e2201 id: hold-off-z2m-e2201
- trigger: event - trigger: event
event_type: zha_event event_type: zha_event
event_data: event_data:
device_id: "{{ zha_controller }}" device_id: !input remote_device
command: stop_with_on_off command: stop_with_on_off
endpoint_id: 1 endpoint_id: 1
cluster_id: 8 cluster_id: 8
id: release-zha-e2201 id: release-zha-e2201
- trigger: mqtt - trigger: device
topic: "{{ z2m_base_topic ~ '/' ~ z2m_controller ~ '/action' }}" domain: mqtt
payload: "brightness_stop" device_id: !input remote_device
type: action
subtype: "brightness_stop"
id: release-z2m-e2201 id: release-z2m-e2201
# SOMRIG - E2213 # SOMRIG - E2213
- trigger: event - trigger: event
event_type: zha_event event_type: zha_event
event_data: event_data:
device_id: "{{ zha_controller }}" device_id: !input remote_device
command: "short_release" command: "short_release"
cluster_id: 64640 cluster_id: 64640
endpoint_id: 1 endpoint_id: 1
args: [0] args: [0]
id: press-dots1-zha-e2213 id: press-dots1-zha-e2213
- trigger: mqtt - trigger: device
topic: "{{ z2m_base_topic ~ '/' ~ z2m_controller ~ '/action' }}" domain: mqtt
payload: "1_short_release" device_id: !input remote_device
type: action
subtype: "1_short_release"
id: press-dots1-z2m-e2213 id: press-dots1-z2m-e2213
- trigger: event - trigger: event
event_type: zha_event event_type: zha_event
event_data: event_data:
device_id: "{{ zha_controller }}" device_id: !input remote_device
command: "short_release" command: "short_release"
cluster_id: 64640 cluster_id: 64640
endpoint_id: 2 endpoint_id: 2
args: [0] args: [0]
id: press-dots2-zha-e2213 id: press-dots2-zha-e2213
- trigger: mqtt - trigger: device
topic: "{{ z2m_base_topic ~ '/' ~ z2m_controller ~ '/action' }}" domain: mqtt
payload: "2_short_release" device_id: !input remote_device
type: action
subtype: "2_short_release"
id: press-dots2-z2m-e2213 id: press-dots2-z2m-e2213
- trigger: event - trigger: event
event_type: zha_event event_type: zha_event
event_data: event_data:
device_id: "{{ zha_controller }}" device_id: !input remote_device
command: "multi_press_complete" command: "multi_press_complete"
cluster_id: 64640 cluster_id: 64640
endpoint_id: 1 endpoint_id: 1
args: [0, 2] args: [0, 2]
id: double-press-dots1-zha-e2213 id: double-press-dots1-zha-e2213
- trigger: mqtt - trigger: device
topic: "{{ z2m_base_topic ~ '/' ~ z2m_controller ~ '/action' }}" domain: mqtt
payload: "1_double_press" device_id: !input remote_device
type: action
subtype: "1_double_press"
id: double-press-dots1-z2m-e2213 id: double-press-dots1-z2m-e2213
- trigger: event - trigger: event
event_type: zha_event event_type: zha_event
event_data: event_data:
device_id: "{{ zha_controller }}" device_id: !input remote_device
command: "multi_press_complete" command: "multi_press_complete"
cluster_id: 64640 cluster_id: 64640
endpoint_id: 2 endpoint_id: 2
args: [0, 2] args: [0, 2]
id: double-press-dots2-zha-e2213 id: double-press-dots2-zha-e2213
- trigger: mqtt - trigger: device
topic: "{{ z2m_base_topic ~ '/' ~ z2m_controller ~ '/action' }}" domain: mqtt
payload: "2_double_press" device_id: !input remote_device
type: action
subtype: "2_double_press"
id: double-press-dots2-z2m-e2213 id: double-press-dots2-z2m-e2213
- trigger: event - trigger: event
event_type: zha_event event_type: zha_event
event_data: event_data:
device_id: "{{ zha_controller }}" device_id: !input remote_device
command: "long_press" command: "long_press"
cluster_id: 64640 cluster_id: 64640
endpoint_id: 1 endpoint_id: 1
args: [0] args: [0]
id: hold-dots1-zha-e2213 id: hold-dots1-zha-e2213
- trigger: mqtt - trigger: device
topic: "{{ z2m_base_topic ~ '/' ~ z2m_controller ~ '/action' }}" domain: mqtt
payload: "1_long_press" device_id: !input remote_device
type: action
subtype: "1_long_press"
id: hold-dots1-z2m-e2213 id: hold-dots1-z2m-e2213
- trigger: event - trigger: event
event_type: zha_event event_type: zha_event
event_data: event_data:
device_id: "{{ zha_controller }}" device_id: !input remote_device
command: "long_press" command: "long_press"
cluster_id: 64640 cluster_id: 64640
endpoint_id: 2 endpoint_id: 2
args: [0] args: [0]
id: hold-dots2-zha-e2213 id: hold-dots2-zha-e2213
- trigger: mqtt - trigger: device
topic: "{{ z2m_base_topic ~ '/' ~ z2m_controller ~ '/action' }}" domain: mqtt
payload: "2_long_press" device_id: !input remote_device
type: action
subtype: "2_long_press"
id: hold-dots2-z2m-e2213 id: hold-dots2-z2m-e2213
- trigger: event - trigger: event
event_type: zha_event event_type: zha_event
event_data: event_data:
device_id: "{{ zha_controller }}" device_id: !input remote_device
command: "long_release" command: "long_release"
cluster_id: 64640 cluster_id: 64640
endpoint_id: 1 endpoint_id: 1
args: [0] args: [0]
id: release-hold-dots1-zha-e2213 id: release-hold-dots1-zha-e2213
- trigger: mqtt - trigger: device
topic: "{{ z2m_base_topic ~ '/' ~ z2m_controller ~ '/action' }}" domain: mqtt
payload: "1_long_release" device_id: !input remote_device
type: action
subtype: "1_long_release"
id: release-hold-dots1-z2m-e2213 id: release-hold-dots1-z2m-e2213
- trigger: event - trigger: event
event_type: zha_event event_type: zha_event
event_data: event_data:
device_id: "{{ zha_controller }}" device_id: !input remote_device
command: "long_release" command: "long_release"
cluster_id: 64640 cluster_id: 64640
endpoint_id: 2 endpoint_id: 2
args: [0] args: [0]
id: release-hold-dots2-zha-e2213 id: release-hold-dots2-zha-e2213
- trigger: mqtt - trigger: device
topic: "{{ z2m_base_topic ~ '/' ~ z2m_controller ~ '/action' }}" domain: mqtt
payload: "2_long_release" device_id: !input remote_device
type: action
subtype: "2_long_release"
id: release-hold-dots2-z2m-e2213 id: release-hold-dots2-z2m-e2213
action: action:
- variables: - variables:
@@ -266,14 +285,14 @@ action:
- choose: - choose:
- conditions: "{{ helper_force_brightness }}" - conditions: "{{ helper_force_brightness }}"
sequence: sequence:
- service: light.turn_on - action: light.turn_on
target: target:
entity_id: !input light entity_id: !input light
data: data:
transition: 1 transition: 1
brightness_pct: !input helper_brightness brightness_pct: !input helper_brightness
default: default:
- service: light.turn_on - action: light.turn_on
target: target:
entity_id: !input light entity_id: !input light
data: data:
@@ -286,7 +305,7 @@ action:
- press-dots2-zha-e2213 - press-dots2-zha-e2213
- press-dots2-z2m-e2213 - press-dots2-z2m-e2213
sequence: sequence:
- service: light.turn_off - action: light.turn_off
target: target:
entity_id: !input light entity_id: !input light
data: data:
@@ -309,7 +328,7 @@ action:
- hold-dots1-z2m-e2213 - hold-dots1-z2m-e2213
sequence: sequence:
- parallel: - parallel:
- service: light.turn_on - action: light.turn_on
target: target:
entity_id: !input light entity_id: !input light
data: data:
@@ -331,13 +350,13 @@ action:
}}" }}"
sequence: sequence:
- parallel: - parallel:
- service: light.turn_on - action: light.turn_on
data: data:
brightness_step_pct: "{{ helper_hold_dim_step | int * -1 }}" brightness_step_pct: "{{ helper_hold_dim_step | int * -1 }}"
target: target:
entity_id: !input light entity_id: !input light
- delay: "{{ helper_hold_delay }}" - delay: "{{ helper_hold_delay }}"
- service: light.turn_on - action: light.turn_on
data: data:
brightness_pct: 1 brightness_pct: 1
target: target: