-
Notifications
You must be signed in to change notification settings - Fork 0
/
ikea_tradfri_remote.yml
174 lines (157 loc) · 4.91 KB
/
ikea_tradfri_remote.yml
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
blueprint:
name: IKEA five button remote for lights
description: |
Control lights with an IKEA five button remote (the round ones).
The middle "on" button, toggle the lights on/off to the last set brightness
(unless the force brightness is toggled on in the blueprint).
Dim up/down buttons will change the brightness smoothly and can be pressed
and hold until the brightness is satisfactory.
The "left" and "right" buttons can be assigned to a short and long button
press action. This allows you to assign, e.g., a scene or anything else.
This is a fork of @Frenck's blueprint for ZHA found here https://community.home-assistant.io/t/zha-ikea-five-button-remote-for-lights/253804
domain: automation
input:
remote:
name: Remote
description: IKEA remote to use
selector:
entity:
domain: state
light:
name: Light(s)
description: The light(s) to control
selector:
target:
entity:
domain: light
force_brightness:
name: Force turn on brightness
description: >
Force the brightness to the set level below, when the "on" button on
the remote is pushed and lights turn on.
default: false
selector:
boolean:
brightness:
name: Brightness
description: Brightness of the light(s) when turning on
default: 50
selector:
number:
min: 0
max: 100
mode: slider
step: 1
unit_of_measurement: "%"
button_left_short:
name: Left button - short press
description: Action to run on short left button press
default: []
selector:
action:
button_left_long:
name: Left button - long press
description: Action to run on long left button press
default: []
selector:
action:
button_right_short:
name: Right button - short press
description: Action to run on short right button press
default: []
selector:
action:
button_right_long:
name: Right button - long press
description: Action to run on long right button press
default: []
selector:
action:
mode: restart
max_exceeded: silent
variables:
force_brightness: !input force_brightness
trigger:
- platform: state
entity_id: !input remote
attribute: action
action:
- variables:
command: "{{ trigger.to_state.state }}"
- choose:
- conditions:
- "{{ command == 'toggle' }}"
sequence:
- choose:
- conditions: "{{ force_brightness }}"
sequence:
- service: light.toggle
target: !input light
data:
transition: 1
brightness_pct: !input brightness
default:
- service: light.toggle
target: !input light
data:
transition: 1
- conditions:
- "{{ command == 'brightness_up_click' }}"
sequence:
- service: light.turn_on
target: !input light
data:
brightness_step_pct: 10
transition: 1
- conditions:
- "{{ command == 'brightness_up_hold' }}"
sequence:
- repeat:
until:
- condition: state
entity_id: !input remote
state: brightness_up_release
attribute: action
sequence:
- service: light.turn_on
data:
brightness_step_pct: 10
transition: 1
target: !input light
- delay: '1'
- conditions:
- "{{ command == 'brightness_down_click' }}"
sequence:
- service: light.turn_on
target: !input light
data:
brightness_step_pct: -10
transition: 1
- conditions:
- "{{ command == 'brightness_down_hold' }}"
sequence:
- repeat:
until:
- condition: state
entity_id: !input remote
state: brightness_down_release
attribute: action
sequence:
- service: light.turn_on
data:
brightness_step_pct: -10
transition: 1
target: !input light
- delay: '1'
- conditions:
- "{{ command == 'arrow_left_click' }}"
sequence: !input button_left_short
- conditions:
- "{{ command == 'arrow_left_hold' }}"
sequence: !input button_left_long
- conditions:
- "{{ command == 'arrow_right_click' }}"
sequence: !input button_right_short
- conditions:
- "{{ command == 'arrow_right_hold' }}"
sequence: !input button_right_long