Play a random Spotify playlist on Squeezebox

Also - if you miss random responses from Alexa, you can use this technique.

alexa_confirm.yaml:

>
  {%- set responses = [
  "Whatever", 
  "No Problemo", 
  "Sure Thing",
  "Done",
  "Got it",
  "Allright"
  ] -%}
  {% set rindex =  (range(0, (responses | length - 1) )|random) -%}
  {{responses[rindex]}}

Lists in Jinja are zero-based, that’s why 1 is subtracted from the playlist length when picking a random index.

2 Likes