Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to deactivate shuffle #510

Open
greggannicott opened this issue Jan 9, 2025 · 2 comments
Open

Unable to deactivate shuffle #510

greggannicott opened this issue Jan 9, 2025 · 2 comments
Assignees
Labels
enhancement New feature or request v5 Will be worked on in v5

Comments

@greggannicott
Copy link

greggannicott commented Jan 9, 2025

The problem

Hi.

I'm attempting to start a playlist with shuffle disabled.

From what I can tell, the shuffle property works when it is true (eg. if shuffle isn't on, and true is passed in, it sets shuffle to true in Spotify).

But when I pass in false it doesn't appear to have an impact (eg. if shuffle is on in Spotify, and I pass in false, it doesn't turn off shuffling).

I don't know if this is intentional, but it wasn't what I was expecting to happen.

System Health details

System Information

version core-2025.1.1
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.13.1
os_name Linux
os_version 6.6.66-haos
arch aarch64
timezone Europe/London
config_dir /config
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
HACS Data ok
GitHub API Calls Remaining 5000
Installed Version 2.0.2
Stage running
Available Repositories 1498
Downloaded Repositories 7
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 14.1
update_channel stable
supervisor_version supervisor-2024.12.3
agent_version 1.6.0
docker_version 27.2.0
disk_total 28.0 GB
disk_used 6.1 GB
healthy true
supported true
host_connectivity true
supervisor_connectivity true
ntp_synchronized true
virtualization
board green
supervisor_api ok
version_api ok
installed_addons Matter Server (7.0.0), Studio Code Server (5.18.0), Advanced SSH & Web Terminal (20.0.0), Get HACS (1.3.1)
Dashboards
dashboards 4
resources 3
views 2
mode storage
Recorder
oldest_recorder_run January 3, 2025 at 4:54 PM
current_recorder_run January 9, 2025 at 8:56 PM
estimated_db_size 13.95 MiB
database_engine sqlite
database_version 3.47.1
Spotify
api_endpoint_reachable ok

Spotcast Version

v4.0.0

What type of installation are you running?

Home Assistant OS

Diagnostics information

home-assistant_spotcast_2025-01-09T21-42-04.203Z.log

Example YAML snippet

sequence:
  - action: spotcast.start
    data:
      spotify_device_id: "{{device_id}}"
      uri: "{{playlist}}"
      random_song: "{{shuffle}}"
      shuffle: "{{shuffle}}"
fields:
  device_id:
    selector:
      select:
        options:
          - label: Office Stereo
            value: df12ae1c1cfbfdeca2bda732a16edcc3fc1e84ce
          - label: Office Echo
            value: 0f6a5b55-e195-46c7-a34e-662451f40aaa_amzn_1
          - label: Kitchen Echo
            value: 3414c699-b203-4e86-8310-7ab827c45135_amzn_1
          - label: Bedroom Echo
            value: 2f7053c3-147b-418d-acf5-d2e25796133f_amzn_1
          - label: Snug Echo
            value: f7267b64-c1b1-428a-a283-f716ae6314ba_amzn_1
    name: Device ID
    description: Which Spotify Connect player do you wish to play the playlist on?
    required: true
  playlist:
    selector:
      text: null
    name: Playlist
    description: Which playlist do you wish to play?
    required: true
  shuffle:
    selector:
      boolean: {}
    name: shuffle
    default: false
    required: true
description: ""
alias: "Spotify: Play Playlist on Specified Spotify Source (with Spotcast)"

Anything in the logs that might be useful for us?

At the end of the log there are two attempts to play a playlist.

The first has shuffle set to true, and you can see that it is turning shuffle on:

2025-01-09 21:41:21.288 DEBUG (SyncWorker_3) [custom_components.spotcast] Turning shuffle on

However the subsequent run has shuffle set to false and there is no mention of turning shuffle off. This is reflected in the end results.

Additional information

I've tried to simplify my script by not using fields and by hard coding false for the shuffle value, but I get the same results.

Also, just to say thanks for a great tool! I was struggling with HA and Spotify until I found this.

@greggannicott greggannicott added bug Something isn't working pending-triage The issue is awaiting a review from a maintainer labels Jan 9, 2025
@fcusson fcusson added enhancement New feature or request v5 Will be worked on in v5 and removed bug Something isn't working pending-triage The issue is awaiting a review from a maintainer labels Jan 9, 2025
@fcusson
Copy link
Collaborator

fcusson commented Jan 9, 2025

@greggannicott, I think that was the original intent, but either way, when working on the rewrite that is currently in beta I changed it to hard-setting shuffle to true or false when requested and keeping as is if not provided

@greggannicott
Copy link
Author

Fantastic, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request v5 Will be worked on in v5
Projects
None yet
Development

No branches or pull requests

2 participants