alexa-actions icon indicating copy to clipboard operation
alexa-actions copied to clipboard

[Bug]: Not getting any event when user does not respond on Alexa devices with a screen

Open bakernigel opened this issue 7 months ago • 0 comments

Did you check our FAQ and Issue/PR for similar issues?

  • [X] FAQ checked!
  • [X] Issues/PR checked!

Contact Details

[email protected]

What happened?

I've been tearing my hair out for a few days now trying to figure this one out. I suspect it's probably a bug. I have installed the skill successfully, and set up HA as shown in the example with the simple Yes or No example. Yes or No response works perfectly with an event being generated to HA as expected. However my primary use case for this feature is the No Response case where the user does not say anything when Alexa asks "Yes or No", and that's where things go wrong. Using my Echo Dot as the Alexa device, the no response case works perfectly. The Dot says "Yes or No" The Dot waits for a response for about 10s with the ring light on. HA gets the event with event_response: ResponseNone, event_response_type: ResponseNone

HOWEVER, now using my Fire Tablet, or Echo Show 8 as the Alexa device, the no response case fails (Reponding Yes or No work perfectly). The Fire says "Yes or No" Screen on the Fire or Show changes to black screen with "Alexa Actionable Notifications" in the middle, and "To quit, try "Alexa exit"" at the bottom left. Flashing blue bar appears at bottom of screen. After about 25s the blue bar disappears. After about 55s the black screen saying "Alexa Actionable Notifications" disappears and the screen goes back to the normal Show or Fire screen. HA never gets any event.

If I now call the skill again after a few minutes, HA will IMMEDIATELY get a No Response event. It's almost as if the No Response event was buffered somewhere and now it gets sent.

If I say "Alexa exit" while the Alexa Actionable Notifications screen is up on the Fire or Echo show, HA will get the No Response event.

It seems devices with a screen like the Echo Show or Fire Tablet behave very differently to devices without a screen like the Echo Dot. I found this article on the Amazon Developer website where it talks about How devices with screens affect the skill session https://developer.amazon.com/en-US/docs/alexa/custom-skills/manage-skill-session-and-session-attributes.html

I tried playing around with setting shouldEndSession = True or False in LaunchRequestHandler but didn't seem to help. e.g. handler = handler_input.response_builder.speak(speak_output).set_should_end_session(False)

On a side note I was able to customize the screen that pops up on the Show by doing this: from ask_sdk_model.ui import SimpleCard handler = handler_input.response_builder.speak(speak_output).set_card(SimpleCard("Hello World", speech_text)) Maybe a useful feature in the future !

I captured logs for the passing Echo Dot case and the failing Echo Show case. In the passing case I see "Session Ended Request Handler triggered" happening. In the failing case this never seems to happen.

Version

Latest downloaded 6/27/24

What Alexa device are you using?

Echo Show

What other Alexa device are you using?

No response

Relevant log output

Successful Echo DOT use case:-
INIT_START Runtime Version: python:3.8.v51	Runtime Version ARN: arn:aws:lambda:us-east-1::runtime:a768321bd39c88f083afe0a045064adc3615105a319dbbcd583856654db68283
START RequestId: 8c2f795b-cefd-438e-86ca-88851365c076 Version: 22
Locale is en
[INFO]	2024-06-27T15:18:07.370Z	8c2f795b-cefd-438e-86ca-88851365c076	Locale is en
[DEBUG]	2024-06-27T15:18:07.682Z	8c2f795b-cefd-438e-86ca-88851365c076	Raw response: b'{"entity_id":"input_text.alexa_actionable_notification","state":"{\\"text\\": \\"Yes or no?\\", \\"event\\": \\"alexa_actionable_notification_test\\", \\"suppress_confirmation\\": \\"\\"}","attributes":{"editable":true,"min":0,"max":255,"pattern":null,"mode":"text","friendly_name":"alexa_actionable_notification"},"last_changed":"2024-06-27T00:02:08.619833+00:00","last_reported":"2024-06-27T00:02:08.619833+00:00","last_updated":"2024-06-27T00:02:08.619833+00:00","context":{"id":"01J1BFZRK7T1DT30P1N6MB55ND","parent_id":null,"user_id":"64697241df824d8fb8d27628a5ed30fe"}}'
Raw response: b'{"entity_id":"input_text.alexa_actionable_notification","state":"{\\"text\\": \\"Yes or no?\\", \\"event\\": \\"alexa_actionable_notification_test\\", \\"suppress_confirmation\\": \\"\\"}","attributes":{"editable":true,"min":0,"max":255,"pattern":null,"mode":"text","friendly_name":"alexa_actionable_notification"},"last_changed":"2024-06-27T00:02:08.619833+00:00","last_reported":"2024-06-27T00:02:08.619833+00:00","last_updated":"2024-06-27T00:02:08.619833+00:00","context":{"id":"01J1BFZRK7T1DT30P1N6MB55ND","parent_id":null,"user_id":"64697241df824d8fb8d27628a5ed30fe"}}'
Decoded response: 
{
    "text": "Yes or no?",
    "event": "alexa_actionable_notification_test",
    "suppress_confirmation": ""
}

