alandtse / alexa_media_player

This is a custom component to allow control of Amazon Alexa devices in Home Assistant using the unofficial Alexa API.
Apache License 2.0
1.53k stars 290 forks source link

Announcement stopped working on third party devices: Sonos Speakers, ecobee4, Bose #285

Closed mikkelke closed 4 years ago

mikkelke commented 5 years ago

Describe the bug Announce doesn't work, while TTS does. Until Sunday announce worked perfect on my Alexa enabled Sonos speakers (Sonos One and Beam). If i use the Aleaxa app to do the annoncement it works perfect. In the FAQ is mentioned to check that "Communications" is enabled and it is on all my speakers. But i noties that if I click on "Communications" the Alexa app get stuck loading the page. It is one of my favorite features and I use it as my doorbell annoncement.

To Reproduce Steps to reproduce the behavior:

  1. Send announce to Sonos Alexa enabled speaker.
  2. Northing happens

Expected behavior Play announced message on every speaker taget.

System details

krissen commented 5 years ago

Having the same issue.

As suggested in a comment on the seemingly related albeit closed, issue 200, moving from type: announce to type: tts at least gets Alexa to say something. I'm currently using it as a workaround...

mikkelke commented 5 years ago

My issue with accessing the "Communications" setting is fixed now after i spoke to Amazon support. My account where reset and moved from UK to US. We removed all devices and I setup everything. Still only the TTS mode works and not the annoncement.

Having the same issue.

As suggested in a comment on the seemingly related albeit closed, issue 200, moving from type: announce to type: tts at least gets Alexa to say something. I'm currently using it as a workaround...

In you reply on the link issue you mentioned the upgrade from 1.3.* to 1.4.1. On Sunday when Annoncement stopped working I where on version 1.2.2 or 1.2.3, and therefore i decieded to upgrade to 1.4.1. It still did not work, i found the FAQ and it said to go check "Communications" that then where enabled but i could not access it. I can access "Communications" and annoncement works from the Alexa app. What Alexa devices are you using?

alandtse commented 5 years ago

Does announce work on any non Sonos speakers? We haven't touched the announce code for a while.

alandtse commented 5 years ago

For us to debug we will need the alexapy debug logs. Please provide for announce and tts.

krissen commented 5 years ago

I have a Sonos and an Echo Dot. Announce worked on both prior to upgrading to 1.4.1. Works on neither afterwards.

Wonder if it could be related to migration to HACS rather than the upgrade to 1.4.1?

I’ll be away for a couple of days. Will provide logs once I’ve returned!

mikkelke commented 5 years ago

For us to debug we will need the alexapy debug logs. Please provide for announce and tts.

Running in docker where do I get the logs? I enabled: logger: default: critical logs: custom_components.alexa_media: debug
alexapy: debug

I have a Sonos and an Echo Dot. Announce worked on both prior to upgrading to 1.4.1. Works on neither afterwards.

Wonder if it could be related to migration to HACS rather than the upgrade to 1.4.1?

I’ll be away for a couple of days. Will provide logs once I’ve returned!

Good to hear its not only a Sonos problem. Upgrading from 1.2.* to 1.4.1 I changed to use HACS.

krissen commented 5 years ago

Back at home, enabled debug, and was running the exact same service calls as I did prior (indeed, it was cached and ready to go), but "unfortunately" it ran as it should. Ie. no errors. So no logs to send, I'm afraid.

Could it have been some caching error or the like, perhaps related to migrating to HACS? Either fixed by some amount of time having gone by, or X amount of reboots...

mikkelke commented 5 years ago

Mine still dosen't work. Tell me what to provide. Is it like this: 2019-08-15 17:25:02 DEBUG (SyncWorker_9) [custom_components.alexa_media.media_player] Mikkel's Sonos Beam is last_called: 8****6d5 2019-08-15 17:25:21 DEBUG (Thread-5) [alexapy.alexawebsocket] Got Pong MSG from Server 2019-08-15 17:28:21 DEBUG (Thread-5) [alexapy.alexawebsocket] Got Pong MSG from Server 2019-08-15 17:31:21 DEBUG (Thread-5) [alexapy.alexawebsocket] Got Pong MSG from Server 2019-08-15 17:34:21 DEBUG (Thread-5) [alexapy.alexawebsocket] Got Pong MSG from Server 2019-08-15 17:35:48 DEBUG (Thread-5) [alexapy.alexawebsocket] Received WebSocket MSG. 2019-08-15 17:35:48 DEBUG (Thread-5) [alexapy.alexawebsocket] Received b'MSG 0x00000362 0x7896ee63 f 0x00000001 0xc14c2e59 0x00000241 GWM MSG 0x0000b479 0x0000005c urn:tcomm-endpoint:service:serviceName:DeeWebsiteMessagingService:domain:prod:realm:USAmazon 0x00000081 urn:tcomm-endpoint:device:customerId:A1VLQF1TDI6MEL:deviceType:ALEGCNGL9K0HM:deviceSerialNumber:134-4642686-3180638-1565878758000 {"payload":"{\"destinationUserId\":\"A1VLQF1TDI6MEL\",\"dopplerId\":{\"deviceSerialNumber\":\"c54b64b91ef94ea6a9f2f13d79bf8404\",\"deviceType\":\"A2OSP3UA4VC85F\"},\"dopplerConnectionState\":\"OFFLINE\"}","command":"PUSH_DOPPLER_CONNECTION_CHANGE"}FABE' 2019-08-15 17:35:48 DEBUG (Thread-5) [alexapy.alexawebsocket] Received Standard MSG.

alandtse commented 5 years ago

@krissen HACS shouldn't have any impact. Sometimes it could be an Amazon connectivity issue and we have seen issues where multiple commands to the same Echo may result in some being ignored.

@mikkelke Can you try to do an announce and a tts and show the logs from when it issues those commands?

mikkelke commented 5 years ago

@krissen HACS shouldn't have any impact. Sometimes it could be an Amazon connectivity issue and we have seen issues where multiple commands to the same Echo may result in some being ignored.

@mikkelke Can you try to do an announce and a tts and show the logs from when it issues those commands?

