-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBedroomDialSwitchBlueprint.yml
121 lines (121 loc) · 3.73 KB
/
BedroomDialSwitchBlueprint.yml
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
blueprint:
name: Multi-Function Light Controller
description: Control one bedroom light and a group of living room lights with various actions.
domain: automation
input:
bedroom_light:
name: Bedroom Light
description: The light entity to control in the bedroom.
selector:
entity:
domain: light
living_room_lights:
name: Living Room Lights Group
description: The light group entity to control in the living room.
selector:
entity:
domain: light
controller:
name: Controller
description: The Zigbee2MQTT controller device.
selector:
device:
integration: mqtt
manufacturer: IKEA
model: E1744
trigger:
- platform: device
device_id: !input controller
type: action
subtype: button_1_single
- platform: device
device_id: !input controller
type: action
subtype: button_1_double
- platform: device
device_id: !input controller
type: action
subtype: button_4_double
- platform: device
device_id: !input controller
type: action
subtype: rotate_left
- platform: device
device_id: !input controller
type: action
subtype: rotate_right
action:
- variables:
bedroom_light: !input bedroom_light
living_room_lights: !input living_room_lights
- choose:
- conditions:
- condition: trigger
id: button_1_single
sequence:
- service: light.toggle
target:
entity_id: !input bedroom_light
- conditions:
- condition: trigger
id: rotate_left
sequence:
- service: light.turn_on
target:
entity_id: !input bedroom_light
data:
brightness_step_pct: -10
- conditions:
- condition: trigger
id: rotate_right
sequence:
- service: light.turn_on
target:
entity_id: !input bedroom_light
data:
brightness_step_pct: 10
- conditions:
- condition: trigger
id: button_1_double
sequence:
- wait_for_trigger:
platform: device
device_id: !input controller
type: action
subtype: rotate_left
timeout: 5
continue_on_timeout: false
- service: light.turn_on
target:
entity_id: !input bedroom_light
data:
kelvin: >
{% set current_kelvin = state_attr(bedroom_light, 'color_temp_kelvin') %}
{% set new_kelvin = (current_kelvin - 100) | max(2700) %}
{{ new_kelvin }}
- conditions:
- condition: trigger
id: button_1_double
sequence:
- wait_for_trigger:
platform: device
device_id: !input controller
type: action
subtype: rotate_right
timeout: 5
continue_on_timeout: false
- service: light.turn_on
target:
entity_id: !input bedroom_light
data:
kelvin: >
{% set current_kelvin = state_attr(bedroom_light, 'color_temp_kelvin') %}
{% set new_kelvin = (current_kelvin + 100) | min(6500) %}
{{ new_kelvin }}
- conditions:
- condition: trigger
id: button_4_double
sequence:
- service: light.toggle
target:
entity_id: !input living_room_lights