Need some help with a bash script

Running Hassio

Trying to get this going : Play a random Spotify playlist on Squeezebox

my config:

bash script:
curl -X GET
-H “Content-Type: application/json”
-d ‘{“id”:1,“method”:“slim.request”,“params”:[“cc:cc:05:67:e5:c1”,[“playlist”,“shuffle”,1]]}’
http://192.168.0.83:9000/jsonrpc.js

shell command and script:

shell_command:
  squeeze_shuffle_songs: bash /usr/share/hassio/homeassistant/config/scripts/squeeze_shuffle_songs.sh

script:
  randomsqueeze:
    alias: Play random playlist on Squeeze
    sequence:
        #a bash script that turns on shuffle-by-song
      - service: shell_command.squeeze_shuffle_songs
      - service: media_player.play_media
        data: 
          #change this to match your player
          entity_id: media_player.radio2
          media_content_type: PLAYLIST
        data_template:
           #add as many playlist or album IDs as you like
           media_content_id: >
            {{ ["spotify:user:netflixmusic:playlist:2X6z5kU0wMnKoar8i1RN6B", "spotify:user:ernestcline:playlist:5h6SYfQvJYAnr9S8Al4yOn", "spotify:user:stereogum:playlist:4VHDDPpx9BLScz0hMlFPqr"] | random}}  

i get this error from the log:
error running command: bash /usr/share/hassio/homeassistant/config/scripts/squeeze_shuffle_songs.sh, return code: 127

What is wrong??

thx

Return code 127 means ‘command not found’
[Here] are a few tips about bash scripts.

The post you’re looking at predates the media_player.squeezebox_call_method service. I’d use that rather than a bash script now that it’s available. I’m not sure what the exact syntax would be, but the call to shuffle by song would be something like

    - service:  media_player.squeezebox_call_method                                                                                             
      data_template:                                                                                                                            
        entity_id: media_player.radio2                                                                    
        command: playlist                                                                                                                       
        parameters: ["shuffle","1"]

not sure if you quote that “1” in the parameters.

thx:-) working :slight_smile: