Alexa retrieves variable value but fails - SOLVED

Posted on
Thu Sep 30, 2021 6:12 pm
ryanbuckner offline
Posts: 1074
Joined: Oct 08, 2011
Location: Northern Virginia

Alexa retrieves variable value but fails - SOLVED

Every few time I try to ask Alexa for the value of a variable , I get "I'm having trouble accessing your Indigo Server Skill Skill right now" . But it appears to retrieve the value. Here's. what's in the debug:

Sep 30, 2021 at 8:05:45 PM
Alexa Debug variable_actions API call received
Alexa request the value of variable 'forestville_lunch_tomorrow'
Alexa Debug reply:
{"speak_string": "Cheese Pizza or Pepperoni Pizza or PB&J Biteable or Yogurt Biteable", "status": "success", "variable_name": "forestville lunch tomorrow", "variable_name_mangled": "forestville_lunch_tomorrow"}


Rather than speaking the value, it said "I'm having trouble accessing your Indigo Server Skill Skill right now"
Last edited by ryanbuckner on Thu Oct 14, 2021 9:51 am, edited 1 time in total.

Posted on
Fri Oct 01, 2021 8:52 am
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Alexa retrieves variable value but fails

Unfortunately, that error is generated by Alexa. Since we're returning the appropriate response (as per the debug reply above) I have no insight into why Alexa is returning an error. If you immediately say exactly the same thing again, does it work? If so, and you get two identical debug replies like above, then there really isn't anything we can do about it since it's totally on the Alexa side.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Fri Oct 01, 2021 9:06 am
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Alexa retrieves variable value but fails

I was able to find the Amazon logs for processing the event specified above. It shows that everything went correctly from our skill's side:

Code: Select all
[DEBUG]   2021-10-01T00:05:45.145Z   XXXXXXXXXXXXXXXX   GetVariableValueIntent.handle() called...
[DEBUG]   2021-10-01T00:05:45.145Z   XXXXXXXXXXXXXXXX   locale: en-US
[DEBUG]   2021-10-01T00:05:45.145Z   XXXXXXXXXXXXXXXX   variable name: forestville lunch tomorrow
[DEBUG]   2021-10-01T00:05:45.145Z   XXXXXXXXXXXXXXXX   payload:
[DEBUG]   2021-10-01T00:05:45.145Z   XXXXXXXXXXXXXXXX   {
"variable_name": "forestville lunch tomorrow",
"locale": "en-US",
"action": "get_variable_value"
}
[DEBUG]   2021-10-01T00:05:45.864Z   XXXXXXXXXXXXXXXX   reply:
[DEBUG]   2021-10-01T00:05:45.864Z   XXXXXXXXXXXXXXXX   {
"status": "success",
"variable_name_mangled": "forestville_lunch_tomorrow",
"speak_string": "Cheese Pizza or Pepperoni Pizza or PB&J Biteable or Yogurt Biteable",
"variable_name": "forestville lunch tomorrow"
}
END RequestId: XXXXXXXXXXXXXXXX


This shows the entire event flow from our skill's perspective: we get the request for a variable value with the given name, we format that into the request that gets passed to the Alexa plugin, the plugin replies (as seen in your debug log), our skill (hosted on Amazon's servers) receives the reply and returns the value of "speak_string" to Amazon. Nowhere do we show any errors, so I don't know why you wouldn't have gotten the appropriate response. I wish I had found some errors that we could address...

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Fri Oct 01, 2021 10:44 am
ryanbuckner offline
Posts: 1074
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Alexa retrieves variable value but fails

I'd say it works 75% of the time when trying the same thing right away

Posted on
Fri Oct 01, 2021 2:04 pm
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Alexa retrieves variable value but fails

And you always see the reply debug in the log? If you do, then the problem will almost certainly be on Amazon's side. If, however, you say something and you get an error but no debug logging, then the problem could be that your reflector connection is having an issue. I would expect there to be errors in the Event Log however that would indicate that there were some kind of issue with the reflector or any part of the flow on the Indigo side.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon Oct 04, 2021 7:10 am
ryanbuckner offline
Posts: 1074
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Alexa retrieves variable value but fails

I've tried renaming variables and action groups. I think I'm giving up on the Alexa feature for a while.

Posted on
Wed Oct 13, 2021 6:30 am
ryanbuckner offline
Posts: 1074
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Alexa retrieves variable value but fails

Tried again today ... same result: "Having trouble accessing your Indigo skill skill"

Code: Select all
Oct 13, 2021 at 8:27:54 AM
   Alexa                           Turning on debug logging
   Alexa Debug                     variable_actions API call received
   Alexa                           request the value of variable 'lunch_today'
   Alexa Debug                     reply:
{"speak_string": "Baked Chicken on Bun or PB&J Biteable or Yogurt Biteable", "status": "success", "variable_name": "lunch today", "variable_name_mangled": "lunch_today"}

Posted on
Wed Oct 13, 2021 1:14 pm
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Alexa retrieves variable value but fails

It doesn't like the & in the string value. Change it to "and" and it will work.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Thu Oct 14, 2021 6:36 am
ryanbuckner offline
Posts: 1074
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Alexa retrieves variable value but fails

The '&' is pulled from the API for Nutrislice. I can try to change it in the script.

That night be why Alexa has no problem pulling the breakfast_today variable but fails on the lunch_today variable. Damn PB&J Bites.

Code: Select all
Oct 14, 2021 at 8:32:26 AM
   Alexa Debug                     variable_actions API call received
   Alexa                           request the value of variable 'breakfast_today'
   Alexa Debug                     reply:
{"speak_string": "Apple Cinnamon Muffin Top or Cheerios", "status": "success", "variable_name": "breakfast today", "variable_name_mangled": "breakfast_today"}

Oct 14, 2021 at 8:32:58 AM
   Schedule                        1st Floor Bathroom on Motion - OFF (delayed action)
   Sent INSTEON                    "1st Floor Bathroom Light" off
   Alexa Debug                     deviceUpdated: 1st Floor Bathroom Light
   Alexa Debug                     original device type: RelayDevice, updated device type: RelayDevice
   Alexa Debug                     IndigoDeviceEndpoint.__init__ called with device: 1507246897 (1st Floor Bathroom Light)
   Alexa Debug                     IndigoDeviceEndpoint.__init__ called with device: 1507246897 (1st Floor Bathroom Light)
   Alexa Debug                     variable_actions API call received
   Alexa                           request the value of variable 'lunch_today'
   Alexa Debug                     reply:
{"speak_string": "Macaroni & Cheese or PB&J Biteable or Yogurt Biteable", "status": "success", "variable_name": "lunch today", "variable_name_mangled": "lunch_today"}

Posted on
Thu Oct 14, 2021 6:42 am
ryanbuckner offline
Posts: 1074
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Alexa retrieves variable value but fails

It worked!!

Code: Select all
foodlist.append(item['food']['name'].replace("&", " and "))


returned:

Code: Select all
Oct 14, 2021 at 8:41:25 AM
   Alexa Debug                     variable_actions API call received
   Alexa                           request the value of variable 'lunch_today'
   Alexa Debug                     reply:
{"speak_string": "Macaroni  and  Cheese or PB and J Biteable or Yogurt Biteable", "status": "success", "variable_name": "lunch today", "variable_name_mangled": "lunch_today"}


Posted on
Thu Oct 14, 2021 11:12 am
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Alexa retrieves variable value but fails - SOLVED

I think you could also use the html module:

Code: Select all
import html
foodlist.append(html.escape(item['food']['name']))


That would generate "Macaroni and Cheese or PB&J Biteable or Yogurt Biteable" which appears to work as well. It might also catch other things that might cause hiccups.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Thu Oct 14, 2021 3:36 pm
ryanbuckner offline
Posts: 1074
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Alexa retrieves variable value but fails - SOLVED

It generated Macaroni & Cheese or PB&J Biteable or Yogurt Biteable

Appears to work well. I'll go with this.

Posted on
Sat Feb 10, 2024 2:09 pm
mgolden50 offline
User avatar
Posts: 247
Joined: Jan 29, 2007
Location: Chandler, AZ

Re: Alexa retrieves variable value but fails - SOLVED

I'm having similar problems getting the Alexa plugin getting Alexa to speak,

The variable name is Announcement. The variable content is <The patio door, is not locked.
Alexa is linked to Indigo. But her response is "Sorry. Im having trouble accessing the Indigo Skill. skill right now. Try again later.
This has been happening for two days worth of attempts

Here's the debut output

Alexa Debug variable_actions API call received
Alexa request the value of variable 'announcement'
Alexa Debug reply:
{"speak_string": "<The patio door is not locked.", "status": "success", "variable_name": "announcement", "variable_name_mangled": "announcement"}

Posted on
Sat Feb 10, 2024 2:16 pm
mgolden50 offline
User avatar
Posts: 247
Joined: Jan 29, 2007
Location: Chandler, AZ

Re: Alexa retrieves variable value but fails - SOLVED

Also tried a different variable name.

Got this

Alexa Debug variable_actions API call received
Alexa request the value of variable 'speak_this'
Alexa Debug reply:
{"speak_string": "<The patio door is not locked.", "status": "success", "variable_name": "speak this", "variable_name_mangled": "speak_this"}

Posted on
Sat Feb 10, 2024 3:00 pm
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Alexa retrieves variable value but fails - SOLVED

Have you tried it without the < sign at the beginning of the string? I suspect that might be the problem.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Who is online

Users browsing this forum: No registered users and 1 guest