I am trying to play an audio in my alexa skill with standard card type.
This is my json output for Alexa.
{
"version": "1.0",
"response": {
"outputSpeech": {
"type": "PlainText",
"text": "Your Audio will start playing now"
},
"card": {
"type": "Standard",
"title": "Audio One Sample Title",
"text": "Audio One Sample Description",
"image": {
"smallImageUrl": "https://image_url.jpeg",
"largeImageUrl": "https://image_url.jpeg"
}
},
"directives": [
{
"type": "AudioPlayer.Play",
"playBehavior": "REPLACE_ALL",
"audioItem": {
"stream": {
"url": "https://audio_url.mp3",
"token": "sample_token_1",
"offsetInMilliseconds": 0
}
}
}
],
"shouldEndSession": true
}
}
I can see this card title and description getting displayed on my alexa spot and alexa show, but this title and description disappear once the audio starts. Is there something else I have to add to this json so that these titles remains on the screen even when the audio is playing.
Related
I'm currently working on an Alexa Smarthome skill which can handle a multitude of device types, one of which type is an HVAC device. The server handling Skill requests is unable to handle multiple requests at a time, so instead of letting Alexa call "ReportState", I instead give it a "ChangeReport" when values change.
I'm using an Alexa.ThermostatController interface v3 capability as well as a PowerController, a TemperatureSensor, and an EndpointHealth capability to build the device. An example Discovery response looks like the following:
{
"endpointId": "12-34",
"manufacturerName": "Sample Manufacturer",
"description": "HVAC Control",
"friendlyName": "Office Test HVAC",
"additionalAttributes": {
"manufacturer": "Sample Manufacturer",
"model": "unknown",
"serialNumber": "unknown",
"firmwareVersion": "unknown",
"softwareVersion": "unknown",
"customIdentifier": "12-34"
},
"displayCategories": [
"THERMOSTAT",
"TEMPERATURE_SENSOR"
],
"cookie": {},
"capabilities": [
{
"type": "AlexaInterface",
"interface": "Alexa",
"version": "3"
},
{
"type": "AlexaInterface",
"interface": "Alexa.EndpointHealth",
"version": "3",
"properties": {
"supported": [
{
"name": "connectivity"
}
],
"proactivelyReported": true,
"retrievable": false
}
},
{
"type": "AlexaInterface",
"interface": "Alexa.ThermostatController",
"version": "3.1",
"properties": {
"supported": [
{
"name": "upperSetpoint"
},
{
"name": "lowerSetpoint"
},
{
"name": "thermostatMode"
}
],
"proactivelyReported": true,
"retrievable": false
},
"configuration": {
"supportedModes": [
"OFF",
"HEAT",
"COOL",
"AUTO"
]
}
},
{
"type": "AlexaInterface",
"interface": "Alexa.TemperatureSensor",
"version": "3",
"properties": {
"supported": [
{
"name": "temperature"
}
],
"proactivelyReported": true,
"retrievable": false
}
},
{
"type": "AlexaInterface",
"interface": "Alexa.PowerController",
"version": "3",
"properties": {
"supported": [
{
"name": "powerState"
}
],
"proactivelyReported": true,
"retrievable": false
}
}
]
}
Discovery will find the device and add it to the Alexa Home. However, when I go to the device in the app, it will not display the interface and instead say something along the lines of "Waiting for " and show a loading icon. When I go to set the thermostat by voice, such as "Set Office Test HVAC to 74 Degrees Fahrenheit", it says that the device "doesn't support that".
Does anyone know what's going on or how to fix this?
I checked the Cloudwatch logs to see if there was anything being sent from Alexa such as a ReportState directive, but could not find anything. I also tried setting a value on the thermostat to force a ChangeReport, and the ChangeReport seems to have been sent, but there's no update in the app. I have also been unable to find any errors in the Cloudwatch logs. I've checked over the responses and the Discovery message several times just to be sure, and I'm still not sure what the problem is.
I'm trying to get the HVAC device to show up in the app with the proper interface and allow users to control the device.
I had this issue with the version 3.1. I would suggest to change the version of Alexa.ThermostatController capability from 3.1 to 3.0. Also remember that the smart home capabilities used for your skill should mimic and map to physical buttons on your device.
I am making a discord webhook, and I want to know all the different things I can add to it.
As far as styling it goes; I only have a color and a message. (My code is not included besides that, just the code for the color and the message)
.setTitle('Biscuit AIO Cooked!')
.setColor('#84e1f4');
If anyone can link me a site or reply to me with all of the things I can add to the webhook, please do so :)
Read about message embeds and embed visualizer.
At last one of the features of a webhook is that you can send several embeds at once message. So code will looks like this.
{
"content": "this `supports` __a__ **subset** *of* ~~markdown~~ π ```js\nfunction foo(bar) {\n console.log(bar);\n}\n\nfoo(1);```",
"embeds": [
{
"title": "title ~~(did you know you can have markdown here too?)~~",
"description": "this supports [named links](https://discordapp.com) on top of the previously shown subset of markdown. ```\nyes, even code blocks```",
"url": "https://discordapp.com",
"color": 11038012,
"timestamp": "2020-07-03T15:05:41.392Z",
"footer": {
"icon_url": "https://cdn.discordapp.com/embed/avatars/0.png",
"text": "footer text"
},
"thumbnail": {
"url": "https://cdn.discordapp.com/embed/avatars/0.png"
},
"image": {
"url": "https://cdn.discordapp.com/embed/avatars/0.png"
},
"author": {
"name": "author name",
"url": "https://discordapp.com",
"icon_url": "https://cdn.discordapp.com/embed/avatars/0.png"
},
"fields": [
{
"name": "π€",
"value": "some of these properties have certain limits..."
},
{
"name": "π±",
"value": "try exceeding some of them!"
},
{
"name": "π",
"value": "an informative error should show up, and this view will remain as-is until all issues are fixed"
},
{
"name": "<:thonkang:219069250692841473>",
"value": "these last two",
"inline": true
},
{
"name": "<:thonkang:219069250692841473>",
"value": "are inline fields",
"inline": true
}
]
},
{
"title": "title ~~(did you know you can have markdown here too?)~~",
"description": "this supports [named links](https://discordapp.com) on top of the previously shown subset of markdown. ```\nyes, even code blocks```",
"url": "https://discordapp.com",
"color": 11038012,
"timestamp": "2020-07-03T15:05:41.392Z",
"footer": {
"icon_url": "https://cdn.discordapp.com/embed/avatars/0.png",
"text": "footer text"
},
"thumbnail": {
"url": "https://cdn.discordapp.com/embed/avatars/0.png"
},
"image": {
"url": "https://cdn.discordapp.com/embed/avatars/0.png"
},
"author": {
"name": "author name",
"url": "https://discordapp.com",
"icon_url": "https://cdn.discordapp.com/embed/avatars/0.png"
},
"fields": [
{
"name": "π€",
"value": "some of these properties have certain limits..."
},
{
"name": "π±",
"value": "try exceeding some of them!"
},
{
"name": "π",
"value": "an informative error should show up, and this view will remain as-is until all issues are fixed"
},
{
"name": "<:thonkang:219069250692841473>",
"value": "these last two",
"inline": true
},
{
"name": "<:thonkang:219069250692841473>",
"value": "are inline fields",
"inline": true
}
]
}
]
}
I'm trying out adaptive cards in an attempt to integrate warnings through logic apps with teams. the question i'm about to ask is related to having the connector in Logic app wait for an response from the adaptive card in Teams after being sent from the Logic app.
I've managed to create my adaptive card and in that card i have the necessary information and two actions at the bottom that i want my logic app to react on so to speak.
My Adaptive card looks something like this:
{
"type": "AdaptiveCard",
"version": "1.0",
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"body": [
{
"type": "TextBlock",
"text": "Alert - Employee email differences found:",
"weight": "Bolder",
"size": "Medium",
"horizontalAlignment": "Left",
"spacing": "Medium",
"maxLines": 0
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "New Email",
"weight": "Bolder"
},
{
"type": "TextBlock",
"text": "Test.Person21#mail.com"
},
{
"type": "TextBlock",
"text": "Test.Person22#mail.com"
}
]
},
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "Old Email",
"weight": "Bolder"
},
{
"type": "TextBlock",
"text": "Test.Person11#mail.com"
},
{
"type": "TextBlock",
"text": "Test.Person12#mail.com"
}
]
}
],
"separator": true
}
],
"actions": [
{
"type": "Action.Submit",
"title": "Update Now",
"style": "positive",
"data": true
},
{
"type": "Action.Submit",
"title": "Dismiss",
"style": "destructive",
"data": false
}
]
}
As you can se when i push on "update now" i get the error message saying "there is no backend/app to connect to" (in swedish - "Can't reach application, try again") basically.
So again what i'm trying to do is for the Logic app to wait for the respons.
After the logic app has sen the message it "completes".
So is this possible? If so, how do i get this to work?
while logic apps can send cards to MS Teams they can not listen on actions performed on those cards.
To be able to use card actions you need to have a custom service made that listens and acts on those activities.
Hopefully someone can help me with this because I've been stumped for a week.
I am creating a simple Alexa skill from one of the samples. It's the color picker skill - you tell Alexa your favorite color, and then you ask her your favorite color. I'm using Custom Slots, and the Skill Service doesn't want to return a value for the color. It launches successfully, and then loads the correct intent, however it doesn't send the correct value. Instead, there's not even a value parameter in the output, just name and confirmation status.
Here's my skill's JSON, followed by the request JSON output after I tell the skill: "My color is red." I want the skill to pass "red" into the value parameter.
{
"interactionModel": {
"languageModel": {
"invocationName": "color picker",
"intents": [
{
"name": "MyColorIsIntent",
"slots": [
{
"name": "color",
"type": "LIST_OF_COLORS"
}
],
"samples": [
"my color is {color}",
"{color} is my color"
]
},
{
"name": "WhatsMyColorIntent",
"slots": [],
"samples": [
"what's my color",
"what's my favorite color"
]
},
{
"name": "AMAZON.NavigateHomeIntent",
"samples": []
}
],
"types": [
{
"name": "LIST_OF_COLORS",
"values": [
{
"name": {
"value": "green"
}
},
{
"name": {
"value": "red"
}
},
{
"name": {
"value": "yellow"
}
},
{
"name": {
"value": "orange"
}
},
{
"name": {
"value": "black"
}
},
{
"name": {
"value": "blue"
}
}
]
}
]
}
}
}
Down below is the request:
"request": {
"type": "IntentRequest",
"requestId": "amzn1.echo-api.request.918d6da6-cd7e-4bb8-a2a9-41fb1af8a354",
"timestamp": "2018-10-01T01:53:56Z",
"locale": "en-US",
"intent": {
"name": "MyColorIsIntent",
"confirmationStatus": "NONE",
"slots": {
"Color": {
"name": "Color",
"confirmationStatus": "NONE"
}
}
}
}
Your issue is that slot "color" should be named "Color" and your sample references changed to reflect this so "my color is {Color}", and "{Color} is my color", It is not picking up the slot because the name is identical.
Be sure to also complete the skill with the required Intents for stop and help, currently, this will just continue asking for color choices until you kill the program.
βThis is what happened:
I was working on different versions of the same skill, each with the same invocation name. When I typed in the invocation name, it actually opened an outdated version of the skill (I hadn't deleted the old skills - I had like 3 different ones - I like to start over). I didn't realize that when you click "test" you can test any of your saved skills, not just the one you have open.
I've got a peculiar problem with my new Alexa skill. The skill takes in a user input flavor, either "bitter", "spicy", "sweet", "dry", or "sour" as defined in the custom slots. For whatever reason, when I test with "sweet" and "spicy", the response comes without a value attribute for the slot. For example, querying the skill using the keyword "bitter" returns:
{
"session": {
"sessionId": "[masked]",
"application": {
"applicationId": "[masked]"
},
"attributes": {},
"user": {
"userId": "[masked]"
},
"new": true
},
"request": {
"type": "IntentRequest",
"requestId": "[masked]",
"locale": "en-US",
"timestamp": "2016-11-07T03:48:53Z",
"intent": {
"name": "GetBerriesByFlavorIntent",
"slots": {
"flavor": {
"name": "flavor",
"value": "bitter"
}
}
}
},
"version": "1.0"
}
Notice the flavor slot has an attribute "value", which is "bitter". Now, when I call with "sweet" or "spicy", I get:
{
"session": {
"sessionId": "[masked]",
"application": {
"applicationId": "[masked]"
},
"attributes": {},
"user": {
"userId": "[masked]"
},
"new": true
},
"request": {
"type": "IntentRequest",
"requestId": "[masked]",
"locale": "en-US",
"timestamp": "2016-11-07T03:50:54Z",
"intent": {
"name": "GetBerriesByFlavorIntent",
"slots": {
"flavor": {
"name": "flavor"
}
}
}
},
"version": "1.0"
}
Any ideas what could be causing this to happen? I can verify that "dry" and "sour" also work, so it's really curious that these two particular keywords are having so much trouble. I can also verify that Alexa is understanding the words correctly, as I am testing on the Alexa console and hard-coding the input values that are the same as the custom slot values.
Full code