1
0

Add second music provider

This commit is contained in:
Przemek Grondek 2023-04-25 17:53:20 +02:00
parent 8b08b246ee
commit e83254b36c
3 changed files with 36 additions and 16 deletions

View File

@ -40,12 +40,7 @@
entity_id: media_player.bathroom entity_id: media_player.bathroom
data: data:
shuffle: true shuffle: true
- service: media_player.play_media - service: script.bathroom_music_play
target:
entity_id: media_player.bathroom
data:
media_content_id: "{{ states('input_text.bathroom_playlist') }}"
media_content_type: music
- id: bathroom-music-button-play - id: bathroom-music-button-play
alias: '[Bathroom] Music button - play' alias: '[Bathroom] Music button - play'
@ -68,16 +63,7 @@
entity_id: media_player.bathroom entity_id: media_player.bathroom
state: playing state: playing
action: action:
- service: media_player.shuffle_set - service: script.bathroom_music_play
entity_id: media_player.bathroom
data:
shuffle: true
- service: media_player.play_media
target:
entity_id: media_player.bathroom
data:
media_content_id: "{{ states('input_text.bathroom_playlist') }}"
media_content_type: music
- id: bathroom-music-button-pause - id: bathroom-music-button-pause
alias: '[Bathroom] Music button - play/pause' alias: '[Bathroom] Music button - play/pause'

View File

@ -101,6 +101,11 @@ input_select:
- Party - Party
- Away - Away
icon: "mdi:home" icon: "mdi:home"
music_service:
name: Music service
options:
- Spotify
- Apple Music
input_text: input_text:
bathroom_playlist: bathroom_playlist:
name: Bathroom playlist name: Bathroom playlist

View File

@ -0,0 +1,29 @@
bathroom_music_play:
alias: '[Bathroom] Music play'
sequence:
- choose:
- conditions:
- condition: state
entity_id: input_select.music_service
state: 'Apple Music'
sequence:
- service: media_player.select_source
data:
source: Party 2.1
target:
entity_id: media_player.bathroom
- conditions:
- condition: state
entity_id: light.hallway_light
state: 'Spotify'
sequence:
- service: media_player.play_media
target:
entity_id: media_player.bathroom
data:
media_content_id: "{{ states('input_text.bathroom_playlist') }}"
media_content_type: music
- service: media_player.shuffle_set
entity_id: media_player.bathroom
data:
shuffle: true