Skip to content

UI Scripts

Todd Lucas edited this page Jul 31, 2024 · 2 revisions

The following scripts have been created for various user requests, so I thought I would post them here in case anyone else finds them useful.

Index

Play First Context of Category Playlists

Gets the Spotify Jazz Category Playlists and plays the context returned from the first returned result.

Example
Change the following script details for your environment:

  • YOUR_SPOTIFYPLUS_ENTITY - your SpotifyPlus entity_id.
  • YOUR_DEVICE_NAME - your Spotify Connect device name.
alias: SpotifyPlus Play First Context of Category Playlists
description: >-
  Gets the Spotify Jazz Category Playlists and plays the context returned from
  the first returned result.
sequence:
  - service: spotifyplus.get_category_playlists
    data:
      entity_id: media_player.YOUR_SPOTIFYPLUS_ENTITY
      category_id: jazz
      limit: 1
    response_variable: search_result
  - service: spotifyplus.player_media_play_context
    data:
      entity_id: media_player.YOUR_SPOTIFYPLUS_ENTITY
      context_uri: "{{ search_result.result[\"items\"][0].uri }}"
      device_id: YOUR_DEVICE_NAME