[DEBUG]	2024-06-27T15:18:07.682Z	8c2f795b-cefd-438e-86ca-88851365c076	Decoded response: 
{
    "text": "Yes or no?",
    "event": "alexa_actionable_notification_test",
    "suppress_confirmation": ""
}

[DEBUG]	2024-06-27T15:18:07.682Z	8c2f795b-cefd-438e-86ca-88851365c076	event_id='alexa_actionable_notification_test' suppress_confirmation=False text='Yes or no?'
event_id='alexa_actionable_notification_test' suppress_confirmation=False text='Yes or no?'
END RequestId: 8c2f795b-cefd-438e-86ca-88851365c076
REPORT RequestId: 8c2f795b-cefd-438e-86ca-88851365c076	Duration: 402.80 ms	Billed Duration: 403 ms	Memory Size: 512 MB	Max Memory Used: 59 MB	Init Duration: 655.36 ms	
START RequestId: b73d04ba-be2f-43dd-80f9-36c585a48da2 Version: 22
Locale is en
[INFO]	2024-06-27T15:18:20.001Z	b73d04ba-be2f-43dd-80f9-36c585a48da2	Locale is en
Session Ended Request Handler triggered
[INFO]	2024-06-27T15:18:20.001Z	b73d04ba-be2f-43dd-80f9-36c585a48da2	Session Ended Request Handler triggered
Raw response: b'{"entity_id":"input_text.alexa_actionable_notification","state":"{\\"text\\": \\"Yes or no?\\", \\"event\\": \\"alexa_actionable_notification_test\\", \\"suppress_confirmation\\": \\"\\"}","attributes":{"editable":true,"min":0,"max":255,"pattern":null,"mode":"text","friendly_name":"alexa_actionable_notification"},"last_changed":"2024-06-27T00:02:08.619833+00:00","last_reported":"2024-06-27T00:02:08.619833+00:00","last_updated":"2024-06-27T00:02:08.619833+00:00","context":{"id":"01J1BFZRK7T1DT30P1N6MB55ND","parent_id":null,"user_id":"64697241df824d8fb8d27628a5ed30fe"}}'
[DEBUG]	2024-06-27T15:18:20.278Z	b73d04ba-be2f-43dd-80f9-36c585a48da2	Raw response: b'{"entity_id":"input_text.alexa_actionable_notification","state":"{\\"text\\": \\"Yes or no?\\", \\"event\\": \\"alexa_actionable_notification_test\\", \\"suppress_confirmation\\": \\"\\"}","attributes":{"editable":true,"min":0,"max":255,"pattern":null,"mode":"text","friendly_name":"alexa_actionable_notification"},"last_changed":"2024-06-27T00:02:08.619833+00:00","last_reported":"2024-06-27T00:02:08.619833+00:00","last_updated":"2024-06-27T00:02:08.619833+00:00","context":{"id":"01J1BFZRK7T1DT30P1N6MB55ND","parent_id":null,"user_id":"64697241df824d8fb8d27628a5ed30fe"}}'
[DEBUG]	2024-06-27T15:18:20.278Z	b73d04ba-be2f-43dd-80f9-36c585a48da2	Decoded response: 
{
    "text": "Yes or no?",
    "event": "alexa_actionable_notification_test",
    "suppress_confirmation": ""
}

Decoded response: 
{
    "text": "Yes or no?",
    "event": "alexa_actionable_notification_test",
    "suppress_confirmation": ""
}

event_id='alexa_actionable_notification_test' suppress_confirmation=False text='Yes or no?'
[DEBUG]	2024-06-27T15:18:20.278Z	b73d04ba-be2f-43dd-80f9-36c585a48da2	event_id='alexa_actionable_notification_test' suppress_confirmation=False text='Yes or no?'
[DEBUG]	2024-06-27T15:18:20.361Z	b73d04ba-be2f-43dd-80f9-36c585a48da2	Clearing Home Assistant local state
Clearing Home Assistant local state
END RequestId: b73d04ba-be2f-43dd-80f9-36c585a48da2
REPORT RequestId: b73d04ba-be2f-43dd-80f9-36c585a48da2	Duration: 363.71 ms	Billed Duration: 364 ms	Memory Size: 512 MB	Max Memory Used: 60 MB	
--------------------------------------------------------------------------------------------------------
Unsuccessful Echo Show use case:-
INIT_START Runtime Version: python:3.8.v51	Runtime Version ARN: arn:aws:lambda:us-east-1::runtime:a768321bd39c88f083afe0a045064adc3615105a319dbbcd583856654db68283
START RequestId: 3bd7a0b9-ddea-4e1e-ad05-a7ec792cea54 Version: 22
Locale is en
[INFO]	2024-06-27T15:33:29.792Z	3bd7a0b9-ddea-4e1e-ad05-a7ec792cea54	Locale is en
[DEBUG]	2024-06-27T15:33:30.112Z	3bd7a0b9-ddea-4e1e-ad05-a7ec792cea54	Raw response: b'{"entity_id":"input_text.alexa_actionable_notification","state":"{\\"text\\": \\"Yes or no?\\", \\"event\\": \\"alexa_actionable_notification_test\\", \\"suppress_confirmation\\": \\"\\"}","attributes":{"editable":true,"min":0,"max":255,"pattern":null,"mode":"text","friendly_name":"alexa_actionable_notification"},"last_changed":"2024-06-27T00:02:08.619833+00:00","last_reported":"2024-06-27T00:02:08.619833+00:00","last_updated":"2024-06-27T00:02:08.619833+00:00","context":{"id":"01J1BFZRK7T1DT30P1N6MB55ND","parent_id":null,"user_id":"64697241df824d8fb8d27628a5ed30fe"}}'
Raw response: b'{"entity_id":"input_text.alexa_actionable_notification","state":"{\\"text\\": \\"Yes or no?\\", \\"event\\": \\"alexa_actionable_notification_test\\", \\"suppress_confirmation\\": \\"\\"}","attributes":{"editable":true,"min":0,"max":255,"pattern":null,"mode":"text","friendly_name":"alexa_actionable_notification"},"last_changed":"2024-06-27T00:02:08.619833+00:00","last_reported":"2024-06-27T00:02:08.619833+00:00","last_updated":"2024-06-27T00:02:08.619833+00:00","context":{"id":"01J1BFZRK7T1DT30P1N6MB55ND","parent_id":null,"user_id":"64697241df824d8fb8d27628a5ed30fe"}}'
[DEBUG]	2024-06-27T15:33:30.112Z	3bd7a0b9-ddea-4e1e-ad05-a7ec792cea54	Decoded response: 
{
    "text": "Yes or no?",
    "event": "alexa_actionable_notification_test",
    "suppress_confirmation": ""
}

Decoded response: 
{
    "text": "Yes or no?",
    "event": "alexa_actionable_notification_test",
    "suppress_confirmation": ""
}

event_id='alexa_actionable_notification_test' suppress_confirmation=False text='Yes or no?'
[DEBUG]	2024-06-27T15:33:30.113Z	3bd7a0b9-ddea-4e1e-ad05-a7ec792cea54	event_id='alexa_actionable_notification_test' suppress_confirmation=False text='Yes or no?'
END RequestId: 3bd7a0b9-ddea-4e1e-ad05-a7ec792cea54
REPORT RequestId: 3bd7a0b9-ddea-4e1e-ad05-a7ec792cea54	Duration: 452.76 ms	Billed Duration: 453 ms	Memory Size: 512 MB	Max Memory Used: 60 MB	Init Duration: 682.61 ms

bakernigel avatar Jul 02 '24 16:07 bakernigel