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

Shuffle in media play not working? #203

Closed
aimartin opened this issue Jun 4, 2019 · 9 comments · Fixed by #267
Closed

Shuffle in media play not working? #203

aimartin opened this issue Jun 4, 2019 · 9 comments · Fixed by #267
Labels
alexapy Issue relates to the API enhancement New feature or request good first issue Good for newcomers

Comments

@aimartin
Copy link

aimartin commented Jun 4, 2019

Hi!

I've been using alexa_media_player for quite some time and I'm really happy about how is working so far, however, I've been trying lately to use the media_play, with Spotify, and it worked, but if I try to enable shuffle mode, it doesn't work.

I've tried to use the service "media_player.shuffle_set" with the right entity_id, and passing "true", true, "True", True, 1, "1" and mane other combinations for the shuffle argument, and it doesn't work (spotify doesn't show shuffle enabled nor the following song is random if I execute a next song call)

Am I doing something wrong?

Regards

@alandtse
Copy link
Owner

It's not implemented yet.

@alandtse alandtse added alexapy Issue relates to the API enhancement New feature or request good first issue Good for newcomers labels Jun 13, 2019
@aimartin
Copy link
Author

That explains a lot :D.

Any idea about when will it be included in the roadmap? (no pressure obviously, just curious :))

Regards

@alandtse
Copy link
Owner

I don't think anyone has identified the exact command the Alexa app is using to enable shuffle. We're basically reverse engineering the API. Once that's done, we can see about implementing it.

@alandtse alandtse added the question Further information is requested label Jun 20, 2019
@alandtse
Copy link
Owner

alandtse commented Jun 20, 2019

Ok, I found the command to set it and a way to read it allow with repeating. Probably can add it in the next release. Will probably need to add the commands first and then sensors later.

Websocket

Shuffling state
Received websocket command: PUSH_MEDIA_QUEUE_CHANGE : {'trackOrderChanged': True, 'changeType': 'STATUS_CHANGED', 'destinationUserId': 'XXX', 'playBackOrder': 'NORMAL', 'loopMode': 'NORMAL', 'dopplerId': {'deviceSerialNumber': 'XXX', 'deviceType': 'XXX'}}
Received websocket command: PUSH_MEDIA_QUEUE_CHANGE : {'trackOrderChanged': True, 'changeType': 'STATUS_CHANGED', 'destinationUserId': 'XXX', 'playBackOrder': 'SHUFFLE_ALL', 'loopMode': 'NORMAL', 'dopplerId': {'deviceSerialNumber': 'XXX', 'deviceType': 'XXX'}}

Repeat state

Received websocket command: PUSH_MEDIA_QUEUE_CHANGE : {'trackOrderChanged': False, 'changeType': 'STATUS_CHANGED', 'destinationUserId': 'XXX', 'playBackOrder': 'SHUFFLE_ALL', 'loopMode': 'LOOP_QUEUE', 'dopplerId': {'deviceSerialNumber': 'XXX', 'deviceType': 'XXX'}}
Received websocket command: PUSH_MEDIA_QUEUE_CHANGE : {'trackOrderChanged': False, 'changeType': 'STATUS_CHANGED', 'destinationUserId': 'XXX', 'playBackOrder': 'SHUFFLE_ALL', 'loopMode': 'NORMAL', 'dopplerId': {'deviceSerialNumber': 'XXX', 'deviceType': 'XXX'}}
Endpoint

On

{"playerInfo":{
"transport":{"closedCaptions":null,"layoutType":"MusicTransportLayout","lyrics":"ENABLED","next":"ENABLED","playPause":"ENABLED","previous":"ENABLED","repeat":"SELECTED","shuffle":"SELECTED"},"upNextItems":null,"volume":{"muted":false,"volume":3}}}

Off

{"playerInfo":{
"transport":{"closedCaptions":null,"layoutType":"MusicTransportLayout","lyrics":"ENABLED","next":"ENABLED","playPause":"ENABLED","previous":"ENABLED","repeat":"ENABLED","shuffle":"ENABLED"},"upNextItems":null,"volume":{"muted":false,"volume":3}}}

@alandtse alandtse removed the question Further information is requested label Jun 20, 2019
@aimartin
Copy link
Author

Awesome!

Let me know if you need some help with testing or something.

Thanks a lot! :D

@alandtse
Copy link
Owner

Test version here (use shuffle_set service).

Or play with switches. I'm doing more work on what switches to expose.

You should probably update to 1.3.0 before trying any test builds.

@aimartin
Copy link
Author

aimartin commented Jul 1, 2019

Hey!

Thanks a lot for working on this and sorry, I wasn't able to test this before!

I've tested the shuffle branch version and I can confirm is working as expected :D. I'll keep this version for now and do more test with it, but so far, seems to be doing what is expected.

I'm not sure about the switches though, what should I try?

Thanks again!

@alandtse
Copy link
Owner

alandtse commented Jul 1, 2019

Thanks. Glad it works. For switches, I think I was just going to enable switches for everyone. I also added repeat and do not disturb and those make sense as switches too.

@aimartin
Copy link
Author

aimartin commented Jul 8, 2019

I've been using the shuffle branch for a while, and I've noticed that sometimes last_used Alexa is reported wrongly (is like the variable is not updated, and is always getting the same no matter what Alexa you're talking to). If I restart HomeAssistant, Alexa works again, but after 24h (I restarted yesterday evening, and I've tried today after arriving home) is failing again.

I didn't notice it until last Saturday though, and I was using the branch version since last Monday, so maybe is not related, but never noticed it before.

Will the shuffle enhancement be merged with master?

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alexapy Issue relates to the API enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants