feat: allow multiple remotes (#17)
* feat!: allow multiple remotes * doc: add fancy emojis * fix: press-dots2-z2m-e2213 * chore: add PR labeling and changelog template
This commit is contained in:
21
.github/release.yaml
vendored
Normal file
21
.github/release.yaml
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
changelog:
|
||||||
|
exclude:
|
||||||
|
labels:
|
||||||
|
- ignore-for-release
|
||||||
|
categories:
|
||||||
|
- title: 💥 Breaking Changes
|
||||||
|
labels:
|
||||||
|
- breaking
|
||||||
|
- title: 🚀 Features
|
||||||
|
labels:
|
||||||
|
- feature
|
||||||
|
- title: 🛠️ Fixes
|
||||||
|
labels:
|
||||||
|
- bug
|
||||||
|
- fix
|
||||||
|
- title: 📓 Documentation
|
||||||
|
labels:
|
||||||
|
- doc
|
||||||
|
- title: ⚙️ Other Changes
|
||||||
|
labels:
|
||||||
|
- "*"
|
||||||
9
.github/workflows/conventional-label.yaml
vendored
Normal file
9
.github/workflows/conventional-label.yaml
vendored
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
on:
|
||||||
|
pull_request_target:
|
||||||
|
types: [ opened, edited ]
|
||||||
|
name: conventional-release-labels
|
||||||
|
jobs:
|
||||||
|
label:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: bcoe/conventional-release-labels@v1
|
||||||
@@ -3,9 +3,9 @@ blueprint:
|
|||||||
min_version: 2024.10.0
|
min_version: 2024.10.0
|
||||||
author: damru
|
author: damru
|
||||||
domain: automation
|
domain: automation
|
||||||
name: IKEA Tradfri on/off (E1743), IKEA Rodret (E2201) or IKEA Somrig (E2213) Controls (ZHA/Z2M)
|
name: Ikea's Tradfri, Rodret or Somrig ⚙️ Controls
|
||||||
description: >
|
description: >
|
||||||
## Control anything with **IKEA TRADFRI ON/OFF** or **IKEA RODRET** or **IKEA SOMRIG** remotes
|
## ⚙️ Control anything with **IKEA TRADFRI ON/OFF** or **IKEA RODRET** or **IKEA SOMRIG** remotes
|
||||||
|
|
||||||
|
|
||||||
Only for use with [ZHA](https://www.home-assistant.io/integrations/zha/)
|
Only for use with [ZHA](https://www.home-assistant.io/integrations/zha/)
|
||||||
@@ -22,8 +22,8 @@ blueprint:
|
|||||||
- Hold **on/off** (Tradfri, Rodret) **1 dot/2 dots** (Somrig).
|
- Hold **on/off** (Tradfri, Rodret) **1 dot/2 dots** (Somrig).
|
||||||
Actions will be executed every **Hold delay**, but maximum **Max number of loops** times.
|
Actions will be executed every **Hold delay**, but maximum **Max number of loops** times.
|
||||||
input:
|
input:
|
||||||
remote_device:
|
remote_devices:
|
||||||
name: Remote
|
name: Remotes
|
||||||
description: >
|
description: >
|
||||||
IKEA remote (Tradfri, Rodret, Somrig) to use.
|
IKEA remote (Tradfri, Rodret, Somrig) to use.
|
||||||
default: []
|
default: []
|
||||||
@@ -60,7 +60,7 @@ blueprint:
|
|||||||
- integration: mqtt
|
- integration: mqtt
|
||||||
manufacturer: IKEA
|
manufacturer: IKEA
|
||||||
model: SOMRIG shortcut button (E2213)
|
model: SOMRIG shortcut button (E2213)
|
||||||
multiple: false
|
multiple: true
|
||||||
on_press_action:
|
on_press_action:
|
||||||
name: Press "on / 1 dot" action
|
name: Press "on / 1 dot" action
|
||||||
description: Choose action(s) to run when **on** (Tradfri, Rodret) or **1 dot** (Somrig) button is **pressed**.
|
description: Choose action(s) to run when **on** (Tradfri, Rodret) or **1 dot** (Somrig) button is **pressed**.
|
||||||
@@ -168,189 +168,161 @@ blueprint:
|
|||||||
mode: single
|
mode: single
|
||||||
max_exceeded: silent
|
max_exceeded: silent
|
||||||
triggers:
|
triggers:
|
||||||
# TRADFRI - E1743 + RODRET - E2201
|
# TRADFRI (E1743) + RODRET (E2201)
|
||||||
- trigger: event
|
- trigger: event
|
||||||
event_type: zha_event
|
event_type: zha_event
|
||||||
event_data:
|
event_data:
|
||||||
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-e1743-e2201
|
id: press-on-zha-e1743-e2201
|
||||||
- trigger: device
|
- trigger: mqtt
|
||||||
domain: mqtt
|
topic: "+/+/action"
|
||||||
device_id: !input remote_device
|
payload: "on"
|
||||||
type: action
|
|
||||||
subtype: "on"
|
|
||||||
id: press-on-z2m-e1743-e2201
|
id: press-on-z2m-e1743-e2201
|
||||||
- trigger: event
|
- trigger: event
|
||||||
event_type: zha_event
|
event_type: zha_event
|
||||||
event_data:
|
event_data:
|
||||||
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-e1743-e2201
|
id: press-off-zha-e1743-e2201
|
||||||
- trigger: device
|
- trigger: mqtt
|
||||||
domain: mqtt
|
topic: "+/+/action"
|
||||||
device_id: !input remote_device
|
payload: "off"
|
||||||
type: action
|
|
||||||
subtype: "off"
|
|
||||||
id: press-off-z2m-e1743-e2201
|
id: press-off-z2m-e1743-e2201
|
||||||
- trigger: event
|
- trigger: event
|
||||||
event_type: zha_event
|
event_type: zha_event
|
||||||
event_data:
|
event_data:
|
||||||
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]
|
|
||||||
id: hold-on-zha-e1743-e2201
|
id: hold-on-zha-e1743-e2201
|
||||||
- trigger: device
|
- trigger: mqtt
|
||||||
domain: mqtt
|
topic: "+/+/action"
|
||||||
device_id: !input remote_device
|
payload: brightness_move_up
|
||||||
type: action
|
|
||||||
subtype: "brightness_move_up"
|
|
||||||
id: hold-on-z2m-e1743-e2201
|
id: hold-on-z2m-e1743-e2201
|
||||||
- trigger: event
|
- trigger: event
|
||||||
event_type: zha_event
|
event_type: zha_event
|
||||||
event_data:
|
event_data:
|
||||||
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]
|
|
||||||
id: hold-off-zha-e1743-e2201
|
id: hold-off-zha-e1743-e2201
|
||||||
- trigger: device
|
- trigger: mqtt
|
||||||
domain: mqtt
|
topic: "+/+/action"
|
||||||
device_id: !input remote_device
|
payload: brightness_move_down
|
||||||
type: action
|
|
||||||
subtype: "brightness_move_down"
|
|
||||||
id: hold-off-z2m-e1743-e2201
|
id: hold-off-z2m-e1743-e2201
|
||||||
- trigger: event
|
- trigger: event
|
||||||
event_type: zha_event
|
event_type: zha_event
|
||||||
event_data:
|
event_data:
|
||||||
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-e1743-e2201
|
id: release-zha-e1743-e2201
|
||||||
- trigger: device
|
- trigger: mqtt
|
||||||
domain: mqtt
|
topic: "+/+/action"
|
||||||
device_id: !input remote_device
|
payload: brightness_stop
|
||||||
type: action
|
|
||||||
subtype: "brightness_stop"
|
|
||||||
id: release-z2m-e1743-e2201
|
id: release-z2m-e1743-e2201
|
||||||
|
|
||||||
# SOMRIG - E2213
|
# SOMRIG (E2213)
|
||||||
- trigger: event
|
- trigger: event
|
||||||
event_type: zha_event
|
event_type: zha_event
|
||||||
event_data:
|
event_data:
|
||||||
device_id: !input remote_device
|
command: short_release
|
||||||
command: "short_release"
|
|
||||||
endpoint_id: 1
|
endpoint_id: 1
|
||||||
id: press-dots1-zha-e2213
|
id: press-dots1-zha-e2213
|
||||||
- trigger: device
|
- trigger: mqtt
|
||||||
domain: mqtt
|
topic: "+/+/action"
|
||||||
device_id: !input remote_device
|
payload: 1_short_release
|
||||||
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: !input remote_device
|
command: short_release
|
||||||
command: "short_release"
|
|
||||||
endpoint_id: 2
|
endpoint_id: 2
|
||||||
id: press-dots2-zha-e2213
|
id: press-dots2-zha-e2213
|
||||||
- trigger: device
|
- trigger: mqtt
|
||||||
domain: mqtt
|
topic: "+/+/action"
|
||||||
device_id: !input remote_device
|
payload: 2_short_release
|
||||||
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: !input remote_device
|
command: multi_press_complete
|
||||||
command: "multi_press_complete"
|
|
||||||
endpoint_id: 1
|
endpoint_id: 1
|
||||||
id: double-press-dots1-zha-e2213
|
id: double-press-dots1-zha-e2213
|
||||||
- trigger: device
|
- trigger: mqtt
|
||||||
domain: mqtt
|
topic: "+/+/action"
|
||||||
device_id: !input remote_device
|
payload: 1_double_press
|
||||||
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: !input remote_device
|
command: multi_press_complete
|
||||||
command: "multi_press_complete"
|
|
||||||
endpoint_id: 2
|
endpoint_id: 2
|
||||||
id: double-press-dots2-zha-e2213
|
id: double-press-dots2-zha-e2213
|
||||||
- trigger: device
|
- trigger: mqtt
|
||||||
domain: mqtt
|
topic: "+/+/action"
|
||||||
device_id: !input remote_device
|
payload: 2_double_press
|
||||||
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: !input remote_device
|
command: long_press
|
||||||
command: "long_press"
|
|
||||||
endpoint_id: 1
|
endpoint_id: 1
|
||||||
id: hold-dots1-zha-e2213
|
id: hold-dots1-zha-e2213
|
||||||
- trigger: device
|
- trigger: mqtt
|
||||||
domain: mqtt
|
topic: "+/+/action"
|
||||||
device_id: !input remote_device
|
payload: 1_long_press
|
||||||
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: !input remote_device
|
command: long_press
|
||||||
command: "long_press"
|
|
||||||
endpoint_id: 2
|
endpoint_id: 2
|
||||||
id: hold-dots2-zha-e2213
|
id: hold-dots2-zha-e2213
|
||||||
- trigger: device
|
- trigger: mqtt
|
||||||
domain: mqtt
|
topic: "+/+/action"
|
||||||
device_id: !input remote_device
|
payload: 2_long_press
|
||||||
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: !input remote_device
|
command: long_release
|
||||||
command: "long_release"
|
|
||||||
endpoint_id: 1
|
endpoint_id: 1
|
||||||
id: release-hold-dots1-zha-e2213
|
id: release-hold-dots1-zha-e2213
|
||||||
- trigger: device
|
- trigger: mqtt
|
||||||
domain: mqtt
|
topic: "+/+/action"
|
||||||
device_id: !input remote_device
|
payload: 1_long_release
|
||||||
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: !input remote_device
|
command: long_release
|
||||||
command: "long_release"
|
|
||||||
endpoint_id: 2
|
endpoint_id: 2
|
||||||
id: release-hold-dots2-zha-e2213
|
id: release-hold-dots2-zha-e2213
|
||||||
- trigger: device
|
- trigger: mqtt
|
||||||
domain: mqtt
|
topic: "+/+/action"
|
||||||
device_id: !input remote_device
|
payload: 2_long_release
|
||||||
type: action
|
|
||||||
subtype: "2_long_release"
|
|
||||||
id: release-hold-dots2-z2m-e2213
|
id: release-hold-dots2-z2m-e2213
|
||||||
actions:
|
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
|
||||||
|
remote_devices: !input remote_devices
|
||||||
|
remote_device: >-
|
||||||
|
{% set is_zha = trigger.platform == "zha_event" %}
|
||||||
|
{% set is_mqtt = trigger.platform == "mqtt" %}
|
||||||
|
{% set device_name = trigger.topic.split("/")[1] if is_mqtt else none %}
|
||||||
|
{{
|
||||||
|
(trigger.event.data.device_id if is_zha) or
|
||||||
|
(device_id(trigger.topic.split("/")[1]) if is_mqtt and device_name)
|
||||||
|
}}
|
||||||
|
mqtt_topic: "{{ trigger.topic }}"
|
||||||
|
condition:
|
||||||
|
- condition: template
|
||||||
|
value_template: "{{ remote_device in remote_devices }}"
|
||||||
|
actions:
|
||||||
- choose:
|
- choose:
|
||||||
- conditions:
|
- conditions:
|
||||||
- condition: trigger
|
- condition: trigger
|
||||||
@@ -374,7 +346,7 @@ actions:
|
|||||||
- trigger: event
|
- trigger: event
|
||||||
event_type: zha_event
|
event_type: zha_event
|
||||||
event_data:
|
event_data:
|
||||||
device_id: !input remote_device
|
device_id: "{{ remote_device }}"
|
||||||
command: "on"
|
command: "on"
|
||||||
cluster_id: 6
|
cluster_id: 6
|
||||||
endpoint_id: 1
|
endpoint_id: 1
|
||||||
@@ -392,11 +364,9 @@ actions:
|
|||||||
- press-on-z2m-e1743-e2201
|
- press-on-z2m-e1743-e2201
|
||||||
sequence:
|
sequence:
|
||||||
- wait_for_trigger:
|
- wait_for_trigger:
|
||||||
- trigger: device
|
- trigger: mqtt
|
||||||
domain: mqtt
|
topic: "{{ mqtt_topic }}"
|
||||||
device_id: !input remote_device
|
payload: "on"
|
||||||
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
|
||||||
@@ -429,7 +399,7 @@ actions:
|
|||||||
- trigger: event
|
- trigger: event
|
||||||
event_type: zha_event
|
event_type: zha_event
|
||||||
event_data:
|
event_data:
|
||||||
device_id: !input remote_device
|
device_id: "{{ remote_device }}"
|
||||||
command: "off"
|
command: "off"
|
||||||
cluster_id: 6
|
cluster_id: 6
|
||||||
endpoint_id: 1
|
endpoint_id: 1
|
||||||
@@ -447,11 +417,9 @@ actions:
|
|||||||
- press-off-z2m-e1743-e2201
|
- press-off-z2m-e1743-e2201
|
||||||
sequence:
|
sequence:
|
||||||
- wait_for_trigger:
|
- wait_for_trigger:
|
||||||
- trigger: device
|
- trigger: mqtt
|
||||||
domain: mqtt
|
topic: "{{ mqtt_topic }}"
|
||||||
device_id: !input remote_device
|
payload: "off"
|
||||||
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
|
||||||
@@ -501,7 +469,7 @@ actions:
|
|||||||
- trigger: event
|
- trigger: event
|
||||||
event_type: zha_event
|
event_type: zha_event
|
||||||
event_data:
|
event_data:
|
||||||
device_id: !input remote_device
|
device_id: "{{ remote_device }}"
|
||||||
command: "stop_with_on_off"
|
command: "stop_with_on_off"
|
||||||
cluster_id: 8
|
cluster_id: 8
|
||||||
endpoint_id: 1
|
endpoint_id: 1
|
||||||
@@ -520,16 +488,12 @@ actions:
|
|||||||
- hold-dots1-z2m-e2213
|
- hold-dots1-z2m-e2213
|
||||||
sequence:
|
sequence:
|
||||||
- wait_for_trigger:
|
- wait_for_trigger:
|
||||||
- trigger: device
|
- trigger: mqtt
|
||||||
domain: mqtt
|
topic: "{{ mqtt_topic }}"
|
||||||
device_id: !input remote_device
|
payload: "brightness_stop"
|
||||||
type: action
|
- trigger: mqtt
|
||||||
subtype: "brightness_stop"
|
topic: "{{ mqtt_topic }}"
|
||||||
- trigger: device
|
payload: "1_long_release"
|
||||||
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
|
||||||
@@ -563,7 +527,7 @@ actions:
|
|||||||
- trigger: event
|
- trigger: event
|
||||||
event_type: zha_event
|
event_type: zha_event
|
||||||
event_data:
|
event_data:
|
||||||
device_id: !input remote_device
|
device_id: "{{ remote_device }}"
|
||||||
command: "stop_with_on_off"
|
command: "stop_with_on_off"
|
||||||
cluster_id: 8
|
cluster_id: 8
|
||||||
endpoint_id: 1
|
endpoint_id: 1
|
||||||
@@ -582,16 +546,12 @@ actions:
|
|||||||
- hold-dots2-z2m-e2213
|
- hold-dots2-z2m-e2213
|
||||||
sequence:
|
sequence:
|
||||||
- wait_for_trigger:
|
- wait_for_trigger:
|
||||||
- trigger: device
|
- trigger: mqtt
|
||||||
domain: mqtt
|
topic: "{{ mqtt_topic }}"
|
||||||
device_id: !input remote_device
|
payload: "brightness_stop"
|
||||||
type: action
|
- trigger: mqtt
|
||||||
subtype: "brightness_stop"
|
topic: "{{ mqtt_topic }}"
|
||||||
- trigger: device
|
payload: "2_long_release"
|
||||||
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
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ blueprint:
|
|||||||
min_version: 2024.10.0
|
min_version: 2024.10.0
|
||||||
author: damru
|
author: damru
|
||||||
domain: automation
|
domain: automation
|
||||||
name: IKEA Tradfri (E1743) or IKEA Rodret (E2201) or IKEA Somrig (E2213) Light control (ZHA/Z2M)
|
name: Ikea's Tradfri, Rodret or Somrig 💡 Light control
|
||||||
description: >
|
description: >
|
||||||
## Control a light with **IKEA TRADFRI ON/OFF** or **IKEA RODRET** or **IKEA SOMRIG** remotes
|
## 💡 Control a light with **IKEA TRADFRI ON/OFF** or ***IKEA RODRET** or **IKEA SOMRIG** remotes
|
||||||
|
|
||||||
|
|
||||||
Only for use with [ZHA](https://www.home-assistant.io/integrations/zha/)
|
Only for use with [ZHA](https://www.home-assistant.io/integrations/zha/)
|
||||||
@@ -24,8 +24,8 @@ blueprint:
|
|||||||
|
|
||||||
- Hold **off** (Tradfri, Rodret) or **2 dots** (Somrig) button to decrease the brightness down to 1%
|
- Hold **off** (Tradfri, Rodret) or **2 dots** (Somrig) button to decrease the brightness down to 1%
|
||||||
input:
|
input:
|
||||||
remote_device:
|
remote_devices:
|
||||||
name: Remote
|
name: Remotes
|
||||||
description: >
|
description: >
|
||||||
IKEA remote (Tradfri, Rodret, Somrig) to use.
|
IKEA remote (Tradfri, Rodret, Somrig) to use.
|
||||||
default: ""
|
default: ""
|
||||||
@@ -62,7 +62,7 @@ blueprint:
|
|||||||
- integration: mqtt
|
- integration: mqtt
|
||||||
manufacturer: IKEA
|
manufacturer: IKEA
|
||||||
model: SOMRIG shortcut button (E2213)
|
model: SOMRIG shortcut button (E2213)
|
||||||
multiple: false
|
multiple: true
|
||||||
light:
|
light:
|
||||||
name: Light
|
name: Light
|
||||||
description: Light to control
|
description: Light to control
|
||||||
@@ -102,187 +102,138 @@ triggers:
|
|||||||
- trigger: event
|
- trigger: event
|
||||||
event_type: zha_event
|
event_type: zha_event
|
||||||
event_data:
|
event_data:
|
||||||
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-e1743-e2201
|
id: press-on-zha-e1743-e2201
|
||||||
- trigger: device
|
- trigger: mqtt
|
||||||
domain: mqtt
|
topic: "+/+/action"
|
||||||
device_id: !input remote_device
|
payload: "on"
|
||||||
type: action
|
|
||||||
subtype: "on"
|
|
||||||
id: press-on-z2m-e1743-e2201
|
id: press-on-z2m-e1743-e2201
|
||||||
- trigger: event
|
- trigger: event
|
||||||
event_type: zha_event
|
event_type: zha_event
|
||||||
event_data:
|
event_data:
|
||||||
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-e1743-e2201
|
id: press-off-zha-e1743-e2201
|
||||||
- trigger: device
|
- trigger: mqtt
|
||||||
domain: mqtt
|
topic: "+/+/action"
|
||||||
device_id: !input remote_device
|
payload: "off"
|
||||||
type: action
|
|
||||||
subtype: "off"
|
|
||||||
id: press-off-z2m-e1743-e2201
|
id: press-off-z2m-e1743-e2201
|
||||||
- trigger: event
|
- trigger: event
|
||||||
event_type: zha_event
|
event_type: zha_event
|
||||||
event_data:
|
event_data:
|
||||||
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]
|
|
||||||
id: hold-on-zha-e1743-e2201
|
id: hold-on-zha-e1743-e2201
|
||||||
- trigger: device
|
- trigger: mqtt
|
||||||
domain: mqtt
|
topic: "+/+/action"
|
||||||
device_id: !input remote_device
|
payload: brightness_move_up
|
||||||
type: action
|
|
||||||
subtype: "brightness_move_up"
|
|
||||||
id: hold-on-z2m-e1743-e2201
|
id: hold-on-z2m-e1743-e2201
|
||||||
- trigger: event
|
- trigger: event
|
||||||
event_type: zha_event
|
event_type: zha_event
|
||||||
event_data:
|
event_data:
|
||||||
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]
|
|
||||||
id: hold-off-zha-e1743-e2201
|
id: hold-off-zha-e1743-e2201
|
||||||
- trigger: device
|
- trigger: mqtt
|
||||||
domain: mqtt
|
topic: "+/+/action"
|
||||||
device_id: !input remote_device
|
payload: brightness_move_down
|
||||||
type: action
|
|
||||||
subtype: "brightness_move_down"
|
|
||||||
id: hold-off-z2m-e1743-e2201
|
id: hold-off-z2m-e1743-e2201
|
||||||
- trigger: event
|
- trigger: event
|
||||||
event_type: zha_event
|
event_type: zha_event
|
||||||
event_data:
|
event_data:
|
||||||
device_id: !input remote_device
|
|
||||||
command: stop_with_on_off
|
|
||||||
endpoint_id: 1
|
endpoint_id: 1
|
||||||
cluster_id: 8
|
cluster_id: 8
|
||||||
id: release-zha-e1743-e2201
|
id: release-zha-e1743-e2201
|
||||||
- trigger: device
|
- trigger: mqtt
|
||||||
domain: mqtt
|
topic: "+/+/action"
|
||||||
device_id: !input remote_device
|
payload: brightness_stop
|
||||||
type: action
|
|
||||||
subtype: "brightness_stop"
|
|
||||||
id: release-z2m-e1743-e2201
|
id: release-z2m-e1743-e2201
|
||||||
|
|
||||||
# SOMRIG - E2213
|
# SOMRIG - E2213
|
||||||
- trigger: event
|
- trigger: event
|
||||||
event_type: zha_event
|
event_type: zha_event
|
||||||
event_data:
|
event_data:
|
||||||
device_id: !input remote_device
|
command: short_release
|
||||||
command: "short_release"
|
|
||||||
endpoint_id: 1
|
endpoint_id: 1
|
||||||
id: press-dots1-zha-e2213
|
id: press-dots1-zha-e2213
|
||||||
- trigger: device
|
- trigger: mqtt
|
||||||
domain: mqtt
|
topic: "+/+/action"
|
||||||
device_id: !input remote_device
|
payload: 1_short_release
|
||||||
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: !input remote_device
|
command: short_release
|
||||||
command: "short_release"
|
|
||||||
endpoint_id: 2
|
endpoint_id: 2
|
||||||
id: press-dots2-zha-e2213
|
id: press-dots2-zha-e2213
|
||||||
- trigger: device
|
- trigger: mqtt
|
||||||
domain: mqtt
|
topic: "+/+/action"
|
||||||
device_id: !input remote_device
|
payload: 2_short_release
|
||||||
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: !input remote_device
|
command: long_press
|
||||||
command: "multi_press_complete"
|
|
||||||
endpoint_id: 1
|
|
||||||
id: double-press-dots1-zha-e2213
|
|
||||||
- trigger: device
|
|
||||||
domain: mqtt
|
|
||||||
device_id: !input remote_device
|
|
||||||
type: action
|
|
||||||
subtype: "1_double_press"
|
|
||||||
id: double-press-dots1-z2m-e2213
|
|
||||||
- trigger: event
|
|
||||||
event_type: zha_event
|
|
||||||
event_data:
|
|
||||||
device_id: !input remote_device
|
|
||||||
command: "multi_press_complete"
|
|
||||||
endpoint_id: 2
|
|
||||||
id: double-press-dots2-zha-e2213
|
|
||||||
- trigger: device
|
|
||||||
domain: mqtt
|
|
||||||
device_id: !input remote_device
|
|
||||||
type: action
|
|
||||||
subtype: "2_double_press"
|
|
||||||
id: double-press-dots2-z2m-e2213
|
|
||||||
- trigger: event
|
|
||||||
event_type: zha_event
|
|
||||||
event_data:
|
|
||||||
device_id: !input remote_device
|
|
||||||
command: "long_press"
|
|
||||||
endpoint_id: 1
|
endpoint_id: 1
|
||||||
id: hold-dots1-zha-e2213
|
id: hold-dots1-zha-e2213
|
||||||
- trigger: device
|
- trigger: mqtt
|
||||||
domain: mqtt
|
topic: "+/+/action"
|
||||||
device_id: !input remote_device
|
payload: 1_long_press
|
||||||
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: !input remote_device
|
command: long_press
|
||||||
command: "long_press"
|
|
||||||
endpoint_id: 2
|
endpoint_id: 2
|
||||||
id: hold-dots2-zha-e2213
|
id: hold-dots2-zha-e2213
|
||||||
- trigger: device
|
- trigger: mqtt
|
||||||
domain: mqtt
|
topic: "+/+/action"
|
||||||
device_id: !input remote_device
|
payload: 2_long_press
|
||||||
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: !input remote_device
|
command: long_release
|
||||||
command: "long_release"
|
|
||||||
endpoint_id: 1
|
endpoint_id: 1
|
||||||
id: release-hold-dots1-zha-e2213
|
id: release-hold-dots1-zha-e2213
|
||||||
- trigger: device
|
- trigger: mqtt
|
||||||
domain: mqtt
|
topic: "+/+/action"
|
||||||
device_id: !input remote_device
|
payload: 1_long_release
|
||||||
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: !input remote_device
|
command: long_release
|
||||||
command: "long_release"
|
|
||||||
endpoint_id: 2
|
endpoint_id: 2
|
||||||
id: release-hold-dots2-zha-e2213
|
id: release-hold-dots2-zha-e2213
|
||||||
- trigger: device
|
- trigger: mqtt
|
||||||
domain: mqtt
|
topic: "+/+/action"
|
||||||
device_id: !input remote_device
|
payload: 2_long_release
|
||||||
type: action
|
|
||||||
subtype: "2_long_release"
|
|
||||||
id: release-hold-dots2-z2m-e2213
|
id: release-hold-dots2-z2m-e2213
|
||||||
actions:
|
variables:
|
||||||
- variables:
|
|
||||||
helper_force_brightness: !input helper_force_brightness
|
helper_force_brightness: !input helper_force_brightness
|
||||||
helper_hold_delay: 0.1
|
helper_hold_delay: 0.1
|
||||||
helper_hold_dim_step: 4
|
helper_hold_dim_step: 4
|
||||||
light: !input light
|
light: !input light
|
||||||
|
remote_devices: !input remote_devices
|
||||||
|
remote_device: >-
|
||||||
|
{% set is_zha = trigger.platform == "zha_event" %}
|
||||||
|
{% set is_mqtt = trigger.platform == "mqtt" %}
|
||||||
|
{% set device_name = trigger.topic.split("/")[1] if is_mqtt else none %}
|
||||||
|
{{
|
||||||
|
(trigger.event.data.device_id if is_zha) or
|
||||||
|
(device_id(trigger.topic.split("/")[1]) if is_mqtt and device_name)
|
||||||
|
}}
|
||||||
|
mqtt_topic: "{{ trigger.topic }}"
|
||||||
|
condition:
|
||||||
|
- condition: template
|
||||||
|
value_template: "{{ remote_device in remote_devices }}"
|
||||||
|
actions:
|
||||||
- choose:
|
- choose:
|
||||||
- conditions:
|
- conditions:
|
||||||
- condition: trigger
|
- condition: trigger
|
||||||
|
|||||||
Reference in New Issue
Block a user