-
Notifications
You must be signed in to change notification settings - Fork 0
/
rwl021_001.yaml
77 lines (66 loc) · 2.19 KB
/
rwl021_001.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
blueprint:
name: Philips RWL021 Remote Control with MQTT
description: Control Philips Hue lights with the Philips RWL021 remote using MQTT.
domain: automation
source_url: https://github.com/keinfilter/rwl021_blueprints/blob/main/rwl021_001.yaml
input:
mqtt_topic:
name: MQTT Topic
description: "The MQTT topic to subscribe to for button presses."
selector:
text:
trigger:
platform: mqtt
topic: !input mqtt_topic
action:
- variables:
button_id: "{{ trigger.payload }}"
- choose:
- conditions:
- "{{ button_id == '1002' }}" # Button 1 (Short press)
sequence:
- service: light.toggle
target:
entity_id: light.YOUR_LIGHT_ENTITY_ID_HERE
- conditions:
- "{{ button_id == '2002' }}" # Button 2 (Short press)
sequence:
- service: light.toggle
target:
entity_id: light.YOUR_LIGHT_ENTITY_ID_HERE
- conditions:
- "{{ button_id == '3002' }}" # Button 3 (Short press)
sequence:
- service: light.toggle
target:
entity_id: light.YOUR_LIGHT_ENTITY_ID_HERE
- conditions:
- "{{ button_id == '4002' }}" # Button 4 (Short press)
sequence:
- service: light.toggle
target:
entity_id: light.YOUR_LIGHT_ENTITY_ID_HERE
- conditions:
- "{{ button_id == '1001' }}" # Button 1 (Long press)
sequence:
- service: light.toggle
target:
entity_id: light.YOUR_LIGHT_ENTITY_ID_HERE
- conditions:
- "{{ button_id == '2001' }}" # Button 2 (Long press)
sequence:
- service: light.toggle
target:
entity_id: light.YOUR_LIGHT_ENTITY_ID_HERE
- conditions:
- "{{ button_id == '3001' }}" # Button 3 (Long press)
sequence:
- service: light.toggle
target:
entity_id: light.YOUR_LIGHT_ENTITY_ID_HERE
- conditions:
- "{{ button_id == '4001' }}" # Button 4 (Long press)
sequence:
- service: light.toggle
target:
entity_id: light.YOUR_LIGHT_ENTITY_ID_HERE