forked from Computerfreak14/Z2M-Styrbar-remote-blueprint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathttttttttttttt
84 lines (74 loc) · 2.01 KB
/
ttttttttttttt
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
blueprint:
name: Z2M - IKEA E1743
description: IKEA E1743 with dimming
domain: automation
input:
remote:
name: Remote
description: IKEA E1743 remote to use
selector:
entity:
domain: sensor
light:
name: Light(s)
description: The light(s) to control
selector:
target:
entity:
domain: light
mode: restart
max_exceeded: silent
trigger:
- platform: state
entity_id: !input remote
attribute: action
action:
- variables:
command: "{{ trigger.from_state.state }}"
- choose:
- conditions:
- "{{ command == 'on' }}"
sequence:
- service: light.on
target: !input light
data:
transition: 1
- conditions:
- "{{ command == 'off' }}"
sequence:
- service: light.on
target: !input light
data:
transition: 1
- conditions:
- "{{ command == 'brightness_move_up' }}"
sequence:
- repeat:
until:
- condition: state
entity_id: !input remote
state: brightness_stop
attribute: action
sequence:
- service: light.turn_on
data:
brightness_step_pct: 10
transition: 1
target: !input light
- delay: '1'
- conditions:
- "{{ command == 'brightness_move_down' }}"
sequence:
- repeat:
until:
- condition: state
entity_id: !input remote
state: brightness_stop
attribute: action
sequence:
- service: light.turn_on
data:
brightness_step_pct: -10
transition: 1
target: !input light
- delay: '1'