This repository has been archived by the owner on Dec 5, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
gmusic_player.yaml
124 lines (107 loc) · 3 KB
/
gmusic_player.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
## Google Music Media Player
## Supplemental 'package.yaml' file for "gmusic_player"
input_select:
gmusic_player_source:
name: Source
icon: mdi:library-music
options:
- "Playlist"
- "Station"
gmusic_player_speakers:
name: Speakers
icon: mdi:speaker
options: ## Should be empty
- " "
gmusic_player_playlist:
name: Playlist
icon: mdi:playlist-music
options: ## Should be empty
- " "
gmusic_player_station:
name: Station
icon: mdi:playlist-music
options: ## Should be empty
- " "
script:
gmusic_sync_media:
alias: gmusic_player.sync_media
description: 'Update song list from Google Music'
sequence:
- event: gmusic_player.sync_media
gmusic_play_media:
alias: gmusic_player.play_media
description: 'Fire event: gmusic_play_media'
fields:
speakers:
description: Name of the speakers to play music on.
example: bedroom_stereo
source:
description: Media Source. Should be 'station' or 'playlist'
example: station
name:
description: Name of the station or playlist.
example: I'm Feeling Lucky
sequence:
- event: gmusic_player.play_media
event_data_template:
speakers: "{{ speakers }}"
source: "{{ source }}"
name: "{{ name }}"
shuffle: " {{ shuffle }}"
shuffle_mode: " {{ shuffle_mode }}"
## Sensor used for auto track advance.
sensor:
- platform: template
sensors:
gmusic_receiver:
value_template: "{{ states.media_player.gmusic_player.attributes._player_state }}"
automation old:
- alias: "gmusic_player_auto_advance"
initial_state: 'on'
trigger:
platform: state
entity_id: 'sensor.gmusic_receiver'
from: 'playing'
to: 'idle'
for:
seconds: 1
condition:
- condition: state
entity_id: 'media_player.gmusic_player'
state: 'playing'
action:
- service: media_player.media_next_track
entity_id: 'media_player.gmusic_player'
- alias: "gmusic_player_auto_play"
initial_state: 'on'
trigger:
platform: state
entity_id: 'media_player.gmusic_player'
from: 'off'
to: 'idle'
action:
- service: media_player.media_play
entity_id: 'media_player.gmusic_player'
homeassistant:
customize:
media_player.gmusic_player:
friendly_name: "Google Music Player"
sensor.gmusic_receiver:
friendly_name: "Google Music Receiver"
hidden: true
script.gmusic_sync_media:
friendly_name: "Sync Music"
icon: mdi:sync
script.gmusic_play_media:
hidden: true
## This group may only be visable when using the "states UI"
group:
google_music_media_player:
name: Google Music
entities:
- media_player.gmusic_player
- script.gmusic_sync_media
- input_select.gmusic_player_speakers
- input_select.gmusic_player_source
- input_select.gmusic_player_playlist
- input_select.gmusic_player_station