-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlutron_pico_5_color.yaml
183 lines (171 loc) · 6 KB
/
lutron_pico_5_color.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
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
175
176
177
178
179
180
181
182
183
blueprint:
name: Lutron Pico 5 Button - Color Light Control
description: "This blueprint allows for the association of a Lutron Pico 5 Button (model PJ2-3BRL-GXX-X01) remote with a light entity. It is designed to simulate the operation of a standard Lutron Caseta wall dimmer including the press and hold functionality for the raise/lower buttons. It allows for the control over the brightness step percentage and transition speed and the assignment of any action to the middle button."
source_url: https://gist.github.com/cymone-smart/9814a750a0d0cfb196fa1fa7ae3630bb
domain: automation
input:
pico:
name: Pico Device
description: "Pico remote to associate with light entity."
selector:
device:
filter:
model: PJ2-3BRL-GXX-X01 (Pico3ButtonRaiseLower)
light_entity:
name: Light Entity(ies)
description: "Light entity to control."
selector:
entity:
filter:
domain: light
multiple: true
phase_entity:
name: Phase Entity
description: "Phase entity to store last phase."
selector:
entity:
filter:
domain: input_number
trigger:
- trigger: device
device_id: !input pico
domain: lutron_caseta
type: press
subtype: "on"
id: on_pressed
- trigger: device
device_id: !input pico
domain: lutron_caseta
type: press
subtype: "raise"
id: up_pressed
- trigger: device
device_id: !input pico
domain: lutron_caseta
type: release
subtype: "raise"
id: up_released
- trigger: device
device_id: !input pico
domain: lutron_caseta
type: press
subtype: "stop"
id: stop_pressed
- trigger: device
device_id: !input pico
domain: lutron_caseta
type: press
subtype: "lower"
id: down_pressed
- trigger: device
device_id: !input pico
domain: lutron_caseta
type: release
subtype: "lower"
id: down_released
- trigger: device
device_id: !input pico
domain: lutron_caseta
type: press
subtype: "off"
id: off_pressed
condition: []
action:
- choose:
- conditions:
- condition: trigger
id: on_pressed
sequence:
- action: light.turn_on
target:
entity_id: !input light_entity
data:
brightness_pct: 100
- conditions:
- condition: trigger
id: up_pressed
sequence:
- repeat:
sequence:
- action: light.turn_on
data:
brightness_step_pct: 20
target:
entity_id: !input light_entity
- delay:
milliseconds: 750
until:
- condition: state
entity_id: !input light_entity
attribute: brightness
state: "100"
- conditions:
- condition: trigger
id: up_released
sequence:
- delay:
milliseconds: 1
- conditions:
- condition: trigger
id: stop_pressed
sequence:
- variables:
phase_entity: !input phase_entity
phases:
0: { color_temp: 357 }
1: { color_temp: 250 }
2: { color_name: "red" }
3: { color_name: "magenta" }
4: { color_name: "blue" }
5: { color_name: "cyan" }
6: { color_name: "green" }
entity_test: !input light_entity
phase: >
{% set phase_value = states(phase_entity) | int(default=0) %}
{% set next_phase = phase_value + 1 %}
{{ 0 if next_phase not in phases else next_phase }}
- action: light.turn_on
target:
entity_id: !input light_entity
data: "{{ phases[phase] }}"
- action: input_number.set_value
target:
entity_id: !input phase_entity
data:
value: "{{ phase }}"
- delay:
milliseconds: 500
- conditions:
- condition: trigger
id: down_pressed
sequence:
- repeat:
sequence:
- action: light.turn_on
data:
brightness_step_pct: -20
target:
entity_id: !input light_entity
- delay:
milliseconds: 750
until:
- condition: numeric_state
entity_id: !input light_entity
attribute: brightness
below: 1
- conditions:
- condition: trigger
id: down_released
sequence:
- delay:
milliseconds: 1
- conditions:
- condition: trigger
id: off_pressed
sequence:
- action: light.turn_off
target:
entity_id: !input light_entity
mode: restart
max: 10
max_exceeded: silent