-
Notifications
You must be signed in to change notification settings - Fork 3
/
scripts.yaml
146 lines (126 loc) · 3.2 KB
/
scripts.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
#############################
# Lighting Modes for Morgan #
#############################
princess:
alias: Princess Lighting
sequence:
service: input_select.select_option
data:
entity_id: input_select.morgan_lamp_mode
option: Princess
rainbow:
alias: Rainbow Lighting
sequence:
service: input_select.select_option
data:
entity_id: input_select.morgan_lamp_mode
option: Rainbow
jungle:
alias: Jungle Lighting
sequence:
service: input_select.select_option
data:
entity_id: input_select.morgan_lamp_mode
option: Jungle
ocean:
alias: Ocean Lighting
sequence:
service: input_select.select_option
data:
entity_id: input_select.morgan_lamp_mode
option: Ocean
halloween:
alias: Halloween Lighting
sequence:
service: input_select.select_option
data:
entity_id: input_select.morgan_lamp_mode
option: Halloween
christmas:
alias: Christmas Lighting
sequence:
service: input_select.select_option
data:
entity_id: input_select.morgan_lamp_mode
option: Christmas
chiefs:
alias: Chiefs Lighting
sequence:
service: input_select.select_option
data:
entity_id: input_select.morgan_lamp_mode
option: Red
standard:
alias: Standard Lighting
sequence:
service: input_select.select_option
data:
entity_id: input_select.morgan_lamp_mode
option: Standard
focus:
alias: Focus Lighting
sequence:
service: input_select.select_option
data:
entity_id: input_select.morgan_lamp_mode
option: Focus
##############
# Chromecast #
##############
cc_skip:
sequence:
- condition: template
value_template: "{{ state_attr(entity_id, 'media_position') != None }}"
- service: media_player.media_seek
data_template:
entity_id: "{{ entity_id }}"
seek_position: >
{% set pos = state_attr(entity_id, 'media_position') %}
{% set elapsed = now().timestamp() - state_attr(entity_id, 'media_position_updated_at').timestamp() %}
{% set newpos = pos + seconds + (elapsed if is_state(entity_id, "playing") else 0) %}
{{ (newpos, 0)|max }}
##################
# Basement Media #
##################
media_mute:
sequence:
- service: media_player.volume_mute
data_template:
entity_id: "{{ entity_id }}"
is_volume_muted: "{{ not state_attr(entity_id, 'is_volume_muted') }}"
xbox_play_pause:
sequence:
- service_template: >
{% if states.media_player.xbox_one.state == "paused" %}
media_player.media_play
{% else %}
media_player.media_pause
{% endif %}
entity_id: media_player.xbox_one
xbox_stop:
sequence:
service: remote.send_command
data:
entity_id: remote.harmony_hub
device: Microsoft Xbox One
command: Stop
#Expose Xbox to Google Home
xbox_on:
sequence:
service: remote.turn_on
data:
entity_id: remote.harmony_hub
activity: "Play Xbox One"
alias: Xbox
################
# Check Config #
################
check_config:
sequence: []
alias: Check Configuration
###################
# GLEDOPTO On/Off #
###################
gledopto_on_off:
sequence: []
alias: Gledopto On/Off