Announce: ``` 2019-08-15 22:25:59 DEBUG (SyncWorker_30) [custom_components.alexa_media.notify] Message: Someone is at the door, kwargs: {'target': ['media_player.living_room_alexa'], 'data': {'type': 'announce', 'method': 'speak'}} 2019-08-15 22:25:59 DEBUG (SyncWorker_30) [custom_components.alexa_media.notify] Testing item: media_player.living_room_alexa against (, Mikkel's Sonos One, c****************************404, media_player.bathroom_alexa) 2019-08-15 22:25:59 DEBUG (SyncWorker_30) [custom_components.alexa_media.notify] Testing item: media_player.living_room_alexa against (, Bathroom, 5****************************1af, media_player.bathroom_2) 2019-08-15 22:25:59 DEBUG (SyncWorker_30) [custom_components.alexa_media.notify] Testing item: media_player.living_room_alexa against (, Dining Room, 0****************************083, media_player.dining_room_2) 2019-08-15 22:25:59 DEBUG (SyncWorker_30) [custom_components.alexa_media.notify] Testing item: media_player.living_room_alexa against (, Living Room, 3****************************e5f, media_player.living_room_2) 2019-08-15 22:25:59 DEBUG (SyncWorker_30) [custom_components.alexa_media.notify] Testing item: media_player.living_room_alexa against (, Bedroom, 9****************************f42, media_player.bedroom_2) 2019-08-15 22:25:59 DEBUG (SyncWorker_30) [custom_components.alexa_media.notify] Testing item: media_player.living_room_alexa against (, Kitchen, 7****************************5d9, media_player.kitchen_2) 2019-08-15 22:25:59 DEBUG (SyncWorker_30) [custom_components.alexa_media.notify] Testing item: media_player.living_room_alexa against (, Mikkel's 2nd Sonos One, a****************************82d, media_player.bedroom_alexa) 2019-08-15 22:25:59 DEBUG (SyncWorker_30) [custom_components.alexa_media.notify] Testing item: media_player.living_room_alexa against (, Mikkel's 3rd Sonos One, e****************************d07, media_player.dining_room_left_alexa) 2019-08-15 22:25:59 DEBUG (SyncWorker_30) [custom_components.alexa_media.notify] Testing item: media_player.living_room_alexa against (, Mikkel's 4th Sonos One, d****************************792, media_player.dining_room_right_alexa) 2019-08-15 22:25:59 DEBUG (SyncWorker_30) [custom_components.alexa_media.notify] Testing item: media_player.living_room_alexa against (, Mikkel's 5th Sonos One, 8****************************adf, media_player.kitchen_alexa) 2019-08-15 22:25:59 DEBUG (SyncWorker_30) [custom_components.alexa_media.notify] Testing item: media_player.living_room_alexa against (, Mikkel's Sonos Beam, 8****************************6d5, media_player.living_room_alexa) 2019-08-15 22:25:59 DEBUG (SyncWorker_30) [custom_components.alexa_media.notify] Converting: media_player.living_room_alexa to (entities): 2019-08-15 22:25:59 DEBUG (SyncWorker_30) [custom_components.alexa_media.notify] Testing item: media_player.living_room_alexa against (, This Device, 6****************************5df, media_player.this_device_2) 2019-08-15 22:25:59 DEBUG (SyncWorker_30) [custom_components.alexa_media.notify] Testing item: against (, Mikkel's Sonos One, c****************************404, media_player.bathroom_alexa) 2019-08-15 22:25:59 DEBUG (SyncWorker_30) [custom_components.alexa_media.notify] Testing item: against (, Bathroom, 5****************************1af, media_player.bathroom_2) 2019-08-15 22:25:59 DEBUG (SyncWorker_30) [custom_components.alexa_media.notify] Testing item: against (, Dining Room, 0****************************083, media_player.dining_room_2) 2019-08-15 22:25:59 DEBUG (SyncWorker_30) [custom_components.alexa_media.notify] Testing item: against (, Living Room, 3****************************e5f, media_player.living_room_2) 2019-08-15 22:25:59 DEBUG (SyncWorker_30) [custom_components.alexa_media.notify] Testing item: against (, Bedroom, 9****************************f42, media_player.bedroom_2) 2019-08-15 22:25:59 DEBUG (SyncWorker_30) [custom_components.alexa_media.notify] Testing item: against (, Kitchen, 7****************************5d9, media_player.kitchen_2) 2019-08-15 22:25:59 DEBUG (SyncWorker_30) [custom_components.alexa_media.notify] Testing item: against (, Mikkel's 2nd Sonos One, a****************************82d, media_player.bedroom_alexa) 2019-08-15 22:25:59 DEBUG (SyncWorker_30) [custom_components.alexa_media.notify] Testing item: against (, Mikkel's 3rd Sonos One, e****************************d07, media_player.dining_room_left_alexa) 2019-08-15 22:25:59 DEBUG (SyncWorker_30) [custom_components.alexa_media.notify] Testing item: against (, Mikkel's 4th Sonos One, d****************************792, media_player.dining_room_right_alexa) 2019-08-15 22:25:59 DEBUG (SyncWorker_30) [custom_components.alexa_media.notify] Testing item: against (, Mikkel's 5th Sonos One, 8****************************adf, media_player.kitchen_alexa) 2019-08-15 22:25:59 DEBUG (SyncWorker_30) [custom_components.alexa_media.notify] Testing item: against (, Mikkel's Sonos Beam, 8****************************6d5, media_player.living_room_alexa) 2019-08-15 22:25:59 DEBUG (SyncWorker_30) [custom_components.alexa_media.notify] Converting: to (serialnumbers): 8ef4bb9e261e40ceaa10cf76ffb796d5 2019-08-15 22:25:59 DEBUG (SyncWorker_30) [custom_components.alexa_media.notify] Testing item: against (, This Device, 6****************************5df, media_player.this_device_2) 2019-08-15 22:25:59 DEBUG (SyncWorker_30) [custom_components.alexa_media.notify] Announce targets: ['8****************************6d5'] entities: [] 2019-08-15 22:25:59 DEBUG (SyncWorker_30) [custom_components.alexa_media.notify] m******e@gmail.com: Announce by to targets: ['8****************************6d5']: Someone is at the door 2019-08-15 22:25:59 DEBUG (SyncWorker_30) [alexapy.alexaapi] Running sequence: AlexaAnnouncement data: {"behaviorId": "PREVIEW", "sequenceJson": "{\"@type\": \"com.amazon.alexa.behaviors.model.Sequence\", \"startNode\": {\"@type\": \"com.amazon.alexa.behaviors.model.OpaquePayloadOperationNode\", \"type\": \"AlexaAnnouncement\", \"operationPayload\": {\"deviceType\": \"A3NPD82ABCPIDP\", \"deviceSerialNumber\": \"8ef4bb9e261e40ceaa10cf76ffb796d5\", \"locale\": \"en-us\", \"customerId\": \"A1VLQF1TDI6MEL\", \"expireAfter\": \"PT5S\", \"content\": [{\"locale\": \"en-us\", \"display\": {\"title\": \"\", \"body\": \"\"}, \"speak\": {\"type\": \"text\", \"value\": \"Someone is at the door\"}}], \"target\": {\"customerId\": \"A1VLQF1TDI6MEL\", \"devices\": [{\"deviceSerialNumber\": \"8ef4bb9e261e40ceaa10cf76ffb796d5\", \"deviceTypeId\": \"A3NPD82ABCPIDP\"}]}}}}", "status": "ENABLED"} 2019-08-15 22:26:16 DEBUG (Thread-5) [alexapy.alexawebsocket] Received WebSocket MSG. 2019-08-15 22:26:16 DEBUG (Thread-5) [alexapy.alexawebsocket] Received b'MSG 0x00000362 0x78d9d423 f 0x00000001 0x2233aea3 0x00000235 GWM MSG 0x0000b479 0x0000005c urn:tcomm-endpoint:service:serviceName:DeeWebsiteMessagingService:domain:prod:realm:USAmazon 0x00000081 urn:tcomm-endpoint:device:customerId:A1VLQF1TDI6MEL:deviceType:ALEGCNGL9K0HM:deviceSerialNumber:134-4642686-3180638-1565878758000 {"payload":"{\\"destinationUserId\\":\\"A1VLQF1TDI6MEL\\",\\"dopplerId\\":{\\"deviceSerialNumber\\":\\"8ef4bb9e261e40ceaa10cf76ffb796d5\\",\\"deviceType\\":\\"A3NPD82ABCPIDP\\"},\\"isMuted\\":false,\\"volumeSetting\\":10}","command":"PUSH_VOLUME_CHANGE"}FABE' 2019-08-15 22:26:16 DEBUG (Thread-5) [alexapy.alexawebsocket] Received Standard MSG. 2019-08-15 22:26:16 DEBUG (Thread-5) [custom_components.alexa_media] m******e@gmail.com: Received websocket command: PUSH_VOLUME_CHANGE : {'destinationUserId': 'A1VLQF1TDI6MEL', 'dopplerId': {'deviceSerialNumber': '8ef4bb9e261e40ceaa10cf76ffb796d5', 'deviceType': 'A3NPD82ABCPIDP'}, 'isMuted': False, 'volumeSetting': 10} 2019-08-15 22:26:16 DEBUG (Thread-5) [custom_components.alexa_media] Updating media_player volume: {'destinationUserId': 'A1VLQF1TDI6MEL', 'dopplerId': {'deviceSerialNumber': '8ef4bb9e261e40ceaa10cf76ffb796d5', 'deviceType': 'A3NPD82ABCPIDP'}, 'isMuted': False, 'volumeSetting': 10} 2019-08-15 22:26:16 DEBUG (SyncWorker_37) [custom_components.alexa_media.media_player] Mikkel's Sonos Beam volume updated: 10 ```
TTS: ``` 2019-08-15 22:27:32 DEBUG (SyncWorker_10) [custom_components.alexa_media.notify] Message: Someone is at the door, kwargs: {'target': ['media_player.living_room_alexa'], 'data': {'type': 'tts', 'method': 'speak'}} 2019-08-15 22:27:32 DEBUG (SyncWorker_10) [custom_components.alexa_media.notify] Testing item: media_player.living_room_alexa against (, Mikkel's Sonos One, c****************************404, media_player.bathroom_alexa) 2019-08-15 22:27:32 DEBUG (SyncWorker_10) [custom_components.alexa_media.notify] Testing item: media_player.living_room_alexa against (, Bathroom, 5****************************1af, media_player.bathroom_2) 2019-08-15 22:27:32 DEBUG (SyncWorker_10) [custom_components.alexa_media.notify] Testing item: media_player.living_room_alexa against (, Dining Room, 0****************************083, media_player.dining_room_2) 2019-08-15 22:27:32 DEBUG (SyncWorker_10) [custom_components.alexa_media.notify] Testing item: media_player.living_room_alexa against (, Living Room, 3****************************e5f, media_player.living_room_2) 2019-08-15 22:27:32 DEBUG (SyncWorker_10) [custom_components.alexa_media.notify] Testing item: media_player.living_room_alexa against (, Bedroom, 9****************************f42, media_player.bedroom_2) 2019-08-15 22:27:32 DEBUG (SyncWorker_10) [custom_components.alexa_media.notify] Testing item: media_player.living_room_alexa against (, Kitchen, 7****************************5d9, media_player.kitchen_2) 2019-08-15 22:27:32 DEBUG (SyncWorker_10) [custom_components.alexa_media.notify] Testing item: media_player.living_room_alexa against (, Mikkel's 2nd Sonos One, a****************************82d, media_player.bedroom_alexa) 2019-08-15 22:27:32 DEBUG (SyncWorker_10) [custom_components.alexa_media.notify] Testing item: media_player.living_room_alexa against (, Mikkel's 3rd Sonos One, e****************************d07, media_player.dining_room_left_alexa) 2019-08-15 22:27:32 DEBUG (SyncWorker_10) [custom_components.alexa_media.notify] Testing item: media_player.living_room_alexa against (, Mikkel's 4th Sonos One, d****************************792, media_player.dining_room_right_alexa) 2019-08-15 22:27:32 DEBUG (SyncWorker_10) [custom_components.alexa_media.notify] Testing item: media_player.living_room_alexa against (, Mikkel's 5th Sonos One, 8****************************adf, media_player.kitchen_alexa) 2019-08-15 22:27:32 DEBUG (SyncWorker_10) [custom_components.alexa_media.notify] Testing item: media_player.living_room_alexa against (, Mikkel's Sonos Beam, 8****************************6d5, media_player.living_room_alexa) 2019-08-15 22:27:32 DEBUG (SyncWorker_10) [custom_components.alexa_media.notify] Converting: media_player.living_room_alexa to (entities): 2019-08-15 22:27:32 DEBUG (SyncWorker_10) [custom_components.alexa_media.notify] Testing item: media_player.living_room_alexa against (, This Device, 6****************************5df, media_player.this_device_2) 2019-08-15 22:27:32 DEBUG (SyncWorker_10) [custom_components.alexa_media.notify] Testing item: against (, Mikkel's Sonos One, c****************************404, media_player.bathroom_alexa) 2019-08-15 22:27:32 DEBUG (SyncWorker_10) [custom_components.alexa_media.notify] Testing item: against (, Bathroom, 5****************************1af, media_player.bathroom_2) 2019-08-15 22:27:32 DEBUG (SyncWorker_10) [custom_components.alexa_media.notify] Testing item: against (, Dining Room, 0****************************083, media_player.dining_room_2) 2019-08-15 22:27:32 DEBUG (SyncWorker_10) [custom_components.alexa_media.notify] Testing item: against (, Living Room, 3****************************e5f, media_player.living_room_2) 2019-08-15 22:27:32 DEBUG (SyncWorker_10) [custom_components.alexa_media.notify] Testing item: against (, Bedroom, 9****************************f42, media_player.bedroom_2) 2019-08-15 22:27:32 DEBUG (SyncWorker_10) [custom_components.alexa_media.notify] Testing item: against (, Kitchen, 7****************************5d9, media_player.kitchen_2) 2019-08-15 22:27:32 DEBUG (SyncWorker_10) [custom_components.alexa_media.notify] Testing item: against (, Mikkel's 2nd Sonos One, a****************************82d, media_player.bedroom_alexa) 2019-08-15 22:27:32 DEBUG (SyncWorker_10) [custom_components.alexa_media.notify] Testing item: against (, Mikkel's 3rd Sonos One, e****************************d07, media_player.dining_room_left_alexa) 2019-08-15 22:27:32 DEBUG (SyncWorker_10) [custom_components.alexa_media.notify] Testing item: against (, Mikkel's 4th Sonos One, d****************************792, media_player.dining_room_right_alexa) 2019-08-15 22:27:32 DEBUG (SyncWorker_10) [custom_components.alexa_media.notify] Testing item: against (, Mikkel's 5th Sonos One, 8****************************adf, media_player.kitchen_alexa) 2019-08-15 22:27:32 DEBUG (SyncWorker_10) [custom_components.alexa_media.notify] Testing item: against (, Mikkel's Sonos Beam, 8****************************6d5, media_player.living_room_alexa) 2019-08-15 22:27:32 DEBUG (SyncWorker_10) [custom_components.alexa_media.notify] Converting: to (entities): 2019-08-15 22:27:32 DEBUG (SyncWorker_10) [custom_components.alexa_media.notify] Testing item: against (, This Device, 6****************************5df, media_player.this_device_2) 2019-08-15 22:27:32 DEBUG (SyncWorker_10) [custom_components.alexa_media.notify] TTS entities: [] 2019-08-15 22:27:32 DEBUG (SyncWorker_10) [custom_components.alexa_media.notify] TTS by : Someone is at the door 2019-08-15 22:27:32 DEBUG (SyncWorker_10) [alexapy.alexaapi] Running sequence: Alexa.Speak data: {"behaviorId": "PREVIEW", "sequenceJson": "{\"@type\": \"com.amazon.alexa.behaviors.model.Sequence\", \"startNode\": {\"@type\": \"com.amazon.alexa.behaviors.model.OpaquePayloadOperationNode\", \"type\": \"Alexa.Speak\", \"operationPayload\": {\"deviceType\": \"A3NPD82ABCPIDP\", \"deviceSerialNumber\": \"8ef4bb9e261e40ceaa10cf76ffb796d5\", \"locale\": \"en-us\", \"customerId\": \"A1VLQF1TDI6MEL\", \"textToSpeak\": \"Someone is at the door\"}}}", "status": "ENABLED"} 2019-08-15 22:27:33 DEBUG (Thread-5) [alexapy.alexawebsocket] Received WebSocket MSG. 2019-08-15 22:27:33 DEBUG (Thread-5) [alexapy.alexawebsocket] Received b'MSG 0x00000362 0x78da2131 f 0x00000001 0x776726fa 0x00000237 GWM MSG 0x0000b479 0x0000005c urn:tcomm-endpoint:service:serviceName:DeeWebsiteMessagingService:domain:prod:realm:USAmazon 0x00000081 urn:tcomm-endpoint:device:customerId:A1VLQF1TDI6MEL:deviceType:ALEGCNGL9K0HM:deviceSerialNumber:134-4642686-3180638-1565878758000 {"payload":"{\\"destinationUserId\\":\\"A1VLQF1TDI6MEL\\",\\"key\\":{\\"entryId\\":\\"1565900852982#A3NPD82ABCPIDP#8ef4bb9e261e40ceaa10cf76ffb796d5\\",\\"registeredUserId\\":\\"A1VLQF1TDI6MEL\\"},\\"timestamp\\":1565900853478}","command":"PUSH_ACTIVITY"}FABE' 2019-08-15 22:27:33 DEBUG (Thread-5) [alexapy.alexawebsocket] Received Standard MSG. 2019-08-15 22:27:33 DEBUG (Thread-5) [custom_components.alexa_media] m******e@gmail.com: Received websocket command: PUSH_ACTIVITY : {'destinationUserId': 'A1VLQF1TDI6MEL', 'key': {'entryId': '1565900852982#A3NPD82ABCPIDP#8ef4bb9e261e40ceaa10cf76ffb796d5', 'registeredUserId': 'A1VLQF1TDI6MEL'}, 'timestamp': 1565900853478} 2019-08-15 22:27:33 DEBUG (Thread-5) [custom_components.alexa_media] m******e@gmail.com: Updated last_called: {'serialNumber': '8****************************6d5', 'timestamp': 1565900853478} 2019-08-15 22:27:33 DEBUG (Thread-5) [custom_components.alexa_media] m******e@gmail.com: last_called changed: {'serialNumber': '8****************************6d5', 'timestamp': 1565898571982} to {'serialNumber': '8****************************6d5', 'timestamp': 1565900853478} 2019-08-15 22:27:33 DEBUG (SyncWorker_43) [custom_components.alexa_media.media_player] Mikkel's Sonos Beam is last_called: 8****************************6d5 2019-08-15 22:27:33 DEBUG (Thread-5) [alexapy.alexawebsocket] Received WebSocket MSG. 2019-08-15 22:27:33 DEBUG (Thread-5) [alexapy.alexawebsocket] Received b'MSG 0x00000362 0x78da2131 f 0x00000001 0x776726fa 0x00000237 GWM MSG 0x0000b479 0x0000005c urn:tcomm-endpoint:service:serviceName:DeeWebsiteMessagingService:domain:prod:realm:USAmazon 0x00000081 urn:tcomm-endpoint:device:customerId:A1VLQF1TDI6MEL:deviceType:ALEGCNGL9K0HM:deviceSerialNumber:134-4642686-3180638-1565878758000 {"payload":"{\\"destinationUserId\\":\\"A1VLQF1TDI6MEL\\",\\"key\\":{\\"entryId\\":\\"1565900852982#A3NPD82ABCPIDP#8ef4bb9e261e40ceaa10cf76ffb796d5\\",\\"registeredUserId\\":\\"A1VLQF1TDI6MEL\\"},\\"timestamp\\":1565900853478}","command":"PUSH_ACTIVITY"}FABE' 2019-08-15 22:27:33 DEBUG (Thread-5) [alexapy.alexawebsocket] Received Standard MSG. 2019-08-15 22:27:33 DEBUG (Thread-5) [custom_components.alexa_media] m******e@gmail.com: Received websocket command: PUSH_ACTIVITY : {'destinationUserId': 'A1VLQF1TDI6MEL', 'key': {'entryId': '1565900852982#A3NPD82ABCPIDP#8ef4bb9e261e40ceaa10cf76ffb796d5', 'registeredUserId': 'A1VLQF1TDI6MEL'}, 'timestamp': 1565900853478} 2019-08-15 22:27:33 DEBUG (Thread-5) [custom_components.alexa_media] m******e@gmail.com: Updated last_called: {'serialNumber': '8****************************6d5', 'timestamp': 1565900853478} 2019-08-15 22:27:33 DEBUG (Thread-5) [custom_components.alexa_media] m******e@gmail.com: last_called changed: {'serialNumber': '8****************************6d5', 'timestamp': 1565898571982} to {'serialNumber': '8****************************6d5', 'timestamp': 1565900853478} 2019-08-15 22:27:33 DEBUG (SyncWorker_43) [custom_components.alexa_media.media_player] Mikkel's Sonos Beam is last_called: 8****************************6d5 ```

EDIT: Proper quoting

alandtse commented 5 years ago

@mikkelke Ok, I'm not seeing anything wrong with the data. Can you try renaming the pickle file and relogging in and seeing if that helps?

The next thing may be to craft an announcement by itself without the subsequent volume change. This is so we can make sure it's not because the Sonos is dropping a command because it's getting hit by more than one.

If that doesn't work, there may be something special about the way the Sonos packet has to be configured. I'd need you to create a routine with announce targeting your Sonos in the app, and then pull the sequence data. Basically you'd follow the instructions here, and then stop at step 7 and provide the entire operationPayload portion to compare to what we're sending.

mikkelke commented 5 years ago

@alandtse Thanks for your help. I made this rutine and when I play it from the app or say "Test this" northing happens, I think I must contact Amazon again (Annonce works when i go into "Communicate" and "Annonce":

  {
    "@type": "com.amazon.alexa.behaviors.model.Automation",
    "automationId": "amzn1.alexa.automation.55ad9f56-555b-4b2b-83ae-c28425f58b3a",
    "name": null,
    "triggers": [
      {
        "payload": {
          "customerId": "A1VLQF1TDI6MEL",
          "utterance": "test this",
          "locale": "en-DK",
          "marketplaceId": "ATVPDKIKX0DER"
        },
        "id": "amzn1.alexa.trigger.791afa5c-6778-4c2b-8446-597fc0d92c98",
        "type": "CustomUtterance",
        "timeLapse": null
      }
    ],
    "sequence": {
      "@type": "com.amazon.alexa.behaviors.model.Sequence",
      "sequenceId": "amzn1.alexa.sequence.a3e04491-2cf5-43d0-844a-70d65f0d04c5",
      "startNode": {
        "@type": "com.amazon.alexa.behaviors.model.OpaquePayloadOperationNode",
        "type": "AlexaAnnouncement",
        "skillId": "amzn1.ask.1p.messaging",
        "operationPayload": {
          "expireAfter": "PT5S",
          "content": [
            {
              "locale": "en-DK",
              "display": {
                "title": "Alexa Routines",
                "body": "Someone is at the door"
              },
              "speak": {
                "type": "text",
                "value": "Someone is at the door"
              }
            }
          ],
          "customerId": "A1VLQF1TDI6MEL",
          "target": {
            "customerId": "A1VLQF1TDI6MEL"
          }
        },
        "name": null
      }
    },
    "owner": null,
    "clientAlias": null,
    "condition": null,
    "status": "ENABLED",
    "creationTimeEpochMillis": 1565936035434,
    "lastUpdatedTimeEpochMillis": 1565936117095
  }
]
alandtse commented 5 years ago

Ok I agree, I think if you can't get the Alexa App to get it to work, then there's something happening in your setup. I noticed that the locale is being populated as en-DK, which I believe is English in Denmark? This is the first time I saw that locale and I don't know if Announce is supposed to work for there. Amazon support may know better.

mikkelke commented 5 years ago

The issue started before i changed locale. When I started using the Alexa Media Player, my Alexa account where on amazon.com, I got the impression that I could get faster responds time (lower latency) if I change my locale. I contacted Amazon and they change it to Germany. All skils text where now written in German, so I made them change it to UK and that have been working for more then half a year. When i contacted Amazon I contacted Amazon they gave me this link: https://www.amazon.com/mycd and this time I put in my correct address and region where changed to Denmark. When I logged in on Alexa I could see that I was back on alexa.amazon.com aka the US servers.

krissen commented 5 years ago

I will also continue to troubleshoot this, as I noticed this morning that the Echo dot indeed announced as it should in my morning routine, having switched back from ‘type: tts’ to ‘type: announce’, but the Sonos did not. (Prior to 1.4.1 and HACS, both announced. With ‘type: tts’, both tts:ed.) So +1 that it might be something Sonos-specific.

I’ll get back with logs and whatnot within a day, I hope.

krissen commented 5 years ago

Announcement through the Alexa app works here; announces on Sonos as well as the Echo dot.

krissen commented 5 years ago

Testing with the following data, for service notify.alexa_media_MYSONOSDEVICE: { "message": "test", "data": { "type": "announce", "method": "speak" } }

Debug lines for Sonos, announce (does not work):

2019-08-16 22:18:22 DEBUG (SyncWorker_1) [custom_components.alexa_media.notify] Message: test, kwargs: {'target': ['REDACTED'], 'data': {'type': 'announce', 'method': 'speak'}}
2019-08-16 22:18:22 DEBUG (SyncWorker_1) [custom_components.alexa_media.notify] Testing item: REDACTED against (<Entity Vardagsrum: standby>, Vardagsrum, a****************************0cc, media_player.vardagsrum_2)
2019-08-16 22:18:22 DEBUG (SyncWorker_1) [custom_components.alexa_media.notify] Testing item: REDACTED against (<Entity Sonos One: standby>, Sonos One, 2****************************2f8, media_player.sonos_one_2)
2019-08-16 22:18:22 DEBUG (SyncWorker_1) [custom_components.alexa_media.notify] Converting: REDACTED to (entities): <Entity Sonos One: standby>
2019-08-16 22:18:22 DEBUG (SyncWorker_1) [custom_components.alexa_media.notify] Testing item: REDACTED against (<Entity Pricken: paused>, Pricken, G************XT5, media_player.pricken)
2019-08-16 22:18:22 DEBUG (SyncWorker_1) [custom_components.alexa_media.notify] Testing item: REDACTED against (<Entity This Device: standby>, This Device, B****************************C74, media_player.this_device_4)
2019-08-16 22:18:22 DEBUG (SyncWorker_1) [custom_components.alexa_media.notify] Testing item: REDACTED against (<Entity Kristian's Alexa Apps: standby>, Kristian's Alexa Apps, 6****************************8B5, media_player.kristian_s_alexa_apps)
2019-08-16 22:18:22 DEBUG (SyncWorker_1) [custom_components.alexa_media.notify] Testing item: REDACTED against (<Entity This Device: standby>, This Device, 1****************************03d, media_player.this_device_3)
2019-08-16 22:18:22 DEBUG (SyncWorker_1) [custom_components.alexa_media.notify] Testing item: <Entity Sonos One: standby> against (<Entity Vardagsrum: standby>, Vardagsrum, a****************************0cc, media_player.vardagsrum_2)
2019-08-16 22:18:22 DEBUG (SyncWorker_1) [custom_components.alexa_media.notify] Testing item: <Entity Sonos One: standby> against (<Entity Sonos One: standby>, Sonos One, 2****************************2f8, media_player.sonos_one_2)
2019-08-16 22:18:22 DEBUG (SyncWorker_1) [custom_components.alexa_media.notify] Converting: <Entity Sonos One: standby> to (serialnumbers): REDACTED
2019-08-16 22:18:22 DEBUG (SyncWorker_1) [custom_components.alexa_media.notify] Testing item: <Entity Sonos One: standby> against (<Entity Pricken: paused>, Pricken, G************XT5, media_player.pricken)
2019-08-16 22:18:22 DEBUG (SyncWorker_1) [custom_components.alexa_media.notify] Testing item: <Entity Sonos One: standby> against (<Entity This Device: standby>, This Device, B****************************C74, media_player.this_device_4)
2019-08-16 22:18:22 DEBUG (SyncWorker_1) [custom_components.alexa_media.notify] Testing item: <Entity Sonos One: standby> against (<Entity Kristian's Alexa Apps: standby>, Kristian's Alexa Apps, 6****************************8B5, media_player.kristian_s_alexa_apps)
2019-08-16 22:18:22 DEBUG (SyncWorker_1) [custom_components.alexa_media.notify] Testing item: <Entity Sonos One: standby> against (<Entity This Device: standby>, This Device, 1****************************03d, media_player.this_device_3)
2019-08-16 22:18:22 DEBUG (SyncWorker_1) [custom_components.alexa_media.notify] Announce targets: ['2****************************2f8'] entities: [<Entity Sonos One: standby>]
2019-08-16 22:18:22 DEBUG (SyncWorker_1) [custom_components.alexa_media.notify] k************i@gmail.com: Announce by <Entity Sonos One: standby> to targets: ['2****************************2f8']: test
2019-08-16 22:18:22 DEBUG (SyncWorker_1) [alexapy.alexaapi] Running sequence: AlexaAnnouncement data: {"behaviorId": "PREVIEW", "sequenceJson": "{\"@type\": \"com.amazon.alexa.behaviors.model.Sequence\", \"startNode\": {\"@type\": \"com.amazon.alexa.behaviors.model.OpaquePayloadOperationNode\", \"type\": \"AlexaAnnouncement\", \"operationPayload\": {\"deviceType\": \"A2OSP3UA4VC85F\", \"deviceSerialNumber\": \"REDACTED\", \"locale\": \"en-gb\", \"customerId\": \"REDACTED\", \"expireAfter\": \"PT5S\", \"content\": [{\"locale\": \"en-gb\", \"display\": {\"title\": \"\", \"body\": \"\"}, \"speak\": {\"type\": \"text\", \"value\": \"test\"}}], \"target\": {\"customerId\": \"REDACTED\", \"devices\": [{\"deviceSerialNumber\": \"REDACTED\", \"deviceTypeId\": \"A2OSP3UA4VC85F\"}]}}}}", "status": "ENABLED"}

Debug line for Sonos, service data { "message": "test", "data": { "type": "tts", "method": "speak" } } (does work)

2019-08-16 22:22:05 DEBUG (SyncWorker_3) [custom_components.alexa_media.notify] Message: test, kwargs: {'target': ['REDACTEDSERIAL'], 'data': {'type': 'tts', 'method': 'speak'}}
2019-08-16 22:22:05 DEBUG (SyncWorker_3) [custom_components.alexa_media.notify] Testing item: REDACTEDSERIAL against (<Entity Vardagsrum: standby>, Vardagsrum, a****************************0cc, media_player.vardagsrum_2)
2019-08-16 22:22:05 DEBUG (SyncWorker_3) [custom_components.alexa_media.notify] Testing item: REDACTEDSERIAL against (<Entity Sonos One: standby>, Sonos One, 2****************************2f8, media_player.sonos_one_2)
2019-08-16 22:22:05 DEBUG (SyncWorker_3) [custom_components.alexa_media.notify] Converting: REDACTEDSERIAL to (entities): <Entity Sonos One: standby>
2019-08-16 22:22:05 DEBUG (SyncWorker_3) [custom_components.alexa_media.notify] Testing item: REDACTEDSERIAL against (<Entity Pricken: paused>, Pricken, G************XT5, media_player.pricken)
2019-08-16 22:22:05 DEBUG (SyncWorker_3) [custom_components.alexa_media.notify] Testing item: REDACTEDSERIAL against (<Entity This Device: standby>, This Device, B****************************C74, media_player.this_device_4)
2019-08-16 22:22:05 DEBUG (SyncWorker_3) [custom_components.alexa_media.notify] Testing item: REDACTEDSERIAL against (<Entity Kristian's Alexa Apps: standby>, Kristian's Alexa Apps, 6****************************8B5, media_player.kristian_s_alexa_apps)
2019-08-16 22:22:05 DEBUG (SyncWorker_3) [custom_components.alexa_media.notify] Testing item: REDACTEDSERIAL against (<Entity This Device: standby>, This Device, 1****************************03d, media_player.this_device_3)
2019-08-16 22:22:05 DEBUG (SyncWorker_3) [custom_components.alexa_media.notify] Testing item: <Entity Sonos One: standby> against (<Entity Vardagsrum: standby>, Vardagsrum, a****************************0cc, media_player.vardagsrum_2)
2019-08-16 22:22:05 DEBUG (SyncWorker_3) [custom_components.alexa_media.notify] Testing item: <Entity Sonos One: standby> against (<Entity Sonos One: standby>, Sonos One, 2****************************2f8, media_player.sonos_one_2)
2019-08-16 22:22:05 DEBUG (SyncWorker_3) [custom_components.alexa_media.notify] Converting: <Entity Sonos One: standby> to (entities): <Entity Sonos One: standby>
2019-08-16 22:22:05 DEBUG (SyncWorker_3) [custom_components.alexa_media.notify] Testing item: <Entity Sonos One: standby> against (<Entity Pricken: paused>, Pricken, G************XT5, media_player.pricken)
2019-08-16 22:22:05 DEBUG (SyncWorker_3) [custom_components.alexa_media.notify] Testing item: <Entity Sonos One: standby> against (<Entity This Device: standby>, This Device, B****************************C74, media_player.this_device_4)
2019-08-16 22:22:05 DEBUG (SyncWorker_3) [custom_components.alexa_media.notify] Testing item: <Entity Sonos One: standby> against (<Entity Kristian's Alexa Apps: standby>, Kristian's Alexa Apps, 6****************************8B5, media_player.kristian_s_alexa_apps)
2019-08-16 22:22:05 DEBUG (SyncWorker_3) [custom_components.alexa_media.notify] Testing item: <Entity Sonos One: standby> against (<Entity This Device: standby>, This Device, 1****************************03d, media_player.this_device_3)
2019-08-16 22:22:05 DEBUG (SyncWorker_3) [custom_components.alexa_media.notify] TTS entities: [<Entity Sonos One: standby>]
2019-08-16 22:22:05 DEBUG (SyncWorker_3) [custom_components.alexa_media.notify] TTS by <Entity Sonos One: standby> : test
2019-08-16 22:22:05 DEBUG (SyncWorker_3) [alexapy.alexaapi] Running sequence: Alexa.Speak data: {"behaviorId": "PREVIEW", "sequenceJson": "{\"@type\": \"com.amazon.alexa.behaviors.model.Sequence\", \"startNode\": {\"@type\": \"com.amazon.alexa.behaviors.model.OpaquePayloadOperationNode\", \"type\": \"Alexa.Speak\", \"operationPayload\": {\"deviceType\": \"A2OSP3UA4VC85F\", \"deviceSerialNumber\": \"REDACTEDSERIAL\", \"locale\": \"en-gb\", \"customerId\": \"REDACTED\", \"textToSpeak\": \"test\"}}}", "status": "ENABLED"}
2019-08-16 22:22:07 DEBUG (Thread-13) [alexapy.alexawebsocket] Received WebSocket MSG.
2019-08-16 22:22:07 DEBUG (Thread-13) [alexapy.alexawebsocket] Received b'MSG 0x00000362 0x71d04211 f 0x00000001 0xdf2c9798 0x00000237 GWM MSG 0x0000b479 0x0000005c urn:tcomm-endpoint:service:serviceName:DeeWebsiteMessagingService:domain:prod:realm:USAmazon 0x00000081 urn:tcomm-endpoint:device:customerId:REDACTED:deviceType:ALEGCNGL9K0HM:deviceSerialNumber:REDACTEDSERIAL {"payload":"{\\"destinationUserId\\":\\"A23OMPP8TJ9THO\\",\\"key\\":{\\"entryId\\":\\"1565986926830#A2OSP3UA4VC85F#REDACTEDSERIAL\\",\\"registeredUserId\\":\\"REDACTED\\"},\\"timestamp\\":1565986927192}","command":"PUSH_ACTIVITY"}FABE'
2019-08-16 22:22:07 DEBUG (Thread-13) [alexapy.alexawebsocket] Received Standard MSG.
2019-08-16 22:22:07 DEBUG (Thread-13) [custom_components.alexa_media] k************i@gmail.com: Received websocket command: PUSH_ACTIVITY : {'destinationUserId': 'REDACTED', 'key': {'entryId': '1565986926830#A2OSP3UA4VC85F#REDACTEDSERIAL', 'registeredUserId': 'REDACTED'}, 'timestamp': 1565986927192}
2019-08-16 22:22:07 DEBUG (Thread-13) [custom_components.alexa_media] k************i@gmail.com: Updated last_called: {'serialNumber': '2****************************2f8', 'timestamp': 1565986927192}
2019-08-16 22:22:07 DEBUG (Thread-13) [custom_components.alexa_media] k************i@gmail.com: last_called changed: {'serialNumber': '2****************************2f8', 'timestamp': 1565986481057} to {'serialNumber': '2****************************2f8', 'timestamp': 1565986927192}
2019-08-16 22:22:07 DEBUG (SyncWorker_4) [custom_components.alexa_media.media_player] Sonos One is last_called: 2****************************2f8

