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

Bluetooth device missing in source list #316

Closed
alandtse opened this issue Aug 30, 2019 · 14 comments · Fixed by #335
Closed

Bluetooth device missing in source list #316

alandtse opened this issue Aug 30, 2019 · 14 comments · Fixed by #335
Labels
bug Something isn't working

Comments

@alandtse
Copy link
Owner

Yep. Issue is fixed. Thanks for the fix.

There is one more thing about the bluetooth...it does not show in the source list.

image

yet, when I catch the state change in node-red and verify the json object, I can see the bluetooth as source...yet not in the source list.
image
can we fix this to?

Originally posted by @danielmihalache1983 in https://github.com/keatontaylor/alexa_media_player/issues/309#issuecomment-526648169

@alandtse
Copy link
Owner Author

@danielmihalache1983 please test the latest fix

@danielmihalache1983
Copy link

@alandtse I was wondering, is there a branch that I can checkout to my local instead of manually copy the files? alandtse:#316 is private I guess?

@alandtse
Copy link
Owner Author

It shouldn't be private. You can't access it?

@danielmihalache1983
Copy link

Source list still does not contains bluetooth device.
When I connect alexa to bluetooth and play somethiI I get some logs, maybe they help:

2019-08-31 22:34:14 DEBUG (MainThread) [alexapy.alexawebsocket] msg: WSMessage(type=<WSMsgType.BINARY: 2>, data=b'MSG 0x00000362 0x6c0c8ee6 f 0x00000001 0x7f087888 0x000002ae GWM MSG 0x0000b479 0x0000005c urn:tcomm-endpoint:service:serviceName:DeeWebsiteMessagingService:domain:prod:realm:USAmazon 0x00000081 urn:tcomm-endpoint:device:customerId:**************:deviceType:ALEGCNGL9K0HM:deviceSerialNumber:************** {"payload":"{\\"destinationUserId\\":\\"**************\\",\\"mediaReferenceId\\":\\"playq:audiobook/audible;mv=Audible,63017657-f8ee-4b7b-8dce-a1264a4014ea#10\\",\\"dopplerId\\":{\\"deviceSerialNumber\\":\\"**************\\",\\"deviceType\\":\\"A3S5BH2HU6VAYF\\"},\\"error\\":false,\\"audioPlayerState\\":\\"PLAYING\\",\\"errorMessage\\":null}","command":"PUSH_AUDIO_PLAYER_STATE"}FABE', extra='') 2019-08-31 22:34:14 DEBUG (MainThread) [alexapy.alexawebsocket] Received WebSocket MSG. 2019-08-31 22:34:14 DEBUG (MainThread) [alexapy.alexawebsocket] Received b'MSG 0x00000362 0x6c0c8ee6 f 0x00000001 0x7f087888 0x000002ae GWM MSG 0x0000b479 0x0000005c urn:tcomm-endpoint:service:serviceName:DeeWebsiteMessagingService:domain:prod:realm:USAmazon 0x00000081 urn:tcomm-endpoint:device:customerId:**************:deviceType:ALEGCNGL9K0HM:deviceSerialNumber:************** {"payload":"{\\"destinationUserId\\":\\"**************\\",\\"mediaReferenceId\\":\\"playq:audiobook/audible;mv=Audible,63017657-f8ee-4b7b-8dce-a1264a4014ea#10\\",\\"dopplerId\\":{\\"deviceSerialNumber\\":\\"**************\\",\\"deviceType\\":\\"A3S5BH2HU6VAYF\\"},\\"error\\":false,\\"audioPlayerState\\":\\"PLAYING\\",\\"errorMessage\\":null}","command":"PUSH_AUDIO_PLAYER_STATE"}FABE' 2019-08-31 22:34:14 DEBUG (MainThread) [alexapy.alexawebsocket] Received Standard MSG. 2019-08-31 22:34:14 DEBUG (MainThread) [custom_components.alexa_media] d*****************3@g*******m: Received websocket command: PUSH_AUDIO_PLAYER_STATE : {'destinationUserId': 'A**********LOV', 'mediaReferenceId': 'playq:audiobook/audible;mv=Audible,63017657-f8ee-4b7b-8dce-a1264a4014ea#10', 'dopplerId': {'deviceSerialNumber': 'G************J7J', 'deviceType': 'A3S5BH2HU6VAYF'}, 'error': False, 'audioPlayerState': 'PLAYING', 'errorMessage': None} 2019-08-31 22:34:14 DEBUG (MainThread) [custom_components.alexa_media] Updating media_player: {'destinationUserId': 'A**********LOV', 'mediaReferenceId': 'playq:audiobook/audible;mv=Audible,63017657-f8ee-4b7b-8dce-a1264a4014ea#10', 'dopplerId': {'deviceSerialNumber': 'G************J7J', 'deviceType': 'A3S5BH2HU6VAYF'}, 'error': False, 'audioPlayerState': 'PLAYING', 'errorMessage': None} 2019-08-31 22:34:14 DEBUG (MainThread) [custom_components.alexa_media.media_player] Daniel's Echo Dot state update: PLAYING 2019-08-31 22:34:14 DEBUG (MainThread) [custom_components.alexa_media.media_player] d*****************3@g*******m: Refreshing Daniel's Echo Dot 2019-08-31 22:34:14 DEBUG (MainThread) [custom_components.alexa_media.media_player] Daniel's Echo Dot: Last_called check: self: G************J7J reported: G************J7J 2019-08-31 22:34:15 DEBUG (MainThread) [custom_components.alexa_media] d*****************3@g*******m: Received websocket command: PUSH_BLUETOOTH_STATE_CHANGE : {'destinationUserId': 'A**********LOV', 'dopplerId': {'deviceSerialNumber': 'G************J7J', 'deviceType': 'A3S5BH2HU6VAYF'}, 'bluetoothEvent': 'DEVICE_DISCONNECTED', 'bluetoothEventPayload': None, 'bluetoothEventSuccess': True} 2019-08-31 22:34:15 DEBUG (MainThread) [custom_components.alexa_media] Updating media_player bluetooth {'destinationUserId': 'A**********LOV', 'dopplerId': {'deviceSerialNumber': 'G************J7J', 'deviceType': 'A3S5BH2HU6VAYF'}, 'bluetoothEvent': 'DEVICE_DISCONNECTED', 'bluetoothEventPayload': None, 'bluetoothEventSuccess': True} 2019-08-31 22:34:15 DEBUG (MainThread) [custom_components.alexa_media.media_player] Daniel's Echo Dot bluetooth_state update: {'deviceSerialNumber': 'G************J7J', 'deviceType': 'A3S5BH2HU6VAYF', 'friendlyName': None, 'gadgetPaired': False, 'online': True, 'pairedDeviceList': [{'address': '20:17:02:08:04:56', 'connected': False, 'deviceClass': 'OTHER', 'friendlyName': 'Ugreen-Bluetooth05', 'profiles': ['AVRCP', 'A2DP-SINK']}, {'address': '70:99:1C:3E:2F:2E', 'connected': False, 'deviceClass': 'OTHER', 'friendlyName': 'JBL GO 2', 'profiles': ['A2DP-SINK', 'AVRCP']}], 'sconeBattery': None, 'sconePaired': False, 'softwareVersion': '641575220', 'streamingState': None} 2019-08-31 22:34:15 DEBUG (MainThread) [alexapy.alexawebsocket] msg: WSMessage(type=<WSMsgType.BINARY: 2>, data=b'MSG 0x00000362 0x6c0c906f f 0x00000001 0xaf094359 0x000002ae GWM MSG 0x0000b479 0x0000005c urn:tcomm-endpoint:service:serviceName:DeeWebsiteMessagingService:domain:prod:realm:USAmazon 0x00000081 urn:tcomm-endpoint:device:customerId:**************:deviceType:ALEGCNGL9K0HM:deviceSerialNumber:************** {"payload":"{\\"destinationUserId\\":\\"**************\\",\\"mediaReferenceId\\":\\"playq:audiobook/audible;mv=Audible,63017657-f8ee-4b7b-8dce-a1264a4014ea#10\\",\\"dopplerId\\":{\\"deviceSerialNumber\\":\\"**************\\",\\"deviceType\\":\\"A3S5BH2HU6VAYF\\"},\\"error\\":false,\\"audioPlayerState\\":\\"PLAYING\\",\\"errorMessage\\":null}","command":"PUSH_AUDIO_PLAYER_STATE"}FABE', extra='')

