-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathZHA - Philips Hue Dimmer Switch.yaml
135 lines (126 loc) · 3.99 KB
/
ZHA - Philips Hue Dimmer Switch.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
blueprint:
name: ZHA - EVO - Philips Hue Dimmer Switch v1
description: 'Control lights with a Philips Hue Dimmer Switch.
The top "on" button will turn the lights on to the last set brightness
Double click "on" to force brightness to full
Dim up/down buttons will change the brightness smoothly and can be pressed
and hold until the brightness is satisfactory.
The bottom "off" button will turn the lights off.
'
source_url: https://github.com/evorgevol/hassio/blob/main/ZHA%20-%20Philips%20Hue%20Dimmer%20Switch.yaml
domain: automation
input:
remote:
name: Philips Hue Dimmer Switch
description: RWL021
selector:
device:
integration: zha
manufacturer: Philips
entity:
- domain:
- sensor
device_class:
- battery
multiple: false
light:
name: Light(s)
description: The light(s) to control
selector:
target:
entity:
- domain:
- light
mode: restart
max_exceeded: silent
variables:
button_on: 'on'
button_off: off_with_effect
light_input: !input light
input_entity_id: '{{ light_input.entity_id }}'
trigger:
- platform: event
event_type: zha_event
event_data:
device_id: !input remote
action:
- variables:
command: '{{ trigger.event.data.command }}'
cluster_id: '{{ trigger.event.data.cluster_id }}'
endpoint_id: '{{ trigger.event.data.endpoint_id }}'
is_turned_on: "{{ is_state(input_entity_id, 'on') }}"
- choose:
- conditions:
- '{{ command == button_on }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 1 }}'
sequence:
- choose:
- conditions: '{{ is_turned_on }}'
sequence:
- service: light.turn_on
target: !input 'light'
data:
transition: 1
brightness_pct: 100
default:
- service: light.turn_on
target: !input 'light'
data:
transition: 1
- conditions:
- '{{ command == button_off }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 1 }}'
- '{{ trigger.event.data.args == [0, 0] }}'
sequence:
- service: light.turn_off
target: !input light
data:
transition: 1
- conditions:
- "{{ command == 'step' }}"
- '{{ cluster_id == 8 }}'
- '{{ endpoint_id == 1 }}'
- '{{ trigger.event.data.params.step_mode == 1 }}'
- '{{ trigger.event.data.params.step_size == 30 }}'
sequence:
- service: light.turn_on
target: !input light
data:
brightness_step_pct: -10
transition: 1
- conditions:
- "{{ command == 'step' }}"
- '{{ cluster_id == 8 }}'
- '{{ endpoint_id == 1 }}'
- '{{ trigger.event.data.params.step_mode == 0 }}'
- '{{ trigger.event.data.params.step_size == 30 }}'
sequence:
- service: light.turn_on
target: !input light
data:
brightness_step_pct: 10
transition: 1
- conditions:
- "{{ command == 'step' }}"
- '{{ cluster_id == 8 }}'
- '{{ endpoint_id == 1 }}'
- '{{ trigger.event.data.args == [0, 56, 9] }}'
sequence:
- service: light.turn_on
target: !input light
data:
brightness_step_pct: 25
transition: 1
- conditions:
- "{{ command == 'step' }}"
- '{{ cluster_id == 8 }}'
- '{{ endpoint_id == 1 }}'
- '{{ trigger.event.data.args == [1, 56, 9] }}'
sequence:
- service: light.turn_on
target: !input light
data:
brightness_step_pct: -25
transition: 1