Debug line for Echo dot (notify.alexa_media_MYECHODOTDEVICE), service data { "message": "test", "data": { "type": "announce", "method": "speak" } } (does work):

2019-08-16 21:54:24 DEBUG (SyncWorker_8) [alexapy.alexaapi] Running sequence: Alexa.Speak data: {"behaviorId": "PREVIEW", "sequenceJson": "{\"@type\": \"com.amazon.alexa.behaviors.model.Sequence\", \"startNode\": {\"@type\": \"com.amazon.alexa.behaviors.model.OpaquePayloadOperationNode\", \"type\": \"Alexa.Speak\", \"operationPayload\": {\"deviceType\": \"A32DOYMUN6DTXA\", \"deviceSerialNumber\": \"REDACTEDSERIAL\", \"locale\": \"en-us\", \"customerId\": \"REDACTED\", \"textToSpeak\": \"test\"}}}", "status": "ENABLED"}
2019-08-16 21:54:25 DEBUG (Thread-13) [alexapy.alexawebsocket] Received WebSocket MSG.
2019-08-16 21:54:25 DEBUG (Thread-13) [alexapy.alexawebsocket] Received b'MSG 0x00000362 0x71c973b2 f 0x00000001 0xd0fcd4e7 0x00000227 GWM MSG 0x0000b479 0x0000005c urn:tcomm-endpoint:service:serviceName:DeeWebsiteMessagingService:domain:prod:realm:USAmazon 0x00000081 urn:tcomm-endpoint:device:customerId:REDACTED:deviceType:ALEGCNGL9K0HM:deviceSerialNumber:REDACTEDSERIAL {"payload":"{\\"destinationUserId\\":\\"REDACTED\\",\\"key\\":{\\"entryId\\":\\"1565985265370#A32DOYMUN6DTXA#REDACTED\\",\\"registeredUserId\\":\\"REDACTED\\"},\\"timestamp\\":1565985265698}","command":"PUSH_ACTIVITY"}FABE'
2019-08-16 21:54:25 DEBUG (Thread-13) [alexapy.alexawebsocket] Received Standard MSG.
2019-08-16 21:54:25 DEBUG (Thread-13) [custom_components.alexa_media] k************i@gmail.com: Received websocket command: PUSH_ACTIVITY : {'destinationUserId': 'REDACTED', 'key': {'entryId': '1565985265370#A32DOYMUN6DTXA#REDACTED', 'registeredUserId': 'REDACTED'}, 'timestamp': 1565985265698}
2019-08-16 21:54:25 DEBUG (Thread-13) [custom_components.alexa_media] k************i@gmail.com: Updated last_called: {'serialNumber': 'G************XT5', 'timestamp': 1565985265698}
2019-08-16 21:54:25 DEBUG (Thread-13) [custom_components.alexa_media] k************i@gmail.com: last_called changed: {'serialNumber': 'G************XT5', 'timestamp': 1565983010478} to {'serialNumber': 'G************XT5', 'timestamp': 1565985265698}
2019-08-16 21:54:25 DEBUG (SyncWorker_13) [custom_components.alexa_media.media_player] Pricken is last_called: G************XT5
krissen commented 5 years ago

Prior to running the above, I 1) removed alexa_media through HACS. 2) Turned off HA. 3) Removed the pickle file. 4) Checked there no longer was a directory custom_components/alexa_media(there wasn't). 5) Started HA. 6) Installed alexa_media through HACS. 7) Rebooted. 8) Logged into Amazon/alexa_media again. 9) Tested announcements. Worked on Echo dot. Did not work on Sonos. TTS worked on Sonos, too.

alandtse commented 5 years ago

If any of you are a 0.96 version or HA and try a 1.3.1 version of the component for comparison that would be helpful. I'm not seeing anything specifically wrong from the output.

I'm working on a revamp major release that may impact the way we interact so may need to table debugging this until we migrate since the way we interact here will be deprecated.

krissen commented 5 years ago

Don't know if it matters, but I tried pulling the nodestoExecute data, for a routine I had created in the Alexa app for the purpose and noticed

1) My Sonos device was not listed among devices possible to announce to. Despite that, I can do a manual announcement in the Alexa app, announced on the Sonos. But not create a routine which does it.

2) Locale, in the nodestoExecute data, is set to en-SE. 🤷‍♂️Haven't seen that before.

{"@type":"com.amazon.alexa.behaviors.model.Automation","automationId":"amzn1.alexa.automation.bed72266-d475-4b07-9530-c3aa81bbe345","name":null,"triggers":[{"payload":{"customerId":"CUSTOMERID","utterance":"make it rain","locale":"en-SE","marketplaceId":"MARKETPLACEID"},"id":"amzn1.alexa.trigger.f6744e87-ad91-4e56-84ca-f8f9efa01270","type":"CustomUtterance","timeLapse":null}],"sequence":{"@type":"com.amazon.alexa.behaviors.model.Sequence","sequenceId":"amzn1.alexa.sequence.e273f122-8f3b-43c8-ba69-aeb1d4e8f932","startNode":{"@type":"com.amazon.alexa.behaviors.model.OpaquePayloadOperationNode","type":"AlexaAnnouncement","skillId":"amzn1.ask.1p.messaging","operationPayload":{"expireAfter":"PT5S","content":[{"locale":"en-SE","display":{"title":"Alexa Routines","body":"Testing"},"speak":{"type":"text","value":"Testing"}}],"customerId":"CUSTOMERID","target":{"customerId":"CUSTOMERID"}},"name":null}},"owner":null,"clientAlias":null,"condition":null,"status":"ENABLED","creationTimeEpochMillis":1566242209772,"lastUpdatedTimeEpochMillis":1566242209772}
alandtse commented 5 years ago

Can you test the 2.0.0 release to see if this is resolved? We switched libraries so debugging in here won't be too relevant anymore.

krissen commented 5 years ago

Upgraded, restarted; it is as before. type: announce does not work; type: tts does work.

krissen commented 5 years ago

Debug output of (failed) type: announce:

