-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
movie_time.yaml
164 lines (163 loc) · 4.66 KB
/
movie_time.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
# _ _ _ _ _ _
# | (_)_ _(_)_ _ __ _ _ _ ___ ___ _ __ ___ _ __ _____ _(_)___ | |_(_)_ __ ___
# | | \ V / | ' \/ _` | | '_/ _ \/ _ \ ' \ |___| | ' \/ _ \ V / / -_) | _| | ' \/ -_)
# |_|_|\_/|_|_||_\__, | |_| \___/\___/_|_|_| |_|_|_\___/\_/|_\___| \__|_|_|_|_\___|
# |___/
#--FROM https://github.com/smcnab1/op-question-mark
alias: Lighting Living Room Movie Time
description: >-
Automation automatically turn on movie scene when TV is turned on to certain
apps/channels.
trigger:
- platform: state
entity_id:
- media_player.living_room_tv
attribute: source
to: Disney+
id: "ON"
- platform: state
entity_id:
- media_player.living_room_tv
attribute: source
to: DVD Player
id: "ON"
- platform: state
entity_id:
- media_player.living_room_tv
attribute: source
to: Prime Video
id: "ON"
- platform: state
entity_id:
- media_player.living_room_tv
attribute: source
to: Paramount Plus
id: "ON"
- platform: state
entity_id:
- media_player.living_room_tv
attribute: source
to: Discovery+
id: "ON"
- platform: state
entity_id:
- media_player.living_room_tv
to: Netflix
id: "ON"
attribute: source
- platform: state
entity_id:
- media_player.living_room_tv
to: paused
id: pause
- platform: state
entity_id:
- media_player.living_room_tv
to: "off"
id: "off"
- platform: state
entity_id:
- media_player.living_room_tv
to: playing
id: playing
condition: []
action:
- choose:
- conditions:
- condition: or
conditions:
- condition: trigger
id: "ON"
sequence:
- service: scene.create
data:
scene_id: premovie
snapshot_entities:
- light.living_room_display_leds
- light.living_room_leds
- light.living_room_dreamview
- light.living_room_lava_lamp
- light.living_room_tv_leds
- light.living_room_main_light
- service: automation.trigger
data:
skip_condition: false
target:
entity_id: automation.lighting_living_room_movie
- conditions:
- condition: trigger
id: pause
sequence:
- service: light.turn_on
data:
transition: 15
rgb_color:
- 0
- 208
- 255
brightness: 70
target:
entity_id: light.living_room_leds
- conditions:
- condition: and
conditions:
- condition: trigger
id: playing
- condition: state
entity_id: media_player.living_room_tv
state: paused
sequence:
- service: automation.trigger
data:
skip_condition: false
target:
entity_id: automation.lighting_living_room_movie
- conditions:
- condition: trigger
id: "off"
sequence:
- service: scene.turn_on
data:
transition: 20
target:
entity_id: scene.premovie
- delay:
hours: 0
minutes: 3
seconds: 0
milliseconds: 0
- if:
- condition: state
entity_id: binary_sensor.living_room_motion
state: "off"
for:
hours: 0
minutes: 2
seconds: 0
then:
- service: automation.trigger
data:
skip_condition: false
target:
entity_id: automation.lighting_living_room_off
else:
- delay:
hours: 0
minutes: 3
seconds: 0
milliseconds: 0
- if:
- condition: state
entity_id: binary_sensor.living_room_motion
state: "off"
for:
hours: 0
minutes: 2
seconds: 0
then:
- service: automation.trigger
data:
skip_condition: false
target:
entity_id: automation.lighting_living_room_off
mode: single