-
Notifications
You must be signed in to change notification settings - Fork 0
/
Blueprint.yaml
210 lines (209 loc) · 5.73 KB
/
Blueprint.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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
blueprint:
name: Muller Licht Remote (Zigbee2MQTT)
domain: automation
input:
remote:
name: Remote mqtt topic
description: This must be the TOPIC from zigbee2mqtt. For example z2m/remote_1
selector:
text:
target_light_1:
name: Light 1
description: Lights to control for 1 (*--)
selector:
target:
entity:
domain: light
target_light_2:
name: Light 2
description: Lights to control for 2 (-*-)
selector:
target:
entity:
domain: light
target_light_3:
name: Light 3
description: Lights to control for 3 (--*)
selector:
target:
entity:
domain: light
step:
name: Dimming step in percent
default: 10
selector:
number:
min: 0.0
max: 50.0
mode: slider
step: 1.0
unit_of_measurement: "%"
scene_3:
name: Reading scene
selector:
target:
scene_1:
name: Sunset scene
selector:
target:
scene_2:
name: Party scene
selector:
target:
scene_6:
name: Night scene
selector:
target:
scene_4:
name: Fire scene
selector:
target:
scene_5:
name: Romantic scene
selector:
target:
trigger:
- platform: mqtt
topic: !input "remote"
condition: []
action:
- choose:
- conditions:
- condition: template
value_template: '{{ action_name=="on" }}'
sequence:
- service: light.turn_on
target: "{{ target_device }}"
- conditions:
- condition: template
value_template: '{{ action_name=="off" }}'
sequence:
- service: light.turn_off
target: "{{ target_device }}"
- conditions:
- condition: template
value_template: |-
{{
(action_name=="scene_1")
}}
sequence:
- service: homeassistant.turn_on
target: !input 'scene_1'
- conditions:
- condition: template
value_template: |-
{{
(action_name=="scene_2")
}}
sequence:
- service: homeassistant.turn_on
target: !input 'scene_2'
- conditions:
- condition: template
value_template: |-
{{
(action_name=="scene_3")
}}
sequence:
- service: homeassistant.turn_on
target: !input 'scene_3'
- conditions:
- condition: template
value_template: |-
{{
(action_name=="scene_4")
}}
sequence:
- service: homeassistant.turn_on
target: !input 'scene_4'
- conditions:
- condition: template
value_template: |-
{{
(action_name=="scene_5")
}}
sequence:
- service: homeassistant.turn_on
target: !input 'scene_5'
- conditions:
- condition: template
value_template: |-
{{
(action_name=="scene_6")
}}
sequence:
- service: homeassistant.turn_on
target: !input 'scene_6'
- conditions:
- condition: template
value_template: |-
{{
(action_name=="color_temperature_move")
}}
sequence:
- service: light.turn_on
target: "{{ target_device }}"
data_template:
color_temp: "{{ action_color_temp }}"
- conditions:
- condition: template
value_template: |-
{{
(action_name=="brightness_step_down")
}}
sequence:
- service: light.turn_on
target: "{{ target_device }}"
data_template:
brightness_step_pct: "{{ negative_step }}"
transition: 1
- conditions:
- condition: template
value_template: |-
{{
(action_name=="brightness_step_up")
}}
sequence:
- service: light.turn_on
target: "{{ target_device }}"
data_template:
brightness_step_pct: "{{ step }}"
transition: 1
- conditions:
- condition: template
value_template: |-
{{
(action_name=="color_move")
}}
sequence:
- service: light.turn_on
target: "{{ target_device }}"
data_template:
xy_color:
- "{{trigger.payload_json.action_color.x}}"
- "{{trigger.payload_json.action_color.y}}"
default:
- service: logbook.log
data:
name: Oops
message: Unhandled remote action "{{ action_name }}" --- "{{ action_color_temp }}" --- "{{ action_color }}"
mode: single
variables:
step: !input "step"
negative_step: "{{ -1 * (step | int) }}"
action_color_temp: '{{ trigger.payload_json.action_color_temperature }}'
action_color: '{{ trigger.payload_json.action_color }}'
action_name: '{{ trigger.payload_json.action }}'
target_light_1: !input 'target_light_1'
target_light_2: !input 'target_light_2'
target_light_3: !input 'target_light_3'
target_device: |-
{%- if trigger.payload_json.action_group==16388 -%}
{{ target_light_1 }}
{%- elif trigger.payload_json.action_group==16389 -%}
{{ target_light_2 }}
{%- elif trigger.payload_json.action_group==16390 -%}
{{ target_light_3 }}
{%- else -%}
unknown
{%- endif -%}