2019-08-24 08:25:40 DEBUG (MainThread) [custom_components.alexa_media.notify] Message: test, kwargs: {'target': ['REDACTED'], 'data': {'type': 'announce', 'method': 'all'}}
2019-08-24 08:25:40 DEBUG (MainThread) [custom_components.alexa_media.notify] Testing item: REDACTED against (<Entity Vardagsrum: standby>, Vardagsrum, a****************************0cc, media_player.vardagsrum_2)
2019-08-24 08:25:40 DEBUG (MainThread) [custom_components.alexa_media.notify] Testing item: REDACTED against (<Entity Sonos One: standby>, Sonos One, 2****************************2f8, media_player.sonos_one_2)
2019-08-24 08:25:40 DEBUG (MainThread) [custom_components.alexa_media.notify] Converting: REDACTED to (entities): <Entity Sonos One: standby>
2019-08-24 08:25:40 DEBUG (MainThread) [custom_components.alexa_media.notify] Testing item: REDACTED against (<Entity Pricken: paused>, Pricken, G************XT5, media_player.pricken)
2019-08-24 08:25:40 DEBUG (MainThread) [custom_components.alexa_media.notify] Testing item: REDACTED against (<Entity This Device: standby>, This Device, B****************************C74, media_player.this_device_4)
2019-08-24 08:25:40 DEBUG (MainThread) [custom_components.alexa_media.notify] Testing item: REDACTED against (<Entity Kristian's Alexa Apps: standby>, Kristian's Alexa Apps, 6****************************8B5, media_player.kristian_s_alexa_apps)
2019-08-24 08:25:40 DEBUG (MainThread) [custom_components.alexa_media.notify] Testing item: REDACTED against (<Entity This Device: standby>, This Device, 1****************************03d, media_player.this_device_3)
2019-08-24 08:25:40 DEBUG (MainThread) [custom_components.alexa_media.notify] Testing item: <Entity Sonos One: standby> against (<Entity Vardagsrum: standby>, Vardagsrum, a****************************0cc, media_player.vardagsrum_2)
2019-08-24 08:25:40 DEBUG (MainThread) [custom_components.alexa_media.notify] Testing item: <Entity Sonos One: standby> against (<Entity Sonos One: standby>, Sonos One, 2****************************2f8, media_player.sonos_one_2)
2019-08-24 08:25:40 DEBUG (MainThread) [custom_components.alexa_media.notify] Converting: <Entity Sonos One: standby> to (serialnumbers): REDACTED
2019-08-24 08:25:40 DEBUG (MainThread) [custom_components.alexa_media.notify] Testing item: <Entity Sonos One: standby> against (<Entity Pricken: paused>, Pricken, G************XT5, media_player.pricken)
2019-08-24 08:25:40 DEBUG (MainThread) [custom_components.alexa_media.notify] Testing item: <Entity Sonos One: standby> against (<Entity This Device: standby>, This Device, B****************************C74, media_player.this_device_4)
2019-08-24 08:25:40 DEBUG (MainThread) [custom_components.alexa_media.notify] Testing item: <Entity Sonos One: standby> against (<Entity Kristian's Alexa Apps: standby>, Kristian's Alexa Apps, 6****************************8B5, media_player.kristian_s_alexa_apps)
2019-08-24 08:25:40 DEBUG (MainThread) [custom_components.alexa_media.notify] Testing item: <Entity Sonos One: standby> against (<Entity This Device: standby>, This Device, 1****************************03d, media_player.this_device_3)
2019-08-24 08:25:40 DEBUG (MainThread) [custom_components.alexa_media.notify] Announce targets: ['2****************************2f8'] entities: [<Entity Sonos One: standby>]
2019-08-24 08:25:40 DEBUG (MainThread) [custom_components.alexa_media.notify] k************i@gmail.com: Announce by <Entity Sonos One: standby> to targets: ['2****************************2f8']: test
2019-08-24 08:25:40 DEBUG (MainThread) [alexapy.alexaapi] Running sequence: AlexaAnnouncement data: {"behaviorId": "PREVIEW", "sequenceJson": "{\"@type\": \"com.amazon.alexa.behaviors.model.Sequence\", \"startNode\": {\"@type\": \"com.amazon.alexa.behaviors.model.OpaquePayloadOperationNode\", \"type\": \"AlexaAnnouncement\", \"operationPayload\": {\"deviceType\": \"A2OSP3UA4VC85F\", \"deviceSerialNumber\": \"REDACTED\", \"locale\": \"en-gb\", \"customerId\": \"A23OMPP8TJ9THO\", \"expireAfter\": \"PT5S\", \"content\": [{\"locale\": \"en-gb\", \"display\": {\"title\": \"Home Assistant\", \"body\": \"test\"}, \"speak\": {\"type\": \"text\", \"value\": \"test\"}}], \"target\": {\"customerId\": \"REDACTED\", \"devices\": [{\"deviceSerialNumber\": \"REDACTED\", \"deviceTypeId\": \"A2OSP3UA4VC85F\"}]}}}}", "status": "ENABLED"}

Debug output of (successful) type: tts:

2019-08-24 08:30:58 DEBUG (MainThread) [custom_components.alexa_media.notify] Message: test, kwargs: {'target': ['REDACTED'], 'data': {'type': 'tts', 'method': 'all'}}
2019-08-24 08:30:58 DEBUG (MainThread) [custom_components.alexa_media.notify] Testing item: REDACTED against (<Entity Vardagsrum: standby>, Vardagsrum, a****************************0cc, media_player.vardagsrum_2)
2019-08-24 08:30:58 DEBUG (MainThread) [custom_components.alexa_media.notify] Testing item: REDACTED against (<Entity Sonos One: standby>, Sonos One, 2****************************2f8, media_player.sonos_one_2)
2019-08-24 08:30:58 DEBUG (MainThread) [custom_components.alexa_media.notify] Converting: REDACTED to (entities): <Entity Sonos One: standby>
2019-08-24 08:30:58 DEBUG (MainThread) [custom_components.alexa_media.notify] Testing item: REDACTED against (<Entity Pricken: paused>, Pricken, G************XT5, media_player.pricken)
2019-08-24 08:30:58 DEBUG (MainThread) [custom_components.alexa_media.notify] Testing item: REDACTED against (<Entity This Device: standby>, This Device, B****************************C74, media_player.this_device_4)
2019-08-24 08:30:58 DEBUG (MainThread) [custom_components.alexa_media.notify] Testing item: REDACTED against (<Entity Kristian's Alexa Apps: standby>, Kristian's Alexa Apps, 6****************************8B5, media_player.kristian_s_alexa_apps)
2019-08-24 08:30:58 DEBUG (MainThread) [custom_components.alexa_media.notify] Testing item: REDACTED against (<Entity This Device: standby>, This Device, 1****************************03d, media_player.this_device_3)
2019-08-24 08:30:58 DEBUG (MainThread) [custom_components.alexa_media.notify] Testing item: <Entity Sonos One: standby> against (<Entity Vardagsrum: standby>, Vardagsrum, a****************************0cc, media_player.vardagsrum_2)
2019-08-24 08:30:58 DEBUG (MainThread) [custom_components.alexa_media.notify] Testing item: <Entity Sonos One: standby> against (<Entity Sonos One: standby>, Sonos One, 2****************************2f8, media_player.sonos_one_2)
2019-08-24 08:30:58 DEBUG (MainThread) [custom_components.alexa_media.notify] Converting: <Entity Sonos One: standby> to (entities): <Entity Sonos One: standby>
2019-08-24 08:30:58 DEBUG (MainThread) [custom_components.alexa_media.notify] Testing item: <Entity Sonos One: standby> against (<Entity Pricken: paused>, Pricken, G************XT5, media_player.pricken)
2019-08-24 08:30:58 DEBUG (MainThread) [custom_components.alexa_media.notify] Testing item: <Entity Sonos One: standby> against (<Entity This Device: standby>, This Device, B****************************C74, media_player.this_device_4)
2019-08-24 08:30:58 DEBUG (MainThread) [custom_components.alexa_media.notify] Testing item: <Entity Sonos One: standby> against (<Entity Kristian's Alexa Apps: standby>, Kristian's Alexa Apps, 6****************************8B5, media_player.kristian_s_alexa_apps)
2019-08-24 08:30:58 DEBUG (MainThread) [custom_components.alexa_media.notify] Testing item: <Entity Sonos One: standby> against (<Entity This Device: standby>, This Device, 1****************************03d, media_player.this_device_3)
2019-08-24 08:30:58 DEBUG (MainThread) [custom_components.alexa_media.notify] TTS entities: [<Entity Sonos One: standby>]
2019-08-24 08:30:58 DEBUG (MainThread) [custom_components.alexa_media.notify] TTS by <Entity Sonos One: standby> : test
2019-08-24 08:30:58 DEBUG (MainThread) [alexapy.alexaapi] Running sequence: Alexa.Speak data: {"behaviorId": "PREVIEW", "sequenceJson": "{\"@type\": \"com.amazon.alexa.behaviors.model.Sequence\", \"startNode\": {\"@type\": \"com.amazon.alexa.behaviors.model.OpaquePayloadOperationNode\", \"type\": \"Alexa.Speak\", \"operationPayload\": {\"deviceType\": \"A2OSP3UA4VC85F\", \"deviceSerialNumber\": \"REDACTED\", \"locale\": \"en-gb\", \"customerId\": \"REDACTED\", \"textToSpeak\": \"test\"}}}", "status": "ENABLED"}
2019-08-24 08:31:00 DEBUG (MainThread) [alexapy.alexawebsocket] msg: WSMessage(type=<WSMsgType.BINARY: 2>, data=b'MSG 0x00000362 0x6137ac19 f 0x00000001 0xda5ecc6c 0x00000237 GWM MSG 0x0000b479 0x0000005c urn:tcomm-endpoint:service:serviceName:DeeWebsiteMessagingService:domain:prod:realm:USAmazon 0x00000081 urn:tcomm-endpoint:device:customerId:REDACTED:deviceType:ALEGCNGL9K0HM:deviceSerialNumber:REDACTED {"payload":"{\\"destinationUserId\\":\\"REDACTED\\",\\"key\\":{\\"entryId\\":\\"1566628259577#A2OSP3UA4VC85F#REDACTED\\",\\"registeredUserId\\":\\"REDACTED\\"},\\"timestamp\\":1566628259917}","command":"PUSH_ACTIVITY"}FABE', extra='')
2019-08-24 08:31:00 DEBUG (MainThread) [alexapy.alexawebsocket] Received WebSocket MSG.
2019-08-24 08:31:00 DEBUG (MainThread) [alexapy.alexawebsocket] Received b'MSG 0x00000362 0x6137ac19 f 0x00000001 0xda5ecc6c 0x00000237 GWM MSG 0x0000b479 0x0000005c urn:tcomm-endpoint:service:serviceName:DeeWebsiteMessagingService:domain:prod:realm:USAmazon 0x00000081 urn:tcomm-endpoint:device:customerId:A23OMPP8TJ9THO:deviceType:ALEGCNGL9K0HM:deviceSerialNumber:REDACTED {"payload":"{\\"destinationUserId\\":\\"REDACTED\\",\\"key\\":{\\"entryId\\":\\"1566628259577#A2OSP3UA4VC85F#REDACTED\\",\\"registeredUserId\\":\\"REDACTED\\"},\\"timestamp\\":1566628259917}","command":"PUSH_ACTIVITY"}FABE'
2019-08-24 08:31:00 DEBUG (MainThread) [alexapy.alexawebsocket] Received Standard MSG.
2019-08-24 08:31:00 DEBUG (MainThread) [custom_components.alexa_media] k************i@gmail.com: Received websocket command: PUSH_ACTIVITY : {'destinationUserId': 'REDACTED', 'key': {'entryId': '1566628259577#A2OSP3UA4VC85F#REDACTED', 'registeredUserId': 'REDACTED'}, 'timestamp': 1566628259917}
2019-08-24 08:31:00 DEBUG (MainThread) [custom_components.alexa_media] k************i@gmail.com: Updated last_called: {'serialNumber': '2****************************2f8', 'timestamp': 1566628259917}
2019-08-24 08:31:00 DEBUG (MainThread) [custom_components.alexa_media] k************i@gmail.com: last_called changed: {'serialNumber': '2****************************2f8', 'timestamp': 1566628096869} to {'serialNumber': '2****************************2f8', 'timestamp': 1566628259917}
2019-08-24 08:31:00 DEBUG (MainThread) [custom_components.alexa_media.media_player] Sonos One is last_called: 2****************************2f8
krissen commented 5 years ago

