-
Notifications
You must be signed in to change notification settings - Fork 0
/
Styrbar.yaml
141 lines (141 loc) · 3.92 KB
/
Styrbar.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
blueprint:
name: Ikea Styrbar Remote
description: Control your lights with the IKEA STYRBAR remote. You can also set
actions for the left and right button.
domain: automation
input:
remote:
name: Remote
description: IKEA Styrbar remote to use
selector:
device:
integration: zha
manufacturer: IKEA of Sweden
entity:
domain: sensor
target_light:
name: Lights
description: The lights you want to control with the remote
selector:
target:
entity:
domain: light
button_left:
name: Left button
description: Action to run on left button press short
default: []
selector:
action: {}
button_right:
name: Right button
description: Action to run on right button press short
default: []
selector:
action: {}
button_left_hold:
name: Left button hold
description: Action to run on left button press long,
action is stopped when button is released.
default: []
selector:
action: {}
button_right_hold:
name: Right button hold
description: Action to run on right button press long,
action is stopped when button is released.
default: []
selector:
action: {}
brightness:
name: Brightness
description: The brightness you want your lights to be when turning them on
default: 100
selector:
number:
min: 0.0
max: 100.0
mode: slider
step: 1.0
unit_of_measurement: '%'
force_brightness:
name: Force Brightness
description: Force the above set brightness when turning on the lamps?
default: false
selector:
boolean: {}
source_url: https://raw.githubusercontent.com/Computerfreak14/Z2M-Styrbar-remote-blueprint/experimental-ZHA/Z2M-IKEA-STYRBAR-remote.yaml
trigger:
- platform: event
event_type: zha_event
event_data:
device_id: !input 'remote'
action:
- variables:
command: '{{ trigger.event.data.command }}'
dataargs: '{{ trigger.event.data.args }}'
- choose:
- conditions: '{{ command == ''on'' }}'
sequence:
- choose:
- conditions: '{{ force_brightness }}'
sequence:
- service: light.turn_on
target: !input 'target_light'
data:
transition: 1
brightness_pct: !input 'brightness'
default:
- service: light.turn_on
target: !input 'target_light'
data:
transition: 1
- conditions: '{{ command == ''off'' }}'
sequence:
- service: light.turn_off
target: !input 'target_light'
- conditions: '{{ command == ''move'' }}'
sequence:
- repeat:
until: '{{ command == ''stop'' }}'
sequence:
- service: light.turn_on
data:
brightness_step_pct: -30
transition: 1
target: !input 'target_light'
- delay: '1'
- conditions: '{{ command == ''move_with_on_off'' }}'
sequence:
- repeat:
until: '{{ command == ''stop'' }}'
sequence:
- service: light.turn_on
data:
brightness_step_pct: 30
transition: 1
target: !input 'target_light'
- delay: '1'
- conditions:
- '{{ command == ''press'' }}'
- '{{ dataargs[0] == 257 }}'
sequence: !input 'button_left'
- conditions:
- '{{ command == ''press'' }}'
- '{{ dataargs[0] == 256 }}'
sequence: !input 'button_right'
- conditions:
- '{{ command == ''hold'' }}'
- '{{ dataargs[0] == 3329 }}'
sequence:
- repeat:
until: '{{ command == ''release'' }}'
sequence: !input 'button_left_hold'
- conditions:
- '{{ command == ''hold'' }}'
- '{{ dataargs[0] == 3328 }}'
sequence:
- repeat:
until: '{{ command == ''release'' }}'
sequence: !input 'button_right_hold'
mode: restart
max_exceeded: silent