@alandtse
Copy link
Owner Author

Are you able to select the device in the mobile app? We support a2dp-source devices. It's possible there may be other profiles we're missing so I want to confirm you can actually select it as a music source with the app.

@alandtse
Copy link
Owner Author

Also, to the extent the source lists the paired device as a source, that's actually a bug since we're not verifying it's a music source.

@danielmihalache1983
Copy link

Within the app, selecting one of the bluetooth sources will trigger the pairing process.
If the source is available (pairing) it will pair. After pairing, alexa speaks on the bluetooth device.
So this bluetooth as source, implies that there should be a pairing process...it could either be success or failure, depending on device availability.

@danielmihalache1983
Copy link

So as I see it, you should list in Source List every bluetooth device that alexa was previously paired, but necessarily connected to it.
Selecting that source, should trigger the bluetooth pair process which as I said it could either be success and new source stays selected, or it could fail and Local Speaker should be selected back

@danielmihalache1983
Copy link

Also, "Source" and "Source list" is not really the best name for something that is actually an output device. But I thought that this is just the best fit from media_player property list for this purpose

@alandtse alandtse added the bug Something isn't working label Aug 31, 2019
@alandtse
Copy link
Owner Author

Actually it's a source of the music that is playing for the media_player. That is an HA convention. We're not saying what is paired to the device. To be honest, the "local speaker" name is actually wrong, it should say something like "Amazon" so it's clear the source of any audio is from Amazon.

If you're looking for a bluetooth pairing option, that is something we could add as a feature, but the goal would be to match how HA does it for other devices to the extent possible. The Source list isn't the right way.

@danielmihalache1983
Copy link

Ok, I get your point and if you put it like that than the bluetooth device should never show on that source property whatsoever. As you say it should be a new feature.
My usecase was like so:
Whenever I say "Alexa play music",
I detect this event in HA,
I trigger my sound system bt pair,
Alexa pairs to sound system,
And music plays on my sound system

btw, if you fix this bug without adding the new feature, my usecase will break :)

@alandtse
Copy link
Owner Author

Haha, ok, let me spawn a new ticket for the feature and I promise I won't push this fix until the feature is up. ;)

Can you let me know if you find any other HA components that allow bluetooth pairing? I want to try to use the same mechanism. Please respond in the new thread.

@alandtse
Copy link
Owner Author

Just to clarify, all the fixes I'm proposing are for the UI and attributes; I am not putting any checks on the service so that will continue to work as planned.

@danielmihalache1983
Copy link

Yes, I kinda figured out from the comments on #322
Then I won`t have any problem, my usage will still work fine.

alandtse added a commit that referenced this issue Sep 3, 2019
fix(bluetooth): resolve bluetooth update issues
@alandtse alandtse mentioned this issue Sep 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants