-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlutron_pico_5_audio.yaml
185 lines (178 loc) · 6.42 KB
/
lutron_pico_5_audio.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
184
185
blueprint:
name: Lutron Pico 5 Button - Media Player Entity 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 media player entity."
selector:
device:
filter:
model: PJ2-3BRL-GXX-X01 (Pico3ButtonRaiseLower)
entity:
name: Light Entity(ies)
description: "Media Player entity to control."
selector:
entity:
filter:
domain: media_player
multiple: true
step:
name: Volume Step Percentage
description: "The percentage of volume to which the media player is changed when the RAISE/LOWER buttons are pressed and held."
selector:
number:
min: 1
max: 33
unit_of_measurement: percentage
default: 10
speed:
name: Volume Transition Speed
description: "The rate of speed in milliseconds at which the brightness of the light entity will be changed."
selector:
number:
min: 100
max: 2000
unit_of_measurement: milliseconds
default: 500
middle_button_action:
name: Middle (Favorite) Button Override
description: "Action(s) to execute when MIDDLE button is pressed. If left blank, action will default to setting the light entity to a brightness 80% and color temperature 2700."
selector:
action: {}
default:
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
variables:
step: !input step
speed: !input speed
middle_button_action: !input middle_button_action
condition: []
action:
- choose:
- conditions:
- condition: trigger
id: on_pressed
sequence:
- action: media_player.media_play_pause
data: {}
target:
entity_id: !input entity
- conditions:
- condition: trigger
id: up_pressed
sequence:
- repeat:
sequence:
- action: media_player.volume_up
data:
brightness_step_pct: !input step
transition: "{{ speed / 1000 }}"
target:
entity_id: !input entity
- delay:
milliseconds: !input speed
until:
- condition: state
entity_id: !input entity
attribute: brightness
state: "100"
- conditions:
- condition: trigger
id: up_released
sequence:
- delay:
milliseconds: 100
- conditions:
- condition: trigger
id: stop_pressed
sequence:
- choose:
- conditions: "{{ middle_button_action != none }}"
sequence: !input middle_button_action
default:
- action: light.turn_on
data:
transition: !input transition_on
brightness_pct: 80
kelvin: 2800
target:
entity_id: !input entity
- conditions:
- condition: trigger
id: down_pressed
sequence:
- repeat:
sequence:
- action: light.turn_on
data:
brightness_step_pct: "{{ step * -1 }}"
transition: "{{ speed / 1000 }}"
target:
entity_id: !input entity
- delay:
milliseconds: !input speed
until:
- condition: numeric_state
entity_id: !input entity
attribute: brightness
below: 1
- conditions:
- condition: trigger
id: down_released
sequence:
- delay:
milliseconds: 100
- conditions:
- condition: trigger
id: off_pressed
sequence:
- action: light.turn_off
data:
transition: !input transition_off
target:
entity_id: !input entity
mode: restart