As mentioned previously, I can not create a routine, in the Alexa app, which would trigger announcement on the Sonos. (Only my Dot is listed as a valid device for the function.) I don't know if I was able to, earlier; never tried it.

What I can do, from the Alexa app, is to use the "Communicate" tab, and send an announcement that way to all devices. (Can't seem to specify only one device.) Doesn't work quite the same way as the announce available as routine though. Instead of just "Bling Test", I get "Bling From NAME, Test". That gets broadcasted to both the Sonos and the Echo Dot.

alandtse commented 5 years ago

@krissen Thanks for the help debugging, I really appreciate the log generation even if I'm not directly responding. The reason I try to get the routine info is that at least can show us acceptable syntax. Again, the syntax looks fine, so I'm a bit stumped. The fact it's not an option in the routine makes me think perhaps Amazon stopped supporting it?

Some additional tests I can think of:

krissen commented 5 years ago

Whole house audio group. Normal Alexa-groups doesn't seem to support more than one speaker. Tried to create a multi-room music group, but was told no compatible speakers were found. So far, I haven't been able to find a way to create a group within Alexa, for the two speakers.

1.3.1 Tried that some days ago, but seemed the alexa_media -component wouldn't run? I don't recall the exact errors; sorry. Also downgraded alexapy, but that didn't help. I thought that maybe 1.3.1 required HA < 0.97? (I'm on 0.97.2. If it can be avoided, I'd rather not downgrade HA itself.)

Testing via dev_service. (Though I've tested via automations as well.)

Let me know if you've got something else to try or troubleshoot. Testing custom .py files or the like is fine as well.

mikkelke commented 5 years ago

I contected Amazon severeal times and thay could not tell me why it stopped working. They say the escalated my issue to techincal team but I never got a responds. Since i use the announcement for my doorbell (I can enable the old ringer) I will try to change to Google Assistant. Thanks for the help and support.

mikeydarin commented 5 years ago

I have the same behavior for my ecobee4. I suspect amazon changed something on the back end for these third-party devices. Seems like about a month ago that HA announcements stopped on the ecobee4. Announcements still work for all amazon-manufactured devices, and using an echo to make an announcement ("alexa, announce that it's bedtime") includes the ecobee4.
Updated to latest HA (98.3) and alexa_media (2.1) through hacs (13.2) without any change. Finally got around to "fixing it" tonight and TTS works. I liked the chime at the beginning of an announcement, but I'm fine with TTS for now.

alandtse commented 5 years ago

@mikeydarin just to check, when it stopped working for you, were you on an older version of alexa_media? Some people said it last worked for them in 1.3.1 (but it's unclear if the issue arose because of a new release or because Amazon changed something). If you hadn't been updating and still had it stop working, that would answer that question.

mikeydarin commented 5 years ago

@alandtse I believe I was on an older version (1.2.1, maybe?) and it just stopped working, and then I deleted alexa_media, installed hacs, and used hacs 12.x to install alexa_media 1.4.1. I've been lazy for the last few weeks, then tonight I upgraded everything. All of this is from memory and a little amateur detective work, so it could all be wrong.

martin3000 commented 5 years ago

Announce stopped working on my echo dot. I have 1.3.1 and did not update or change anything. (HA 0.94.4, no hassio, no docker, no venv)

alandtse commented 5 years ago

@martin3000 your pickle likely expired if nothing has changed. Please try renaming and relogging in and seeing if it resolves.

gericho commented 5 years ago

same here, both on Echo Dot and Echo Spot announcements stopped working, TTS does work. (amazon.it)

martin3000 commented 5 years ago

@martin3000 your pickle likely expired if nothing has changed. Please try renaming and relogging in and seeing if it resolves.

Indeed, thank you!

krissen commented 5 years ago

Just updating to say, that matters are still functioning, or not, in the same manner in v2.3.2 as before. That is, TTS works; announce does not, on a Sonos.

alandtse commented 5 years ago

@krissen thanks for the update. What may be helpful is to see if the routine mechanism ever starts working. As soon as it does, then I think we can edit the command to follow that.

SamB-GB commented 5 years ago

Is there any advantage of using Announce rather than TTS since TTS works?

krissen commented 5 years ago

Is there any advantage of using Announce rather than TTS since TTS works?

Minor advantage: it adds a chime prior to the message. Sounds trivial, but it's nice. 🤷‍♂️ Could be achieved by playing a custom sound prior to message, too.

ehendrix23 commented 5 years ago

With announcement there are also other things possible like change voice, intonation, ....

SamB-GB commented 5 years ago

I know over at Smartthings I used to use an application that's called EchoSpeaks and he could never integrate the Sonos as Amazon doesn't treat these like true Alexa devices apparently.

Flight777 commented 5 years ago

Sames issues here, must be a Sonos thing... Like SamB-GB set, they are always a little bit special in Alexa's eyes.

septeven commented 5 years ago

Hi, same problem here with an echo dot 2nd gen. TTS works, Announce doesn't. Any idea when this could be fixed ?

Thanks

alandtse commented 5 years ago

@septeven please open a new issue since you're reporting a different issue.

septeven commented 5 years ago

@alandtse Huh I'm sorry but I'm encountering the exact same issue than other people here ?! TTS works - announce doesn't (and other people here got the problem on other device than sonos one)...

You should let me know what's different maybe?

alandtse commented 5 years ago

This is for Sonos and ecobee. You're claiming an issue with an Amazon device.

septeven commented 5 years ago

@alandtse Well, if you do a quick search here, you'll find several occurences of ppl talking about the issue occuring both on sonos and amazon devices...

Anyway, I don't see the point to open another issue since it's clearly related.

SamB-GB commented 5 years ago

@septeven Yeah its a slightly different issue because Sonos and Ecobee while can have Alexa through them they are not treated by Amazon and a full Alexa device and that's why these have stopped working. It seems your having an issue with an amazon device so best not to confused this thread with Amazon and Non-Amazon devices as this one specifically related to non Amazon devices.

alandtse commented 5 years ago

@septeven As mentioned by @SamB-GB, others are monitoring this thread for a specific third-party device issue. For me to do anything for you on an echo dot I'll need logs and it doesn't make sense to add it to this thread since that's not the main problem. That said, I appreciate the report but I do not plan to look into the issue without data to review. I'll mark this subthread offtopic so others can find relevant information for the thread.

CiquattroFPV commented 4 years ago

Sames issues here, must be a Sonos thing... Like SamB-GB set, they are always a little bit special in Alexa's eyes.

I have a bose and I have the same issue the announce feature seems don't work

justinhelmer commented 4 years ago

Unlike others, tts does not work for me either, on my Bose devices.

announce and tts both work on my Echo, but neither work on my Bose devices.