Play Custom Context

July 12, 2026 ยท View on GitHub

Starts a Spotify playback with a context of custom Spotify URIs.

Action

action: spotcast.play_custom_context
data:
    media_player:
        entity_id: media_player.foo
    tracks:
        - spotify:track:2GfQhXyoUXYTkMHDXJhCU5
        - spotify:track:6z7lKrdW3hwtv9hXH5YK3l
        - spotify:track:55mJleti2WfWEFNFcBduhc
    account: 01JDG07KSBTYWZGJSBJ1EW6XEF
    data:
        repeat: context

media_player (dict)

Optional

Let the user select a compatible device on which to start the playback. Must be a single device. A Chromecast speaker group (for example a Google Cast group) is a valid target and counts as a single device.

tracks (list[str])

Required

A list of Spotify URI or URL used to build a custom context for playback. The list of songs will be used as if it was an album or playlist. Songs added to queue still take precedent on next item in context.

account (str)

Optional

The entry_id of the account to use for Spotcast. If empty, the default Spotcast account is used.

data (dict)

Optional

Set of additional settings to apply when starting the playback. The available options are:

Optiontypedefaultdescription
positionpositive_float0.000The position to start playback (in seconds) of where to start the playback of the first item in the context
offsetpositive_int0The item in the context to start the playback at. The position is zero based and cannot be negative. Is ignored in the case of a track URI.
volumeint, range 0-100nullThe percentage (as an integer of the percentage value) to start plaback at. Volume is kept unchanged if null
repeattrack | context | offnullThe repeat mode is kept the same if null
shuffleboolnullSets the playback to shuffle if True. Is kept unchanged if null.
randomboolFalseSets the start songs to a random one in the custom context