Advertisement
denperss11

Spotify

Apr 12th, 2021 (edited)
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 2.63 KB | None | 0 0
  1. # Config file:
  2. spotcast:
  3.   sp_dc: !secret sp_dc
  4.   sp_key: !secret sp_key
  5.  
  6. # This is my lovelace card code:
  7. "type: 'custom:spotify-card'
  8. limit: 10
  9. spotify_entity: media_player.spotify_d
  10. playlist_type: default
  11. account: default
  12. grid_covers_per_row: 4
  13. display_style: list
  14. grid_show_title: true
  15. grid_center_covers: true"
  16.  
  17. # Scrip file
  18. spotify_music:
  19.  alias: Play selected spotify playlist
  20.  sequence:
  21.  - service: media_player.volume_set
  22.    data:
  23.      entity_id: media_player.spotify_d
  24.      volume_level: '0.4'
  25.  - service: media_player.select_source
  26.    data_template:
  27.      entity_id: media_player.spotify_d
  28.      source: '{% if is_state("input_select.spotify_source", "Køkken") %} media_player.googlehome298
  29.        {% elif is_state("input_select.spotify_source", "Kontor") %} media_player.kon
  30.        {% elif is_state("input_select.spotify_source", "Stuen") %} media_player.nesthub
  31.        {% elif is_state("input_select.spotify_source", "Bad") %} media_player.bad
  32.        {% elif is_state("input_select.spotify_source", "Garagen") %} media_player.stu
  33.        {% elif is_state("input_select.spotify_source", "Kælderen") %} media_player.kok
  34.        {% endif %}
  35.  
  36.        '
  37.  - service: media_player.play_media
  38.    data_template:
  39.      entity_id: media_player.spotify_d
  40.      media_content_type: playlist
  41.      media_content_id: '{% if is_state("input_select.spotify_playlist", "Gym
  42.         ") %} spotify:playlist:7FvCHKzqYNtNCNdZ83bFYm {% elif is_state("input_select.spotify_playlist",
  43.        "Bass") %} spotify:playlist:37i9dQZF1DX9Bom9R0tCgx {% elif is_state("input_select.spotify_playlist",
  44.        "Høj") %} spotify:playlist:37i9dQZF1DX5SrqpuffRKX {% elif is_state("input_select.spotify_playlist",
  45.        "Volbeat") %} spotify:playlist:37i9dQZF1DWYrXu9rm1zUZ  {% elif is_state("input_select.spotify_playlist",
  46.        "Ren") %} spotify:playlist:37i9dQZF1DX6IdqACeHRY7 {% elif is_state("input_select.spotify_playlist",
  47.        "Summer Road") %} spotify:playlist:37i9dQZF1DX0YBu6Mak936 {% elif is_state("input_select.spotify_playlist",
  48.        "Musik") %} spotify:playlist:37i9dQZF1DXa2rUkfKRm5c  {% elif
  49.        is_state("input_select.spotify_playlist", "Beach") %} spotify:playlist:37i9dQZF1DX4Y4RhrZqHhr
  50.        {% endif %}}
  51.  
  52.        '
  53.        
  54. # imput file
  55.  
  56.  spotify_playlist:
  57.    name: 'Playlist:'
  58.    options:
  59.      - Gym
  60.      - Bass
  61.      - Høj
  62.      - Volbeat
  63.      - Ren
  64.      - Summer Road
  65.      - Musik
  66.      - Beach
  67.    icon: mdi:spotify
  68.  spotify_source:
  69.    name: 'Source:'
  70.    options:
  71.      - Køkken
  72.      - Kontor
  73.      - Stuen
  74.      - Bad
  75.      - Garagen
  76.      - Kælderen
  77.    initial: Kontor
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement